/* Generated by Cython 0.23.4 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "Minuit/inc/Minuit2/ContoursError.h",
            "Minuit/inc/Minuit2/FCNBase.h",
            "Minuit/inc/Minuit2/FunctionMinimum.h",
            "Minuit/inc/Minuit2/MinosError.h",
            "Minuit/inc/Minuit2/MinuitParameter.h",
            "Minuit/inc/Minuit2/MnApplication.h",
            "Minuit/inc/Minuit2/MnContours.h",
            "Minuit/inc/Minuit2/MnGlobalCorrelationCoeff.h",
            "Minuit/inc/Minuit2/MnHesse.h",
            "Minuit/inc/Minuit2/MnMigrad.h",
            "Minuit/inc/Minuit2/MnMinos.h",
            "Minuit/inc/Minuit2/MnStrategy.h",
            "Minuit/inc/Minuit2/MnUserCovariance.h",
            "Minuit/inc/Minuit2/MnUserParameterState.h",
            "Minuit/inc/Minuit2/VariableMetricBuilder.h",
            "iminuit/PythonFCN.h"
        ],
        "include_dirs": [
            "Minuit/inc"
        ],
        "language": "c++"
    }
}
END: Cython Metadata */

#define 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 < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_23_4"
#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
#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_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
#define CYTHON_USE_PYLONG_INTERNALS 1
#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"
  #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 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
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #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_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)
#else
  #define CYTHON_PEP393_ENABLED 0
  #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_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]))
#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
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? 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
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#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
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#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) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#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
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #define CYTHON_INLINE inline
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    operator T&() { return *ptr; }
  private:
    T *ptr;
};

#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 PY_MAJOR_VERSION >= 3
  #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_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#endif

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

#define __PYX_HAVE__iminuit___libiminuit
#define __PYX_HAVE_API__iminuit___libiminuit
#include "math.h"
#include "string.h"
#include <string>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <vector>
#include <utility>
#include <memory>
#include "Minuit2/FCNBase.h"
#include "Minuit2/MnApplication.h"
#include "Minuit2/MinuitParameter.h"
#include "Minuit2/MnUserCovariance.h"
#include "Minuit2/MnGlobalCorrelationCoeff.h"
#include "Minuit2/MnUserParameterState.h"
#include "Minuit2/MnStrategy.h"
#include "Minuit2/MnMigrad.h"
#include "Minuit2/MnHesse.h"
#include "Minuit2/MnMinos.h"
#include "Minuit2/MinosError.h"
#include "Minuit2/FunctionMinimum.h"
#include "Minuit2/VariableMetricBuilder.h"
#include "Minuit2/MnContours.h"
#include "Minuit2/ContoursError.h"
#include "PythonFCN.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#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_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; 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_DEFAULT 0
#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)))  )
#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) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _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 char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE 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_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((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)
#if PY_MAJOR_VERSION < 3
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);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#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)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#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 && __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));
    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 PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "iminuit/_libiminuit.pyx",
  "iminuit/Minuit2Struct.pxi",
  "stringsource",
};

/*--- Type declarations ---*/
struct __pyx_obj_7iminuit_11_libiminuit_Minuit;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr;
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr;

/* "iminuit/_libiminuit.pyx":44
 *     return m[k] if k in m else d
 * 
 * cdef class Minuit:             # <<<<<<<<<<<<<<
 *     # Standard stuff
 * 
 */
struct __pyx_obj_7iminuit_11_libiminuit_Minuit {
  PyObject_HEAD
  struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *__pyx_vtab;
  PyObject *fcn;
  PyObject *pos2var;
  PyObject *var2pos;
  PyObject *initialvalue;
  PyObject *initialerror;
  PyObject *initiallimit;
  PyObject *initialfix;
  PythonFCN *pyfcn;
  MnApplication *minimizer;
  FunctionMinimum *cfmin;
  MnUserParameterState *last_upst;
  double errordef;
  double tol;
  unsigned int strategy;
  PyObject *print_level;
  int throw_nan;
  PyObject *parameters;
  PyObject *args;
  PyObject *values;
  PyObject *errors;
  PyObject *covariance;
  double fval;
  int ncalls;
  double edm;
  PyObject *merrors;
  PyObject *gcc;
  PyObject *fitarg;
  PyObject *narg;
  PyObject *merrors_struct;
  PyObject *frontend;
};


/* "iminuit/_libiminuit.pyx":193
 *     """
 * 
 *     def __init__(self, fcn,             # <<<<<<<<<<<<<<
 *                  throw_nan=False, pedantic=True,
 *                  frontend=None, forced_parameters=None, print_level=1,
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ {
  PyObject_HEAD
  PyObject *__pyx_v_args;
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self;
};


/* "iminuit/_libiminuit.pyx":333
 * 
 *         self.parameters = args
 *         self.args = tuple(self.initialvalue[k] for k in args)             # <<<<<<<<<<<<<<
 *         self.values = {k: self.initialvalue[k] for k in args}
 *         self.errors = {k: self.initialerror[k] for k in args}
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *__pyx_outer_scope;
  PyObject *__pyx_v_k;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":536
 *         return self.merrors_struct
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """Error or correlation matrix in tuple or tuples format."""
 *         if self.last_upst is NULL:
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix {
  PyObject_HEAD
  MnUserCovariance __pyx_v_cov;
  PyObject *__pyx_v_params;
};


/* "iminuit/_libiminuit.pyx":550
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *__pyx_outer_scope;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_iv2;
  PyObject *__pyx_v_v2;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
};

struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *__pyx_outer_scope;
  PyObject *__pyx_v_iv1;
  PyObject *__pyx_v_v1;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":556
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2)             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *__pyx_outer_scope;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_iv2;
  PyObject *__pyx_v_v2;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
};

struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *__pyx_outer_scope;
  PyObject *__pyx_v_iv1;
  PyObject *__pyx_v_v1;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":811
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)
 * 
 *     def mnprofile(self, vname, bins=30, bound=2, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """Calculate minos profile around the specified range.
 * 
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile {
  PyObject_HEAD
  PyObject *__pyx_v_bins;
  PyObject *__pyx_v_binstep;
  PyObject *__pyx_v_bound;
  PyObject *__pyx_v_results;
  PyObject *__pyx_v_themin;
};


/* "iminuit/_libiminuit.pyx":849
 * 
 *         values = array.array(ARRAY_DOUBLE_TYPECODE,
 *                              (bound[0] + binstep * i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         results = array.array(ARRAY_DOUBLE_TYPECODE)
 *         migrad_status = []
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *__pyx_outer_scope;
  PyObject *__pyx_v_i;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":868
 *             themin = min(results)
 *             results = array.array(ARRAY_DOUBLE_TYPECODE,
 *                                   (x - themin for x in results))             # <<<<<<<<<<<<<<
 * 
 *         return values, results, migrad_status
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *__pyx_outer_scope;
  PyObject *__pyx_v_x;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":912
 *                                       band=band, text=text)
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """Calculate cost function profile around specify range.
 * 
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile {
  PyObject_HEAD
  PyObject *__pyx_v_bins;
  PyObject *__pyx_v_binstep;
  PyObject *__pyx_v_bound;
};


/* "iminuit/_libiminuit.pyx":948
 *         # center value
 *         bins = array.array(ARRAY_DOUBLE_TYPECODE,
 *                            (bound[0] + binstep * i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         ret = array.array(ARRAY_DOUBLE_TYPECODE)
 *         pos = self.var2pos[vname]
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *__pyx_outer_scope;
  PyObject *__pyx_v_i;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":994
 *         return x, y
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D contour scan.
 * 
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour {
  PyObject_HEAD
  PyObject *__pyx_v_x_bins;
  PyObject *__pyx_v_x_binstep;
  PyObject *__pyx_v_x_bound;
  PyObject *__pyx_v_y_bins;
  PyObject *__pyx_v_y_binstep;
  PyObject *__pyx_v_y_bound;
};


/* "iminuit/_libiminuit.pyx":1057
 * 
 *         x_val = array.array(ARRAY_DOUBLE_TYPECODE,
 *                             (x_bound[0] + x_binstep * i for i in xrange(x_bins)))             # <<<<<<<<<<<<<<
 *         y_val = array.array(ARRAY_DOUBLE_TYPECODE,
 *                             (y_bound[0] + y_binstep * i for i in xrange(y_bins)))
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *__pyx_outer_scope;
  PyObject *__pyx_v_i;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":1059
 *                             (x_bound[0] + x_binstep * i for i in xrange(x_bins)))
 *         y_val = array.array(ARRAY_DOUBLE_TYPECODE,
 *                             (y_bound[0] + y_binstep * i for i in xrange(y_bins)))             # <<<<<<<<<<<<<<
 * 
 *         x_pos = self.var2pos[x]
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *__pyx_outer_scope;
  PyObject *__pyx_v_i;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":1312
 *             return ConsoleFrontend()
 * 
 *     def _check_extra_args(self, parameters, kwd):             # <<<<<<<<<<<<<<
 *         """Check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_' + p for p in parameters)
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args {
  PyObject_HEAD
  PyObject *__pyx_v_parameters;
};


/* "iminuit/_libiminuit.pyx":1314
 *     def _check_extra_args(self, parameters, kwd):
 *         """Check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_' + p for p in parameters)             # <<<<<<<<<<<<<<
 *         limit_param = set('limit_' + p for p in parameters)
 *         error_param = set('error_' + p for p in parameters)
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *__pyx_outer_scope;
  PyObject *__pyx_v_p;
};


/* "iminuit/_libiminuit.pyx":1315
 *         """Check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_' + p for p in parameters)
 *         limit_param = set('limit_' + p for p in parameters)             # <<<<<<<<<<<<<<
 *         error_param = set('error_' + p for p in parameters)
 *         for k in kwd.keys():
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *__pyx_outer_scope;
  PyObject *__pyx_v_p;
};


/* "iminuit/_libiminuit.pyx":1316
 *         fixed_param = set('fix_' + p for p in parameters)
 *         limit_param = set('limit_' + p for p in parameters)
 *         error_param = set('error_' + p for p in parameters)             # <<<<<<<<<<<<<<
 *         for k in kwd.keys():
 *             if k not in parameters and \
 */
struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *__pyx_outer_scope;
  PyObject *__pyx_v_p;
};



/* "iminuit/_libiminuit.pyx":44
 *     return m[k] if k in m else d
 * 
 * cdef class Minuit:             # <<<<<<<<<<<<<<
 *     # Standard stuff
 * 
 */

struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit {
  PyObject *(*construct_FCN)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *);
  void (*clear_cobj)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *);
  PyObject *(*refreshInternalState)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *);
  MnUserParameterState *(*initialParameterState)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *);
};
static struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *__pyx_vtabptr_7iminuit_11_libiminuit_Minuit;

/* --- Runtime support code (head) --- */
#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)

#if CYTHON_COMPILING_IN_CPYTHON
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);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

#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

static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

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

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);

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

#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

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj)   ((obj)->ob_type->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj)   PyCallable_Check(obj)
#endif

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

#if CYTHON_COMPILING_IN_CPYTHON
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);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

#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 CYTHON_INLINE 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);

#if CYTHON_COMPILING_IN_CPYTHON
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);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
                                             int is_tuple, int has_known_size, int decref_tuple);

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);

static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping);

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyFloat_SubtractObjC(PyObject *op1, PyObject *op2, double floatval, int inplace);
#else
#define __Pyx_PyFloat_SubtractObjC(op1, op2, floatval, inplace)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);

#include <string.h>

static int __Pyx_SetVtable(PyObject *dict, void *vtable);

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __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);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);

#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
#include <stdexcept>
#include <ios>
static void __Pyx_CppExn2PyErr() {
  try {
    if (PyErr_Occurred())
      ; // let the latest Python exn pass through and ignore the current one
    else
      throw;
  } catch (const std::bad_alloc& exn) {
    PyErr_SetString(PyExc_MemoryError, exn.what());
  } catch (const std::bad_cast& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::domain_error& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::invalid_argument& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::ios_base::failure& exn) {
    PyErr_SetString(PyExc_IOError, exn.what());
  } catch (const std::out_of_range& exn) {
    PyErr_SetString(PyExc_IndexError, exn.what());
  } catch (const std::overflow_error& exn) {
    PyErr_SetString(PyExc_OverflowError, exn.what());
  } catch (const std::range_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::underflow_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::exception& exn) {
    PyErr_SetString(PyExc_RuntimeError, exn.what());
  }
  catch (...)
  {
    PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  }
}
#endif

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

#include <new>

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);

typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(PyTypeObject *type, __pyx_coroutine_body_t body,
                                                   PyObject *closure, PyObject *name, PyObject *qualname);
static int __Pyx_Coroutine_clear(PyObject *self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif

static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

static int __Pyx_patch_abc(void);

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

static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *);

static int __Pyx_check_binary_version(void);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static PyObject *__pyx_f_7iminuit_11_libiminuit_6Minuit_construct_FCN(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto*/
static void __pyx_f_7iminuit_11_libiminuit_6Minuit_clear_cobj(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7iminuit_11_libiminuit_6Minuit_refreshInternalState(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto*/
static MnUserParameterState *__pyx_f_7iminuit_11_libiminuit_6Minuit_initialParameterState(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto*/

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

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

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

/* Module declarations from 'libcpp.vector' */

/* Module declarations from 'libcpp.utility' */

/* Module declarations from 'iminuit._libiminuit' */
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit_Minuit = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct____init__ = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_10_profile = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_12_contour = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr = 0;
static PyTypeObject *__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr = 0;
static PyObject *__pyx_f_7iminuit_11_libiminuit_cfmin2struct(FunctionMinimum *); /*proto*/
static PyObject *__pyx_f_7iminuit_11_libiminuit_minuitparam2struct(MinuitParameter); /*proto*/
static PyObject *__pyx_f_7iminuit_11_libiminuit_minoserror2struct(MinosError); /*proto*/
static PyObject *__pyx_f_7iminuit_11_libiminuit_maplookup(PyObject *, PyObject *, PyObject *); /*proto*/
static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
static PyObject *__pyx_convert_pair_to_py_double____double(std::pair<double,double>  const &); /*proto*/
static PyObject *__pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___(const std::vector<std::pair<double,double> >  &); /*proto*/
#define __Pyx_MODULE_NAME "iminuit._libiminuit"
int __pyx_module_is_main_iminuit___libiminuit = 0;

/* Implementation of 'iminuit._libiminuit' */
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_round;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_RuntimeWarning;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_min;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_NameError;
static char __pyx_k_x[] = "x";
static char __pyx_k_y[] = "y";
static char __pyx_k_up[] = "up";
static char __pyx_k__19[] = "*";
static char __pyx_k_all[] = "__all__";
static char __pyx_k_edm[] = "edm";
static char __pyx_k_fcn[] = "fcn";
static char __pyx_k_fix[] = "fix_";
static char __pyx_k_kwd[] = "kwd";
static char __pyx_k_min[] = "min";
static char __pyx_k_var[] = "var";
static char __pyx_k_args[] = "args";
static char __pyx_k_band[] = "band";
static char __pyx_k_bins[] = "bins";
static char __pyx_k_copy[] = "copy";
static char __pyx_k_fval[] = "fval";
static char __pyx_k_keys[] = "keys";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_name[] = "name";
static char __pyx_k_nfcn[] = "nfcn";
static char __pyx_k_send[] = "send";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_text[] = "text";
static char __pyx_k_warn[] = "warn";
static char __pyx_k_HESSE[] = "HESSE";
static char __pyx_k_MINOS[] = "MINOS";
static char __pyx_k_array[] = "array";
static char __pyx_k_bound[] = "bound";
static char __pyx_k_close[] = "close";
static char __pyx_k_dtype[] = "dtype";
static char __pyx_k_edges[] = "edges";
static char __pyx_k_error[] = "error";
static char __pyx_k_items[] = "items";
static char __pyx_k_limit[] = "limit_";
static char __pyx_k_lower[] = "lower";
static char __pyx_k_ncall[] = "ncall";
static char __pyx_k_numpy[] = "numpy";
static char __pyx_k_range[] = "range";
static char __pyx_k_round[] = "round";
static char __pyx_k_sigma[] = "sigma";
static char __pyx_k_throw[] = "throw";
static char __pyx_k_upper[] = "upper";
static char __pyx_k_value[] = "value";
static char __pyx_k_vname[] = "vname";
static char __pyx_k_MIGRAD[] = "MIGRAD";
static char __pyx_k_Minuit[] = "Minuit";
static char __pyx_k_Struct[] = "Struct";
static char __pyx_k_append[] = "append";
static char __pyx_k_fix__s[] = "fix_%s";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_matrix[] = "matrix";
static char __pyx_k_migrad[] = "migrad";
static char __pyx_k_nsigma[] = "nsigma";
static char __pyx_k_nsplit[] = "nsplit";
static char __pyx_k_number[] = "number";
static char __pyx_k_resume[] = "resume";
static char __pyx_k_update[] = "update";
static char __pyx_k_xrange[] = "xrange";
static char __pyx_k_IPYTHON[] = "__IPYTHON__";
static char __pyx_k_error_2[] = "error_";
static char __pyx_k_float64[] = "float64";
static char __pyx_k_genexpr[] = "genexpr";
static char __pyx_k_iminuit[] = "iminuit";
static char __pyx_k_maxcall[] = "maxcall";
static char __pyx_k_profile[] = "profile";
static char __pyx_k_describe[] = "describe";
static char __pyx_k_errordef[] = "errordef";
static char __pyx_k_frontend[] = "frontend";
static char __pyx_k_get_fmin[] = "get_fmin";
static char __pyx_k_is_const[] = "is_const";
static char __pyx_k_is_fixed[] = "is_fixed";
static char __pyx_k_is_valid[] = "is_valid";
static char __pyx_k_pedantic[] = "pedantic";
static char __pyx_k_plotting[] = "_plotting";
static char __pyx_k_warnings[] = "warnings";
static char __pyx_k_NameError[] = "NameError";
static char __pyx_k_enumerate[] = "enumerate";
static char __pyx_k_migrad_ok[] = "migrad_ok";
static char __pyx_k_mnprofile[] = "mnprofile";
static char __pyx_k_numpoints[] = "numpoints";
static char __pyx_k_precision[] = "precision";
static char __pyx_k_sigma_res[] = "sigma_res";
static char __pyx_k_throw_nan[] = "throw_nan";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_has_limits[] = "has_limits";
static char __pyx_k_param_name[] = "param_name";
static char __pyx_k_parameters[] = "parameters";
static char __pyx_k_print_fmin[] = "print_fmin";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_show_sigma[] = "show_sigma";
static char __pyx_k_skip_fixed[] = "skip_fixed";
static char __pyx_k_correlation[] = "correlation";
static char __pyx_k_extract_fix[] = "extract_fix";
static char __pyx_k_lower_limit[] = "lower_limit";
static char __pyx_k_lower_valid[] = "lower_valid";
static char __pyx_k_print_hline[] = "print_hline";
static char __pyx_k_print_level[] = "print_level";
static char __pyx_k_print_param[] = "print_param";
static char __pyx_k_upper_limit[] = "upper_limit";
static char __pyx_k_upper_valid[] = "upper_valid";
static char __pyx_k_HtmlFrontend[] = "HtmlFrontend";
static char __pyx_k_LatexFactory[] = "LatexFactory";
static char __pyx_k_RuntimeError[] = "RuntimeError";
static char __pyx_k_build_matrix[] = "build_matrix";
static char __pyx_k_draw_contour[] = "draw_contour";
static char __pyx_k_draw_profile[] = "draw_profile";
static char __pyx_k_hesse_failed[] = "hesse_failed";
static char __pyx_k_iminuit_util[] = "iminuit.util";
static char __pyx_k_print_banner[] = "print_banner";
static char __pyx_k_print_matrix[] = "print_matrix";
static char __pyx_k_print_merror[] = "print_merror";
static char __pyx_k_set_errordef[] = "set_errordef";
static char __pyx_k_subtract_min[] = "subtract_min";
static char __pyx_k_auto_frontend[] = "_auto_frontend";
static char __pyx_k_extract_error[] = "extract_error";
static char __pyx_k_extract_limit[] = "extract_limit";
static char __pyx_k_iminuit_latex[] = "iminuit.latex";
static char __pyx_k_lower_new_min[] = "lower_new_min";
static char __pyx_k_prepare_param[] = "_prepare_param";
static char __pyx_k_upper_new_min[] = "upper_new_min";
static char __pyx_k_RuntimeWarning[] = "RuntimeWarning";
static char __pyx_k_at_lower_limit[] = "at_lower_limit";
static char __pyx_k_at_upper_limit[] = "at_upper_limit";
static char __pyx_k_draw_mncontour[] = "draw_mncontour";
static char __pyx_k_frontends_html[] = "frontends.html";
static char __pyx_k_has_covariance[] = "has_covariance";
static char __pyx_k_is_clean_state[] = "is_clean_state";
static char __pyx_k_mncontour_grid[] = "mncontour_grid";
static char __pyx_k_ConsoleFrontend[] = "ConsoleFrontend";
static char __pyx_k_has_lower_limit[] = "has_lower_limit";
static char __pyx_k_has_upper_limit[] = "has_upper_limit";
static char __pyx_k_matrix_accurate[] = "matrix_accurate";
static char __pyx_k_Run_Migrad_first[] = "Run Migrad first";
static char __pyx_k_Run_migrad_first[] = "Run migrad first";
static char __pyx_k_at_lower_max_fcn[] = "at_lower_max_fcn";
static char __pyx_k_at_upper_max_fcn[] = "at_upper_max_fcn";
static char __pyx_k_check_extra_args[] = "_check_extra_args";
static char __pyx_k_default_errordef[] = "default_errordef";
static char __pyx_k_get_param_states[] = "get_param_states";
static char __pyx_k_has_posdef_covar[] = "has_posdef_covar";
static char __pyx_k_is_above_max_edm[] = "is_above_max_edm";
static char __pyx_k_build_param_table[] = "build_param_table";
static char __pyx_k_forced_parameters[] = "forced_parameters";
static char __pyx_k_frontends_console[] = "frontends.console";
static char __pyx_k_HesseFailedWarning[] = "HesseFailedWarning";
static char __pyx_k_has_accurate_covar[] = "has_accurate_covar";
static char __pyx_k_list_of_vary_param[] = "list_of_vary_param";
static char __pyx_k_InitialParamWarning[] = "InitialParamWarning";
static char __pyx_k_NotImplementedError[] = "NotImplementedError";
static char __pyx_k_Number_of_arguments[] = "Number of arguments";
static char __pyx_k_Unknown_parameter_s[] = "Unknown parameter %s";
static char __pyx_k_iminuit_py23_compat[] = "iminuit.py23_compat";
static char __pyx_k_list_of_fixed_param[] = "list_of_fixed_param";
static char __pyx_k_print_initial_param[] = "print_initial_param";
static char __pyx_k_Parameter_name_tuple[] = "Parameter name tuple";
static char __pyx_k_has_valid_parameters[] = "has_valid_parameters";
static char __pyx_k_ARRAY_DOUBLE_TYPECODE[] = "ARRAY_DOUBLE_TYPECODE";
static char __pyx_k_Parameter_value_tuple[] = "Parameter value tuple";
static char __pyx_k_has_made_posdef_covar[] = "has_made_posdef_covar";
static char __pyx_k_init___locals_genexpr[] = "__init__.<locals>.genexpr";
static char __pyx_k_matrix_locals_genexpr[] = "matrix.<locals>.genexpr";
static char __pyx_k_prepare_initial_param[] = "_prepare_initial_param";
static char __pyx_k_Run_migrad_hesse_first[] = "Run migrad/hesse first";
static char __pyx_k_contour_locals_genexpr[] = "contour.<locals>.genexpr";
static char __pyx_k_has_reached_call_limit[] = "has_reached_call_limit";
static char __pyx_k_profile_locals_genexpr[] = "profile.<locals>.genexpr";
static char __pyx_k_get_initial_param_state[] = "get_initial_param_state";
static char __pyx_k_iminuit_iminuit_warnings[] = "iminuit.iminuit_warnings";
static char __pyx_k_mnprofile_locals_genexpr[] = "mnprofile.<locals>.genexpr";
static char __pyx_k_Map_variable_name_to_position[] = "Map variable name to position";
static char __pyx_k_Map_variable_position_to_name[] = "Map variable position to name";
static char __pyx_k_Cannot_understand_keyword_s_May[] = "Cannot understand keyword %s. May be a typo?\nThe parameters are %r";
static char __pyx_k_Global_correlation_coefficients[] = "Global correlation coefficients (dict : name -> gcc)";
static char __pyx_k_IPython_Minuit_class_definition[] = "IPython Minuit class definition.\n";
static char __pyx_k_Minos_require_function_to_be_at[] = "Minos require function to be at the minimum. Run migrad first.";
static char __pyx_k_Parameter_parabolic_errors_dict[] = "Parameter parabolic errors (dict: name -> error)";
static char __pyx_k_Raise_runtime_error_if_function[] = "Raise runtime error if function evaluate to nan.";
static char __pyx_k_check_extra_args_locals_genexpr[] = "_check_extra_args.<locals>.genexpr";
static char __pyx_k_frontend_object_Minuit_frontend[] = "frontend: object\nMinuit frontend.\n\n    TODO: link to description.\n    ";
static char __pyx_k_mncontour_has_to_be_run_on_vary[] = "mncontour has to be run on vary parameters.";
static char __pyx_k_s_float_But_there_is_no_paramet[] = "%s float. But there is no parameter %s.                     Ignore.";
static char __pyx_k_s_is_given_But_there_is_no_para[] = "%s is given. But there is no parameter %s. Ignore.";
static char __pyx_k_tol_double_Tolerance_One_of_the[] = "tol: 'double'\nTolerance.\n\n    One of the MIGRAD convergence criteria is ``edm < edm_max``,\n    where ``edm_max`` is calculated as ``edm_max = 0.0001 * tol * UP``.\n    ";
static char __pyx_k_Cannot_find_s_in_list_of_variabl[] = "Cannot find %s in list of variables.";
static char __pyx_k_Cost_function_usually_a_chi_2_or[] = "Cost function (usually a chi^2 or likelihood function)";
static char __pyx_k_Covariance_is_not_valid_May_be_t[] = "Covariance is not valid. May be the last Hesse call failed?";
static char __pyx_k_Covariance_matrix_dict_name1_nam[] = "Covariance matrix (dict (name1, name2) -> covariance).\n\n    .. seealso:: :meth:`matrix`\n    ";
static char __pyx_k_Estimated_distance_to_minimum_se[] = "Estimated distance to minimum.\n\n    .. seealso:: :meth:`get_fmin`\n    ";
static char __pyx_k_Function_mimimum_is_not_valid_Ma[] = "Function mimimum is not valid. Make sure migrad converge first";
static char __pyx_k_Function_minimum_has_not_been_ca[] = "Function minimum has not been calculated.";
static char __pyx_k_HESSE_Failed_Covariance_and_Glob[] = "HESSE Failed. Covariance and GlobalCC will not be available";
static char __pyx_k_Last_evaluated_FCN_value_seealso[] = "Last evaluated FCN value\n\n    .. seealso:: :meth:`get_fmin`\n    ";
static char __pyx_k_MINOS_errors_dict_Using_this_met[] = "MINOS errors (dict).\n\n    Using this method is not recommended.\n    It was added only for PyMinuit compatibility.\n    Use :meth:`get_merrors` instead, which returns a dictionary of\n    name -> :ref:`minos-error-struct` instead.\n\n    Dictionary entries for each parameter:\n\n    * (name,1.0) -> upper error\n    * (name,-1.0) -> lower error\n    ";
static char __pyx_k_Migrad_fails_to_converge_for_s_f[] = "Migrad fails to converge for %s=%f";
static char __pyx_k_Number_of_FCN_call_of_last_migra[] = "Number of FCN call of last migrad / minos / hesse run.";
static char __pyx_k_Parameter_s_does_not_have_initia[] = "Parameter %s does not have initial value. Assume 0.";
static char __pyx_k_Parameter_s_is_floating_but_does[] = "Parameter %s is floating but does not have initial step size. Assume 1.";
static char __pyx_k_Parameter_values_dict_name_value[] = "Parameter values (dict: name -> value)";
static char __pyx_k_Request_for_minimization_subtrac[] = "Request for minimization subtraction but no minimization has been done. Run migrad first.";
static char __pyx_k_Specified_parameters_r_cannot_be[] = "Specified parameters(%r) cannot be found in parameter list :";
static char __pyx_k_Specified_variable_name_for_mino[] = "Specified variable name for minos is set to fixed";
static char __pyx_k_Specify_nsigma_bound_but_error_b[] = "Specify nsigma bound but error but error matrix is not accurate.";
static char __pyx_k_errordef_double_Amount_of_change[] = "errordef: 'double'\nAmount of change in FCN that defines 1 :math:`sigma` error.\n\n    Default value is 1.0. `errordef` should be 1.0 for :math:`\\chi^2` cost\n    function and 0.5 for negative log likelihood function.\n\n    This parameter is sometimes called ``UP`` in the MINUIT docs.\n    ";
static char __pyx_k_errordef_is_not_given_Default_to[] = "errordef is not given. Default to 1.";
static char __pyx_k_fitarg_object_Current_Minuit_sta[] = "fitarg: object\nCurrent Minuit state in form of a dict.\n\n    * name -> value\n    * error_name -> error\n    * fix_name -> fix\n    * limit_name -> (lower_limit, upper_limit)\n\n    This is very useful when you want to save the fit parameters and\n    re-use them later. For example,::\n\n        m = Minuit(f, x=1)\n        m.migrad()\n        fitarg = m.fitarg\n\n        m2 = Minuit(f, **fitarg)\n    ";
static char __pyx_k_limit_for_parameter_s_is_invalid[] = "limit for parameter %s is invalid. %r";
static char __pyx_k_matrix_locals_genexpr_locals_gen[] = "matrix.<locals>.genexpr.<locals>.genexpr";
static char __pyx_k_merrors_struct_object_MINOS_erro[] = "merrors_struct: object\nMINOS error calculation information (dict name -> struct)";
static char __pyx_k_print_level_object_Print_level_0[] = "print_level: object\nPrint level.\n\n    - 0: quiet\n    - 1: print stuff the end\n    - 2: 1+fit status during call\n\n    Yes I know the case is wrong but this is to keep it compatible with PyMinuit.\n    ";
static char __pyx_k_skip_fixed_False_is_not_supporte[] = "skip_fixed=False is not supported";
static char __pyx_k_strategy_unsigned_int_Strategy_i[] = "strategy: 'unsigned int'\nStrategy integer code.\n\n    - 0 fast\n    - 1 default\n    - 2 slow but accurate\n    ";
static char __pyx_k_s_is_given_But_there_is_no_para_2[] = "%s is given. But there is no parameter %s.                     Ignore.";
static PyObject *__pyx_n_s_ARRAY_DOUBLE_TYPECODE;
static PyObject *__pyx_kp_u_Cannot_find_s_in_list_of_variabl;
static PyObject *__pyx_kp_u_Cannot_understand_keyword_s_May;
static PyObject *__pyx_n_s_ConsoleFrontend;
static PyObject *__pyx_kp_u_Covariance_is_not_valid_May_be_t;
static PyObject *__pyx_kp_u_Function_mimimum_is_not_valid_Ma;
static PyObject *__pyx_kp_u_Function_minimum_has_not_been_ca;
static PyObject *__pyx_n_u_HESSE;
static PyObject *__pyx_kp_u_HESSE_Failed_Covariance_and_Glob;
static PyObject *__pyx_n_s_HesseFailedWarning;
static PyObject *__pyx_n_s_HtmlFrontend;
static PyObject *__pyx_n_s_IPYTHON;
static PyObject *__pyx_n_s_InitialParamWarning;
static PyObject *__pyx_n_s_LatexFactory;
static PyObject *__pyx_n_u_MIGRAD;
static PyObject *__pyx_n_u_MINOS;
static PyObject *__pyx_kp_u_Migrad_fails_to_converge_for_s_f;
static PyObject *__pyx_kp_u_Minos_require_function_to_be_at;
static PyObject *__pyx_n_u_Minuit;
static PyObject *__pyx_n_s_NameError;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_kp_u_Parameter_s_does_not_have_initia;
static PyObject *__pyx_kp_u_Parameter_s_is_floating_but_does;
static PyObject *__pyx_kp_u_Request_for_minimization_subtrac;
static PyObject *__pyx_kp_u_Run_Migrad_first;
static PyObject *__pyx_kp_u_Run_migrad_first;
static PyObject *__pyx_kp_u_Run_migrad_hesse_first;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_RuntimeWarning;
static PyObject *__pyx_kp_u_Specified_parameters_r_cannot_be;
static PyObject *__pyx_kp_u_Specified_variable_name_for_mino;
static PyObject *__pyx_kp_u_Specify_nsigma_bound_but_error_b;
static PyObject *__pyx_n_s_Struct;
static PyObject *__pyx_kp_u_Unknown_parameter_s;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s__19;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_at_lower_limit;
static PyObject *__pyx_n_s_at_lower_max_fcn;
static PyObject *__pyx_n_s_at_upper_limit;
static PyObject *__pyx_n_s_at_upper_max_fcn;
static PyObject *__pyx_n_s_auto_frontend;
static PyObject *__pyx_n_s_band;
static PyObject *__pyx_n_s_bins;
static PyObject *__pyx_n_s_bound;
static PyObject *__pyx_n_s_build_matrix;
static PyObject *__pyx_n_s_build_param_table;
static PyObject *__pyx_n_s_check_extra_args;
static PyObject *__pyx_n_s_check_extra_args_locals_genexpr;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_contour_locals_genexpr;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_correlation;
static PyObject *__pyx_n_u_default_errordef;
static PyObject *__pyx_n_s_describe;
static PyObject *__pyx_n_s_draw_contour;
static PyObject *__pyx_n_s_draw_mncontour;
static PyObject *__pyx_n_s_draw_profile;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_edges;
static PyObject *__pyx_n_s_edm;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_u_error_2;
static PyObject *__pyx_n_s_errordef;
static PyObject *__pyx_kp_u_errordef_is_not_given_Default_to;
static PyObject *__pyx_n_s_extract_error;
static PyObject *__pyx_n_s_extract_fix;
static PyObject *__pyx_n_s_extract_limit;
static PyObject *__pyx_n_s_fcn;
static PyObject *__pyx_n_u_fix;
static PyObject *__pyx_kp_u_fix__s;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_s_forced_parameters;
static PyObject *__pyx_n_s_frontend;
static PyObject *__pyx_n_s_frontends_console;
static PyObject *__pyx_n_s_frontends_html;
static PyObject *__pyx_n_s_fval;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get_fmin;
static PyObject *__pyx_n_s_get_initial_param_state;
static PyObject *__pyx_n_s_get_param_states;
static PyObject *__pyx_n_s_has_accurate_covar;
static PyObject *__pyx_n_s_has_covariance;
static PyObject *__pyx_n_s_has_limits;
static PyObject *__pyx_n_s_has_lower_limit;
static PyObject *__pyx_n_s_has_made_posdef_covar;
static PyObject *__pyx_n_s_has_posdef_covar;
static PyObject *__pyx_n_s_has_reached_call_limit;
static PyObject *__pyx_n_s_has_upper_limit;
static PyObject *__pyx_n_s_has_valid_parameters;
static PyObject *__pyx_n_s_hesse_failed;
static PyObject *__pyx_n_s_iminuit;
static PyObject *__pyx_n_s_iminuit_iminuit_warnings;
static PyObject *__pyx_n_s_iminuit_latex;
static PyObject *__pyx_n_s_iminuit_py23_compat;
static PyObject *__pyx_n_s_iminuit_util;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_init___locals_genexpr;
static PyObject *__pyx_n_s_is_above_max_edm;
static PyObject *__pyx_n_s_is_clean_state;
static PyObject *__pyx_n_s_is_const;
static PyObject *__pyx_n_s_is_fixed;
static PyObject *__pyx_n_s_is_valid;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kwd;
static PyObject *__pyx_n_u_limit;
static PyObject *__pyx_kp_u_limit_for_parameter_s_is_invalid;
static PyObject *__pyx_n_s_list_of_fixed_param;
static PyObject *__pyx_n_s_list_of_vary_param;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_lower_limit;
static PyObject *__pyx_n_s_lower_new_min;
static PyObject *__pyx_n_s_lower_valid;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_matrix;
static PyObject *__pyx_n_s_matrix_accurate;
static PyObject *__pyx_n_s_matrix_locals_genexpr;
static PyObject *__pyx_n_s_matrix_locals_genexpr_locals_gen;
static PyObject *__pyx_n_s_maxcall;
static PyObject *__pyx_n_s_migrad;
static PyObject *__pyx_n_s_migrad_ok;
static PyObject *__pyx_n_s_min;
static PyObject *__pyx_n_s_mncontour_grid;
static PyObject *__pyx_kp_u_mncontour_has_to_be_run_on_vary;
static PyObject *__pyx_n_s_mnprofile;
static PyObject *__pyx_n_s_mnprofile_locals_genexpr;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_ncall;
static PyObject *__pyx_n_s_nfcn;
static PyObject *__pyx_n_s_nsigma;
static PyObject *__pyx_n_s_nsplit;
static PyObject *__pyx_n_s_number;
static PyObject *__pyx_n_s_numpoints;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_param_name;
static PyObject *__pyx_n_s_parameters;
static PyObject *__pyx_n_s_pedantic;
static PyObject *__pyx_n_s_plotting;
static PyObject *__pyx_n_s_precision;
static PyObject *__pyx_n_s_prepare_initial_param;
static PyObject *__pyx_n_s_prepare_param;
static PyObject *__pyx_n_s_print_banner;
static PyObject *__pyx_n_s_print_fmin;
static PyObject *__pyx_n_s_print_hline;
static PyObject *__pyx_n_s_print_initial_param;
static PyObject *__pyx_n_s_print_level;
static PyObject *__pyx_n_s_print_matrix;
static PyObject *__pyx_n_s_print_merror;
static PyObject *__pyx_n_s_print_param;
static PyObject *__pyx_n_s_profile;
static PyObject *__pyx_n_s_profile_locals_genexpr;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_resume;
static PyObject *__pyx_n_s_round;
static PyObject *__pyx_kp_u_s_float_But_there_is_no_paramet;
static PyObject *__pyx_kp_u_s_is_given_But_there_is_no_para;
static PyObject *__pyx_kp_u_s_is_given_But_there_is_no_para_2;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_set_errordef;
static PyObject *__pyx_n_s_show_sigma;
static PyObject *__pyx_n_s_sigma;
static PyObject *__pyx_n_s_sigma_res;
static PyObject *__pyx_n_s_skip_fixed;
static PyObject *__pyx_kp_u_skip_fixed_False_is_not_supporte;
static PyObject *__pyx_n_s_subtract_min;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_text;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_throw_nan;
static PyObject *__pyx_n_s_up;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_upper_limit;
static PyObject *__pyx_n_s_upper_new_min;
static PyObject *__pyx_n_s_upper_valid;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_var;
static PyObject *__pyx_n_s_vname;
static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8__init___genexpr(PyObject *__pyx_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit___init__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_fcn, PyObject *__pyx_v_throw_nan, PyObject *__pyx_v_pedantic, PyObject *__pyx_v_frontend, PyObject *__pyx_v_forced_parameters, PyObject *__pyx_v_print_level, PyObject *__pyx_v_errordef, PyObject *__pyx_v_kwds); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_2migrad(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, int __pyx_v_ncall, PyObject *__pyx_v_resume, int __pyx_v_nsplit, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4hesse(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6minos(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_var, PyObject *__pyx_v_sigma, unsigned int __pyx_v_maxcall); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_correlation, PyObject *__pyx_v_skip_fixed); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_10print_matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_kwds); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_12latex_matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_14np_matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_correlation, PyObject *__pyx_v_skip_fixed); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_16is_fixed(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_18_prepare_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_20print_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_kwds); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_22latex_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_24_prepare_initial_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_26print_initial_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_kwds); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_28latex_initial_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_30print_fmin(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_32print_all_minos(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_34set_up(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, double __pyx_v_errordef); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_36set_errordef(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, double __pyx_v_errordef); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_38set_strategy(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_40set_print_level(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_lvl); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_42get_fmin(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_44get_param_states(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_46get_merrors(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_48get_initial_param_state(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_50get_num_call_fcn(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_52migrad_ok(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_54matrix_accurate(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_56list_of_fixed_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_58list_of_vary_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_60is_clean_state(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static void __pyx_pf_7iminuit_11_libiminuit_6Minuit_62__dealloc__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_64pedantic(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_kwds); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_9mnprofile_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_9mnprofile_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_66mnprofile(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_subtract_min); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_68draw_mnprofile(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_subtract_min, PyObject *__pyx_v_band, PyObject *__pyx_v_text); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7profile_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_70profile(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_subtract_min); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_72draw_profile(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_subtract_min, PyObject *__pyx_v_band, PyObject *__pyx_v_text); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_74contour(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_subtract_min); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_76mncontour(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_numpoints, PyObject *__pyx_v_sigma); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_78mncontour_grid(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_bins, PyObject *__pyx_v_nsigma, PyObject *__pyx_v_numpoints, int __pyx_v_sigma_res, PyObject *__pyx_v_edges); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_80draw_mncontour(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_bins, PyObject *__pyx_v_nsigma, PyObject *__pyx_v_numpoints, PyObject *__pyx_v_sigma_res); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_82draw_contour(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_show_sigma); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_84_auto_frontend(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_6genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_86_check_extra_args(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_parameters, PyObject *__pyx_v_kwd); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3fcn___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7pos2var___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7var2pos___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8errordef___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8errordef_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_9throw_nan___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_10parameters___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4args___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6values___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6errors___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_10covariance___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4fval___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6ncalls___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3edm___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7merrors___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3gcc___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4narg___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit_Minuit(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct____init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_10_profile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_12_contour(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_float_0_;
static PyObject *__pyx_float_1_;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_float_neg_1_0;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_30;
static PyObject *__pyx_int_100;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;

/* "iminuit/Minuit2Struct.pxi":4
 * """
 * 
 * cdef cfmin2struct(FunctionMinimum*cfmin):             # <<<<<<<<<<<<<<
 *     cfmin_struct = Struct(
 *         fval=cfmin.Fval(),
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_cfmin2struct(FunctionMinimum *__pyx_v_cfmin) {
  PyObject *__pyx_v_cfmin_struct = 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("cfmin2struct", 0);

  /* "iminuit/Minuit2Struct.pxi":5
 * 
 * cdef cfmin2struct(FunctionMinimum*cfmin):
 *     cfmin_struct = Struct(             # <<<<<<<<<<<<<<
 *         fval=cfmin.Fval(),
 *         edm=cfmin.Edm(),
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "iminuit/Minuit2Struct.pxi":6
 * cdef cfmin2struct(FunctionMinimum*cfmin):
 *     cfmin_struct = Struct(
 *         fval=cfmin.Fval(),             # <<<<<<<<<<<<<<
 *         edm=cfmin.Edm(),
 *         nfcn=cfmin.NFcn(),
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cfmin->Fval()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fval, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":7
 *     cfmin_struct = Struct(
 *         fval=cfmin.Fval(),
 *         edm=cfmin.Edm(),             # <<<<<<<<<<<<<<
 *         nfcn=cfmin.NFcn(),
 *         up=cfmin.Up(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cfmin->Edm()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_edm, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":8
 *         fval=cfmin.Fval(),
 *         edm=cfmin.Edm(),
 *         nfcn=cfmin.NFcn(),             # <<<<<<<<<<<<<<
 *         up=cfmin.Up(),
 *         is_valid=cfmin.IsValid(),
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cfmin->NFcn()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nfcn, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":9
 *         edm=cfmin.Edm(),
 *         nfcn=cfmin.NFcn(),
 *         up=cfmin.Up(),             # <<<<<<<<<<<<<<
 *         is_valid=cfmin.IsValid(),
 *         has_valid_parameters=cfmin.HasValidParameters(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cfmin->Up()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_up, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":10
 *         nfcn=cfmin.NFcn(),
 *         up=cfmin.Up(),
 *         is_valid=cfmin.IsValid(),             # <<<<<<<<<<<<<<
 *         has_valid_parameters=cfmin.HasValidParameters(),
 *         has_accurate_covar=cfmin.HasAccurateCovar(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->IsValid()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_valid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":11
 *         up=cfmin.Up(),
 *         is_valid=cfmin.IsValid(),
 *         has_valid_parameters=cfmin.HasValidParameters(),             # <<<<<<<<<<<<<<
 *         has_accurate_covar=cfmin.HasAccurateCovar(),
 *         has_posdef_covar=cfmin.HasPosDefCovar(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->HasValidParameters()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_has_valid_parameters, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":12
 *         is_valid=cfmin.IsValid(),
 *         has_valid_parameters=cfmin.HasValidParameters(),
 *         has_accurate_covar=cfmin.HasAccurateCovar(),             # <<<<<<<<<<<<<<
 *         has_posdef_covar=cfmin.HasPosDefCovar(),
 *         #forced to be posdef
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->HasAccurateCovar()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_has_accurate_covar, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":13
 *         has_valid_parameters=cfmin.HasValidParameters(),
 *         has_accurate_covar=cfmin.HasAccurateCovar(),
 *         has_posdef_covar=cfmin.HasPosDefCovar(),             # <<<<<<<<<<<<<<
 *         #forced to be posdef
 *         has_made_posdef_covar=cfmin.HasMadePosDefCovar(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->HasPosDefCovar()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_has_posdef_covar, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":15
 *         has_posdef_covar=cfmin.HasPosDefCovar(),
 *         #forced to be posdef
 *         has_made_posdef_covar=cfmin.HasMadePosDefCovar(),             # <<<<<<<<<<<<<<
 *         hesse_failed=cfmin.HesseFailed(),
 *         has_covariance=cfmin.HasCovariance(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->HasMadePosDefCovar()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_has_made_posdef_covar, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":16
 *         #forced to be posdef
 *         has_made_posdef_covar=cfmin.HasMadePosDefCovar(),
 *         hesse_failed=cfmin.HesseFailed(),             # <<<<<<<<<<<<<<
 *         has_covariance=cfmin.HasCovariance(),
 *         is_above_max_edm=cfmin.IsAboveMaxEdm(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->HesseFailed()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hesse_failed, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":17
 *         has_made_posdef_covar=cfmin.HasMadePosDefCovar(),
 *         hesse_failed=cfmin.HesseFailed(),
 *         has_covariance=cfmin.HasCovariance(),             # <<<<<<<<<<<<<<
 *         is_above_max_edm=cfmin.IsAboveMaxEdm(),
 *         has_reached_call_limit=cfmin.HasReachedCallLimit()
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->HasCovariance()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_has_covariance, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":18
 *         hesse_failed=cfmin.HesseFailed(),
 *         has_covariance=cfmin.HasCovariance(),
 *         is_above_max_edm=cfmin.IsAboveMaxEdm(),             # <<<<<<<<<<<<<<
 *         has_reached_call_limit=cfmin.HasReachedCallLimit()
 *     )
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->IsAboveMaxEdm()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_above_max_edm, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":19
 *         has_covariance=cfmin.HasCovariance(),
 *         is_above_max_edm=cfmin.IsAboveMaxEdm(),
 *         has_reached_call_limit=cfmin.HasReachedCallLimit()             # <<<<<<<<<<<<<<
 *     )
 *     return cfmin_struct
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_cfmin->HasReachedCallLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_has_reached_call_limit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":5
 * 
 * cdef cfmin2struct(FunctionMinimum*cfmin):
 *     cfmin_struct = Struct(             # <<<<<<<<<<<<<<
 *         fval=cfmin.Fval(),
 *         edm=cfmin.Edm(),
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cfmin_struct = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":21
 *         has_reached_call_limit=cfmin.HasReachedCallLimit()
 *     )
 *     return cfmin_struct             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cfmin_struct);
  __pyx_r = __pyx_v_cfmin_struct;
  goto __pyx_L0;

  /* "iminuit/Minuit2Struct.pxi":4
 * """
 * 
 * cdef cfmin2struct(FunctionMinimum*cfmin):             # <<<<<<<<<<<<<<
 *     cfmin_struct = Struct(
 *         fval=cfmin.Fval(),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("iminuit._libiminuit.cfmin2struct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cfmin_struct);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/Minuit2Struct.pxi":24
 * 
 * 
 * cdef minuitparam2struct(MinuitParameter mp):             # <<<<<<<<<<<<<<
 *     ret = Struct(
 *         number=mp.Number(),
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_minuitparam2struct(MinuitParameter __pyx_v_mp) {
  PyObject *__pyx_v_ret = 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("minuitparam2struct", 0);

  /* "iminuit/Minuit2Struct.pxi":25
 * 
 * cdef minuitparam2struct(MinuitParameter mp):
 *     ret = Struct(             # <<<<<<<<<<<<<<
 *         number=mp.Number(),
 *         name=mp.Name(),
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "iminuit/Minuit2Struct.pxi":26
 * cdef minuitparam2struct(MinuitParameter mp):
 *     ret = Struct(
 *         number=mp.Number(),             # <<<<<<<<<<<<<<
 *         name=mp.Name(),
 *         value=mp.Value(),
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_mp.Number()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":27
 *     ret = Struct(
 *         number=mp.Number(),
 *         name=mp.Name(),             # <<<<<<<<<<<<<<
 *         value=mp.Value(),
 *         error=mp.Error(),
 */
  __pyx_t_3 = __Pyx_PyStr_FromString(__pyx_v_mp.Name()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":28
 *         number=mp.Number(),
 *         name=mp.Name(),
 *         value=mp.Value(),             # <<<<<<<<<<<<<<
 *         error=mp.Error(),
 *         is_const=mp.IsConst(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mp.Value()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_value, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":29
 *         name=mp.Name(),
 *         value=mp.Value(),
 *         error=mp.Error(),             # <<<<<<<<<<<<<<
 *         is_const=mp.IsConst(),
 *         is_fixed=mp.IsFixed(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mp.Error()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_error, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":30
 *         value=mp.Value(),
 *         error=mp.Error(),
 *         is_const=mp.IsConst(),             # <<<<<<<<<<<<<<
 *         is_fixed=mp.IsFixed(),
 *         has_limits=mp.HasLimits(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_mp.IsConst()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_const, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":31
 *         error=mp.Error(),
 *         is_const=mp.IsConst(),
 *         is_fixed=mp.IsFixed(),             # <<<<<<<<<<<<<<
 *         has_limits=mp.HasLimits(),
 *         has_lower_limit=mp.HasLowerLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_mp.IsFixed()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_fixed, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":32
 *         is_const=mp.IsConst(),
 *         is_fixed=mp.IsFixed(),
 *         has_limits=mp.HasLimits(),             # <<<<<<<<<<<<<<
 *         has_lower_limit=mp.HasLowerLimit(),
 *         has_upper_limit=mp.HasUpperLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_mp.HasLimits()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_has_limits, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":33
 *         is_fixed=mp.IsFixed(),
 *         has_limits=mp.HasLimits(),
 *         has_lower_limit=mp.HasLowerLimit(),             # <<<<<<<<<<<<<<
 *         has_upper_limit=mp.HasUpperLimit(),
 *         lower_limit=mp.LowerLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_mp.HasLowerLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_has_lower_limit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":34
 *         has_limits=mp.HasLimits(),
 *         has_lower_limit=mp.HasLowerLimit(),
 *         has_upper_limit=mp.HasUpperLimit(),             # <<<<<<<<<<<<<<
 *         lower_limit=mp.LowerLimit(),
 *         upper_limit=mp.UpperLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_mp.HasUpperLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_has_upper_limit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":35
 *         has_lower_limit=mp.HasLowerLimit(),
 *         has_upper_limit=mp.HasUpperLimit(),
 *         lower_limit=mp.LowerLimit(),             # <<<<<<<<<<<<<<
 *         upper_limit=mp.UpperLimit(),
 *     )
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mp.LowerLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lower_limit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":36
 *         has_upper_limit=mp.HasUpperLimit(),
 *         lower_limit=mp.LowerLimit(),
 *         upper_limit=mp.UpperLimit(),             # <<<<<<<<<<<<<<
 *     )
 *     return ret
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mp.UpperLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_upper_limit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":25
 * 
 * cdef minuitparam2struct(MinuitParameter mp):
 *     ret = Struct(             # <<<<<<<<<<<<<<
 *         number=mp.Number(),
 *         name=mp.Name(),
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":38
 *         upper_limit=mp.UpperLimit(),
 *     )
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "iminuit/Minuit2Struct.pxi":24
 * 
 * 
 * cdef minuitparam2struct(MinuitParameter mp):             # <<<<<<<<<<<<<<
 *     ret = Struct(
 *         number=mp.Number(),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("iminuit._libiminuit.minuitparam2struct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/Minuit2Struct.pxi":41
 * 
 * 
 * cdef minoserror2struct(MinosError m):             # <<<<<<<<<<<<<<
 *     ret = Struct(
 *         lower=m.Lower(),
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_minoserror2struct(MinosError __pyx_v_m) {
  PyObject *__pyx_v_ret = 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("minoserror2struct", 0);

  /* "iminuit/Minuit2Struct.pxi":42
 * 
 * cdef minoserror2struct(MinosError m):
 *     ret = Struct(             # <<<<<<<<<<<<<<
 *         lower=m.Lower(),
 *         upper=m.Upper(),
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "iminuit/Minuit2Struct.pxi":43
 * cdef minoserror2struct(MinosError m):
 *     ret = Struct(
 *         lower=m.Lower(),             # <<<<<<<<<<<<<<
 *         upper=m.Upper(),
 *         is_valid=m.IsValid(),
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_m.Lower()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lower, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":44
 *     ret = Struct(
 *         lower=m.Lower(),
 *         upper=m.Upper(),             # <<<<<<<<<<<<<<
 *         is_valid=m.IsValid(),
 *         lower_valid=m.LowerValid(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_m.Upper()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_upper, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":45
 *         lower=m.Lower(),
 *         upper=m.Upper(),
 *         is_valid=m.IsValid(),             # <<<<<<<<<<<<<<
 *         lower_valid=m.LowerValid(),
 *         upper_valid=m.UpperValid(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.IsValid()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_valid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":46
 *         upper=m.Upper(),
 *         is_valid=m.IsValid(),
 *         lower_valid=m.LowerValid(),             # <<<<<<<<<<<<<<
 *         upper_valid=m.UpperValid(),
 *         at_lower_limit=m.AtLowerLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.LowerValid()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lower_valid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":47
 *         is_valid=m.IsValid(),
 *         lower_valid=m.LowerValid(),
 *         upper_valid=m.UpperValid(),             # <<<<<<<<<<<<<<
 *         at_lower_limit=m.AtLowerLimit(),
 *         at_upper_limit=m.AtUpperLimit(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.UpperValid()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_upper_valid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":48
 *         lower_valid=m.LowerValid(),
 *         upper_valid=m.UpperValid(),
 *         at_lower_limit=m.AtLowerLimit(),             # <<<<<<<<<<<<<<
 *         at_upper_limit=m.AtUpperLimit(),
 *         at_lower_max_fcn=m.AtLowerMaxFcn(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.AtLowerLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_at_lower_limit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":49
 *         upper_valid=m.UpperValid(),
 *         at_lower_limit=m.AtLowerLimit(),
 *         at_upper_limit=m.AtUpperLimit(),             # <<<<<<<<<<<<<<
 *         at_lower_max_fcn=m.AtLowerMaxFcn(),
 *         at_upper_max_fcn=m.AtUpperMaxFcn(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.AtUpperLimit()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_at_upper_limit, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":50
 *         at_lower_limit=m.AtLowerLimit(),
 *         at_upper_limit=m.AtUpperLimit(),
 *         at_lower_max_fcn=m.AtLowerMaxFcn(),             # <<<<<<<<<<<<<<
 *         at_upper_max_fcn=m.AtUpperMaxFcn(),
 *         lower_new_min=m.LowerNewMin(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.AtLowerMaxFcn()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_at_lower_max_fcn, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":51
 *         at_upper_limit=m.AtUpperLimit(),
 *         at_lower_max_fcn=m.AtLowerMaxFcn(),
 *         at_upper_max_fcn=m.AtUpperMaxFcn(),             # <<<<<<<<<<<<<<
 *         lower_new_min=m.LowerNewMin(),
 *         upper_new_min=m.UpperNewMin(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.AtUpperMaxFcn()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_at_upper_max_fcn, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":52
 *         at_lower_max_fcn=m.AtLowerMaxFcn(),
 *         at_upper_max_fcn=m.AtUpperMaxFcn(),
 *         lower_new_min=m.LowerNewMin(),             # <<<<<<<<<<<<<<
 *         upper_new_min=m.UpperNewMin(),
 *         nfcn=m.NFcn(),
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.LowerNewMin()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lower_new_min, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":53
 *         at_upper_max_fcn=m.AtUpperMaxFcn(),
 *         lower_new_min=m.LowerNewMin(),
 *         upper_new_min=m.UpperNewMin(),             # <<<<<<<<<<<<<<
 *         nfcn=m.NFcn(),
 *         min=m.Min()
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_m.UpperNewMin()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_upper_new_min, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":54
 *         lower_new_min=m.LowerNewMin(),
 *         upper_new_min=m.UpperNewMin(),
 *         nfcn=m.NFcn(),             # <<<<<<<<<<<<<<
 *         min=m.Min()
 *     )
 */
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_m.NFcn()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nfcn, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":55
 *         upper_new_min=m.UpperNewMin(),
 *         nfcn=m.NFcn(),
 *         min=m.Min()             # <<<<<<<<<<<<<<
 *     )
 *     return ret
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_m.Min()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":42
 * 
 * cdef minoserror2struct(MinosError m):
 *     ret = Struct(             # <<<<<<<<<<<<<<
 *         lower=m.Lower(),
 *         upper=m.Upper(),
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/Minuit2Struct.pxi":57
 *         min=m.Min()
 *     )
 *     return ret             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "iminuit/Minuit2Struct.pxi":41
 * 
 * 
 * cdef minoserror2struct(MinosError m):             # <<<<<<<<<<<<<<
 *     ret = Struct(
 *         lower=m.Lower(),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("iminuit._libiminuit.minoserror2struct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":41
 * 
 * #look up map with default
 * cdef maplookup(m, k, d):             # <<<<<<<<<<<<<<
 *     return m[k] if k in m else d
 * 
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_maplookup(PyObject *__pyx_v_m, PyObject *__pyx_v_k, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("maplookup", 0);

  /* "iminuit/_libiminuit.pyx":42
 * #look up map with default
 * cdef maplookup(m, k, d):
 *     return m[k] if k in m else d             # <<<<<<<<<<<<<<
 * 
 * cdef class Minuit:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_v_m, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if ((__pyx_t_2 != 0)) {
    __pyx_t_3 = PyObject_GetItem(__pyx_v_m, __pyx_v_k); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_d);
    __pyx_t_1 = __pyx_v_d;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":41
 * 
 * #look up map with default
 * cdef maplookup(m, k, d):             # <<<<<<<<<<<<<<
 *     return m[k] if k in m else d
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("iminuit._libiminuit.maplookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":193
 *     """
 * 
 *     def __init__(self, fcn,             # <<<<<<<<<<<<<<
 *                  throw_nan=False, pedantic=True,
 *                  frontend=None, forced_parameters=None, print_level=1,
 */

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit___init__[] = "\n        Construct minuit object from given *fcn*\n\n        **Arguments:**\n\n            - **fcn**: the function to be optimized. Minuit automagically finds\n              parameters names. More information about how\n              Minuit detects function signature can be found in\n              :ref:`function-sig-label`\n\n        **Builtin Keyword Arguments:**\n\n            - **throw_nan**: set fcn to raise RuntimeError when it\n              encounters *nan*. (Default False)\n\n            - **pedantic**: warns about parameters that do not have initial\n              value or initial error/stepsize set.\n\n            - **frontend**: Minuit frontend. There are two builtin frontends.\n\n                1. ConsoleFrontend which is design to print out to terminal.\n\n                2. HtmlFrontend which is designed to give a nice output in\n                   IPython notebook session.\n\n              By Default, Minuit switch to HtmlFrontend automatically if it\n              is called in IPython session. It uses ConsoleFrontend otherwise.\n\n            - **forced_parameters**: tell Minuit not to do function signature\n              detection and use this argument instead. (Default None\n              (automagically detect signature))\n\n            - **print_level**: set the print_level for this Minuit. 0 is quiet.\n              1 print out at the end of migrad/hesse/minos.\n\n            - **errordef**: Optional. Amount of increase in fcn to be defined\n              as 1 :math:`\\sigma`. If None is given, it will look at\n              `fcn.default_errordef()`. If `fcn.default_errordef()` is not\n              defined or\n              not callable iminuit will give a warning and set errordef to 1.\n              Default None(which means errordef=1 with a warning).\n\n        **Parameter Keyword Arguments:**\n\n            Similar to PyMinuit. iminuit allows user to set initial value,\n            initial stepsize/error, limits of parameters and whether""\n            parameter should be fixed or not by passing keyword arguments to\n            Minuit. This is best explained through an example::\n\n                def f(x,y):\n                    return (x-2)**2 + (y-3)**2\n\n            * Initial value(varname)::\n\n                #initial value for x and y\n                m = Minuit(f, x=1, y=2)\n\n            * Initial step size/error(fix_varname)::\n\n                #initial step size for x and y\n                m = Minuit(f, error_x=0.5, error_y=0.5)\n\n            * Limits (limit_varname=tuple)::\n\n                #limits x and y\n                m = Minuit(f, limit_x=(-10,10), limit_y=(-20,20))\n\n            * Fixing parameters::\n\n                #fix x but vary y\n                m = Minuit(f, fix_x=True)\n\n            .. note::\n\n                Tips: You can use python dictionary expansion to\n                programatically change the fitting arguments.\n\n                ::\n\n                    kwdarg = dict(x=1., error_x=0.5)\n                    m = Minuit(f, **kwdarg)\n\n                You can also obtain fit arguments from Minuit object\n                to reuse it later too. *fitarg* will be automatically\n                updated to the minimum value and the corresponding error when\n                you ran migrad/hesse::\n\n                    m = Minuit(f, x=1, error_x=0.5)\n                    my_fitarg = m.fitarg\n                    another_fit = Minuit(f, **my_fitarg)\n\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7iminuit_11_libiminuit_6Minuit___init__;
#endif
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fcn = 0;
  PyObject *__pyx_v_throw_nan = 0;
  PyObject *__pyx_v_pedantic = 0;
  PyObject *__pyx_v_frontend = 0;
  PyObject *__pyx_v_forced_parameters = 0;
  PyObject *__pyx_v_print_level = 0;
  PyObject *__pyx_v_errordef = 0;
  PyObject *__pyx_v_kwds = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwds = PyDict_New(); if (unlikely(!__pyx_v_kwds)) return -1;
  __Pyx_GOTREF(__pyx_v_kwds);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fcn,&__pyx_n_s_throw_nan,&__pyx_n_s_pedantic,&__pyx_n_s_frontend,&__pyx_n_s_forced_parameters,&__pyx_n_s_print_level,&__pyx_n_s_errordef,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};

    /* "iminuit/_libiminuit.pyx":194
 * 
 *     def __init__(self, fcn,
 *                  throw_nan=False, pedantic=True,             # <<<<<<<<<<<<<<
 *                  frontend=None, forced_parameters=None, print_level=1,
 *                  errordef=None, **kwds):
 */
    values[1] = ((PyObject *)Py_False);
    values[2] = ((PyObject *)Py_True);

    /* "iminuit/_libiminuit.pyx":195
 *     def __init__(self, fcn,
 *                  throw_nan=False, pedantic=True,
 *                  frontend=None, forced_parameters=None, print_level=1,             # <<<<<<<<<<<<<<
 *                  errordef=None, **kwds):
 *         """
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    values[5] = ((PyObject *)__pyx_int_1);

    /* "iminuit/_libiminuit.pyx":196
 *                  throw_nan=False, pedantic=True,
 *                  frontend=None, forced_parameters=None, print_level=1,
 *                  errordef=None, **kwds):             # <<<<<<<<<<<<<<
 *         """
 *         Construct minuit object from given *fcn*
 */
    values[6] = ((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  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fcn)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_throw_nan);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pedantic);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frontend);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_forced_parameters);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_print_level);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_errordef);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwds, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fcn = values[0];
    __pyx_v_throw_nan = values[1];
    __pyx_v_pedantic = values[2];
    __pyx_v_frontend = values[3];
    __pyx_v_forced_parameters = values[4];
    __pyx_v_print_level = values[5];
    __pyx_v_errordef = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwds); __pyx_v_kwds = 0;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit___init__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_fcn, __pyx_v_throw_nan, __pyx_v_pedantic, __pyx_v_frontend, __pyx_v_forced_parameters, __pyx_v_print_level, __pyx_v_errordef, __pyx_v_kwds);

  /* "iminuit/_libiminuit.pyx":193
 *     """
 * 
 *     def __init__(self, fcn,             # <<<<<<<<<<<<<<
 *                  throw_nan=False, pedantic=True,
 *                  frontend=None, forced_parameters=None, print_level=1,
 */

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwds);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":333
 * 
 *         self.parameters = args
 *         self.args = tuple(self.initialvalue[k] for k in args)             # <<<<<<<<<<<<<<
 *         self.values = {k: self.initialvalue[k] for k in args}
 *         self.errors = {k: self.initialerror[k] for k in args}
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8__init___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_8__init___2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.__init__.genexpr", __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_7iminuit_11_libiminuit_6Minuit_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->initialvalue, __pyx_cur_scope->__pyx_v_k); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __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();
    /* 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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":193
 *     """
 * 
 *     def __init__(self, fcn,             # <<<<<<<<<<<<<<
 *                  throw_nan=False, pedantic=True,
 *                  frontend=None, forced_parameters=None, print_level=1,
 */

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit___init__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_fcn, PyObject *__pyx_v_throw_nan, PyObject *__pyx_v_pedantic, PyObject *__pyx_v_frontend, PyObject *__pyx_v_forced_parameters, PyObject *__pyx_v_print_level, PyObject *__pyx_v_errordef, PyObject *__pyx_v_kwds) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *__pyx_cur_scope;
  CYTHON_UNUSED Py_ssize_t __pyx_v_narg;
  PyObject *__pyx_v_default_errordef = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  double __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct____init__(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct____init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return -1;
  }
  __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);

  /* "iminuit/_libiminuit.pyx":290
 *         """
 * 
 *         args = describe(fcn) if forced_parameters is None \             # <<<<<<<<<<<<<<
 *             else forced_parameters
 *         self._check_extra_args(args, kwds)
 */
  __pyx_t_2 = (__pyx_v_forced_parameters == Py_None);
  if ((__pyx_t_2 != 0)) {
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_describe); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_fcn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_fcn);
      __Pyx_GIVEREF(__pyx_v_fcn);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_fcn);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {

    /* "iminuit/_libiminuit.pyx":291
 * 
 *         args = describe(fcn) if forced_parameters is None \
 *             else forced_parameters             # <<<<<<<<<<<<<<
 *         self._check_extra_args(args, kwds)
 *         narg = len(args)
 */
    __Pyx_INCREF(__pyx_v_forced_parameters);
    __pyx_t_1 = __pyx_v_forced_parameters;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_args = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":292
 *         args = describe(fcn) if forced_parameters is None \
 *             else forced_parameters
 *         self._check_extra_args(args, kwds)             # <<<<<<<<<<<<<<
 *         narg = len(args)
 *         self.fcn = fcn
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_check_extra_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __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_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_cur_scope->__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kwds);
  __Pyx_GIVEREF(__pyx_v_kwds);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_kwds);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":293
 *             else forced_parameters
 *         self._check_extra_args(args, kwds)
 *         narg = len(args)             # <<<<<<<<<<<<<<
 *         self.fcn = fcn
 * 
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_args;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_narg = __pyx_t_7;

  /* "iminuit/_libiminuit.pyx":294
 *         self._check_extra_args(args, kwds)
 *         narg = len(args)
 *         self.fcn = fcn             # <<<<<<<<<<<<<<
 * 
 *         self.frontend = self._auto_frontend() if frontend is None else frontend
 */
  __Pyx_INCREF(__pyx_v_fcn);
  __Pyx_GIVEREF(__pyx_v_fcn);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->fcn);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->fcn);
  __pyx_cur_scope->__pyx_v_self->fcn = __pyx_v_fcn;

  /* "iminuit/_libiminuit.pyx":296
 *         self.fcn = fcn
 * 
 *         self.frontend = self._auto_frontend() if frontend is None else frontend             # <<<<<<<<<<<<<<
 * 
 *         # Maintain 2 dictionaries to easily convert between
 */
  __pyx_t_2 = (__pyx_v_frontend == Py_None);
  if ((__pyx_t_2 != 0)) {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_auto_frontend); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_frontend);
    __pyx_t_1 = __pyx_v_frontend;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->frontend);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->frontend);
  __pyx_cur_scope->__pyx_v_self->frontend = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":300
 *         # Maintain 2 dictionaries to easily convert between
 *         # parameter names and position
 *         self.pos2var = {i: k for i, k in enumerate(args)}             # <<<<<<<<<<<<<<
 *         self.var2pos = {k: i for i, k in enumerate(args)}
 * 
 */
  { /* enter inner scope */
    PyObject *__pyx_7genexpr__pyx_v_i = NULL;
    PyObject *__pyx_7genexpr__pyx_v_k = NULL;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_6 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_i, __pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_i, (PyObject*)__pyx_7genexpr__pyx_v_k))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k);
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k);
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->pos2var);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->pos2var);
  __pyx_cur_scope->__pyx_v_self->pos2var = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":301
 *         # parameter names and position
 *         self.pos2var = {i: k for i, k in enumerate(args)}
 *         self.var2pos = {k: i for i, k in enumerate(args)}             # <<<<<<<<<<<<<<
 * 
 *         self.args, self.values, self.errors = None, None, None
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr1__pyx_v_i = NULL;
    PyObject *__pyx_8genexpr1__pyx_v_k = NULL;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_6 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_k, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_i, __pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr1__pyx_v_k, (PyObject*)__pyx_8genexpr1__pyx_v_i))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_i);
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k);
    goto __pyx_L14_exit_scope;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_i);
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k);
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->var2pos);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->var2pos);
  __pyx_cur_scope->__pyx_v_self->var2pos = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":303
 *         self.var2pos = {k: i for i, k in enumerate(args)}
 * 
 *         self.args, self.values, self.errors = None, None, None             # <<<<<<<<<<<<<<
 * 
 *         self.initialvalue = {x: maplookup(kwds, x, 0.) for x in args}
 */
  __pyx_t_1 = Py_None;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = Py_None;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_6 = Py_None;
  __Pyx_INCREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->args);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->args);
  __pyx_cur_scope->__pyx_v_self->args = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->values);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->values);
  __pyx_cur_scope->__pyx_v_self->values = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->errors);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->errors);
  __pyx_cur_scope->__pyx_v_self->errors = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":305
 *         self.args, self.values, self.errors = None, None, None
 * 
 *         self.initialvalue = {x: maplookup(kwds, x, 0.) for x in args}             # <<<<<<<<<<<<<<
 *         self.initialerror = {x: maplookup(kwds, 'error_' + x, 1.) for x in args}
 *         self.initiallimit = {x: maplookup(kwds, 'limit_' + x, None) for x in args}
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr2__pyx_v_x = NULL;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_3 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L17_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_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_8(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_x, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_f_7iminuit_11_libiminuit_maplookup(__pyx_v_kwds, __pyx_8genexpr2__pyx_v_x, __pyx_float_0_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(PyDict_SetItem(__pyx_t_6, (PyObject*)__pyx_8genexpr2__pyx_v_x, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x);
    goto __pyx_L20_exit_scope;
    __pyx_L17_error:;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x);
    goto __pyx_L1_error;
    __pyx_L20_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->initialvalue);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->initialvalue);
  __pyx_cur_scope->__pyx_v_self->initialvalue = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":306
 * 
 *         self.initialvalue = {x: maplookup(kwds, x, 0.) for x in args}
 *         self.initialerror = {x: maplookup(kwds, 'error_' + x, 1.) for x in args}             # <<<<<<<<<<<<<<
 *         self.initiallimit = {x: maplookup(kwds, 'limit_' + x, None) for x in args}
 *         self.initialfix = {x: maplookup(kwds, 'fix_' + x, False) for x in args}
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr3__pyx_v_x = NULL;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_3 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_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_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_8(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_x, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_n_u_error_2, __pyx_8genexpr3__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __pyx_f_7iminuit_11_libiminuit_maplookup(__pyx_v_kwds, __pyx_t_1, __pyx_float_1_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_6, (PyObject*)__pyx_8genexpr3__pyx_v_x, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_x);
    goto __pyx_L26_exit_scope;
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_x);
    goto __pyx_L1_error;
    __pyx_L26_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->initialerror);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->initialerror);
  __pyx_cur_scope->__pyx_v_self->initialerror = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":307
 *         self.initialvalue = {x: maplookup(kwds, x, 0.) for x in args}
 *         self.initialerror = {x: maplookup(kwds, 'error_' + x, 1.) for x in args}
 *         self.initiallimit = {x: maplookup(kwds, 'limit_' + x, None) for x in args}             # <<<<<<<<<<<<<<
 *         self.initialfix = {x: maplookup(kwds, 'fix_' + x, False) for x in args}
 * 
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr4__pyx_v_x = NULL;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_3 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_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_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_8(__pyx_t_3);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_n_u_limit, __pyx_8genexpr4__pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __pyx_f_7iminuit_11_libiminuit_maplookup(__pyx_v_kwds, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_6, (PyObject*)__pyx_8genexpr4__pyx_v_x, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_x);
    goto __pyx_L32_exit_scope;
    __pyx_L29_error:;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_x);
    goto __pyx_L1_error;
    __pyx_L32_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->initiallimit);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->initiallimit);
  __pyx_cur_scope->__pyx_v_self->initiallimit = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":308
 *         self.initialerror = {x: maplookup(kwds, 'error_' + x, 1.) for x in args}
 *         self.initiallimit = {x: maplookup(kwds, 'limit_' + x, None) for x in args}
 *         self.initialfix = {x: maplookup(kwds, 'fix_' + x, False) for x in args}             # <<<<<<<<<<<<<<
 * 
 *         self.pyfcn = NULL
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr5__pyx_v_x = NULL;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_3 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_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_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_8(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_x, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_n_u_fix, __pyx_8genexpr5__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __pyx_f_7iminuit_11_libiminuit_maplookup(__pyx_v_kwds, __pyx_t_1, Py_False); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_6, (PyObject*)__pyx_8genexpr5__pyx_v_x, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x);
    goto __pyx_L38_exit_scope;
    __pyx_L35_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x);
    goto __pyx_L1_error;
    __pyx_L38_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->initialfix);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->initialfix);
  __pyx_cur_scope->__pyx_v_self->initialfix = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":310
 *         self.initialfix = {x: maplookup(kwds, 'fix_' + x, False) for x in args}
 * 
 *         self.pyfcn = NULL             # <<<<<<<<<<<<<<
 *         self.minimizer = NULL
 *         self.cfmin = NULL
 */
  __pyx_cur_scope->__pyx_v_self->pyfcn = NULL;

  /* "iminuit/_libiminuit.pyx":311
 * 
 *         self.pyfcn = NULL
 *         self.minimizer = NULL             # <<<<<<<<<<<<<<
 *         self.cfmin = NULL
 *         self.last_upst = NULL
 */
  __pyx_cur_scope->__pyx_v_self->minimizer = NULL;

  /* "iminuit/_libiminuit.pyx":312
 *         self.pyfcn = NULL
 *         self.minimizer = NULL
 *         self.cfmin = NULL             # <<<<<<<<<<<<<<
 *         self.last_upst = NULL
 * 
 */
  __pyx_cur_scope->__pyx_v_self->cfmin = NULL;

  /* "iminuit/_libiminuit.pyx":313
 *         self.minimizer = NULL
 *         self.cfmin = NULL
 *         self.last_upst = NULL             # <<<<<<<<<<<<<<
 * 
 *         if errordef is None:
 */
  __pyx_cur_scope->__pyx_v_self->last_upst = NULL;

  /* "iminuit/_libiminuit.pyx":315
 *         self.last_upst = NULL
 * 
 *         if errordef is None:             # <<<<<<<<<<<<<<
 *             default_errordef = getattr(fcn, 'default_errordef', None)
 *             if not callable(default_errordef):
 */
  __pyx_t_2 = (__pyx_v_errordef == Py_None);
  __pyx_t_9 = (__pyx_t_2 != 0);
  if (__pyx_t_9) {

    /* "iminuit/_libiminuit.pyx":316
 * 
 *         if errordef is None:
 *             default_errordef = getattr(fcn, 'default_errordef', None)             # <<<<<<<<<<<<<<
 *             if not callable(default_errordef):
 *                 if pedantic:
 */
    __pyx_t_6 = __Pyx_GetAttr3(__pyx_v_fcn, __pyx_n_u_default_errordef, Py_None); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_default_errordef = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":317
 *         if errordef is None:
 *             default_errordef = getattr(fcn, 'default_errordef', None)
 *             if not callable(default_errordef):             # <<<<<<<<<<<<<<
 *                 if pedantic:
 *                     warn(InitialParamWarning(
 */
    __pyx_t_9 = __Pyx_PyCallable_Check(__pyx_v_default_errordef); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((!(__pyx_t_9 != 0)) != 0);
    if (__pyx_t_2) {

      /* "iminuit/_libiminuit.pyx":318
 *             default_errordef = getattr(fcn, 'default_errordef', None)
 *             if not callable(default_errordef):
 *                 if pedantic:             # <<<<<<<<<<<<<<
 *                     warn(InitialParamWarning(
 *                         'errordef is not given. Default to 1.'))
 */
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pedantic); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_2) {

        /* "iminuit/_libiminuit.pyx":319
 *             if not callable(default_errordef):
 *                 if pedantic:
 *                     warn(InitialParamWarning(             # <<<<<<<<<<<<<<
 *                         'errordef is not given. Default to 1.'))
 *                 self.errordef = 1.0
 */
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InitialParamWarning); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && 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);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __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 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "iminuit/_libiminuit.pyx":318
 *             default_errordef = getattr(fcn, 'default_errordef', None)
 *             if not callable(default_errordef):
 *                 if pedantic:             # <<<<<<<<<<<<<<
 *                     warn(InitialParamWarning(
 *                         'errordef is not given. Default to 1.'))
 */
      }

      /* "iminuit/_libiminuit.pyx":321
 *                     warn(InitialParamWarning(
 *                         'errordef is not given. Default to 1.'))
 *                 self.errordef = 1.0             # <<<<<<<<<<<<<<
 *             else:
 *                 self.errordef = default_errordef()
 */
      __pyx_cur_scope->__pyx_v_self->errordef = 1.0;

      /* "iminuit/_libiminuit.pyx":317
 *         if errordef is None:
 *             default_errordef = getattr(fcn, 'default_errordef', None)
 *             if not callable(default_errordef):             # <<<<<<<<<<<<<<
 *                 if pedantic:
 *                     warn(InitialParamWarning(
 */
      goto __pyx_L40;
    }

    /* "iminuit/_libiminuit.pyx":323
 *                 self.errordef = 1.0
 *             else:
 *                 self.errordef = default_errordef()             # <<<<<<<<<<<<<<
 *         else:
 *             self.errordef = errordef
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_v_default_errordef);
      __pyx_t_3 = __pyx_v_default_errordef; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && 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);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_cur_scope->__pyx_v_self->errordef = __pyx_t_10;
    }
    __pyx_L40:;

    /* "iminuit/_libiminuit.pyx":315
 *         self.last_upst = NULL
 * 
 *         if errordef is None:             # <<<<<<<<<<<<<<
 *             default_errordef = getattr(fcn, 'default_errordef', None)
 *             if not callable(default_errordef):
 */
    goto __pyx_L39;
  }

  /* "iminuit/_libiminuit.pyx":325
 *                 self.errordef = default_errordef()
 *         else:
 *             self.errordef = errordef             # <<<<<<<<<<<<<<
 *         self.tol = 0.1
 *         self.strategy = 1
 */
  /*else*/ {
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_errordef); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_cur_scope->__pyx_v_self->errordef = __pyx_t_10;
  }
  __pyx_L39:;

  /* "iminuit/_libiminuit.pyx":326
 *         else:
 *             self.errordef = errordef
 *         self.tol = 0.1             # <<<<<<<<<<<<<<
 *         self.strategy = 1
 *         self.print_level = print_level
 */
  __pyx_cur_scope->__pyx_v_self->tol = 0.1;

  /* "iminuit/_libiminuit.pyx":327
 *             self.errordef = errordef
 *         self.tol = 0.1
 *         self.strategy = 1             # <<<<<<<<<<<<<<
 *         self.print_level = print_level
 *         set_migrad_print_level(print_level)
 */
  __pyx_cur_scope->__pyx_v_self->strategy = 1;

  /* "iminuit/_libiminuit.pyx":328
 *         self.tol = 0.1
 *         self.strategy = 1
 *         self.print_level = print_level             # <<<<<<<<<<<<<<
 *         set_migrad_print_level(print_level)
 *         self.throw_nan = throw_nan
 */
  __Pyx_INCREF(__pyx_v_print_level);
  __Pyx_GIVEREF(__pyx_v_print_level);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->print_level);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->print_level);
  __pyx_cur_scope->__pyx_v_self->print_level = __pyx_v_print_level;

  /* "iminuit/_libiminuit.pyx":329
 *         self.strategy = 1
 *         self.print_level = print_level
 *         set_migrad_print_level(print_level)             # <<<<<<<<<<<<<<
 *         self.throw_nan = throw_nan
 * 
 */
  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_print_level); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  VariableMetricBuilder::setPrintLevel(__pyx_t_11);

  /* "iminuit/_libiminuit.pyx":330
 *         self.print_level = print_level
 *         set_migrad_print_level(print_level)
 *         self.throw_nan = throw_nan             # <<<<<<<<<<<<<<
 * 
 *         self.parameters = args
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_throw_nan); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_cur_scope->__pyx_v_self->throw_nan = __pyx_t_2;

  /* "iminuit/_libiminuit.pyx":332
 *         self.throw_nan = throw_nan
 * 
 *         self.parameters = args             # <<<<<<<<<<<<<<
 *         self.args = tuple(self.initialvalue[k] for k in args)
 *         self.values = {k: self.initialvalue[k] for k in args}
 */
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->parameters);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->parameters);
  __pyx_cur_scope->__pyx_v_self->parameters = __pyx_cur_scope->__pyx_v_args;

  /* "iminuit/_libiminuit.pyx":333
 * 
 *         self.parameters = args
 *         self.args = tuple(self.initialvalue[k] for k in args)             # <<<<<<<<<<<<<<
 *         self.values = {k: self.initialvalue[k] for k in args}
 *         self.errors = {k: self.initialerror[k] for k in args}
 */
  __pyx_t_6 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->args);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->args);
  __pyx_cur_scope->__pyx_v_self->args = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":334
 *         self.parameters = args
 *         self.args = tuple(self.initialvalue[k] for k in args)
 *         self.values = {k: self.initialvalue[k] for k in args}             # <<<<<<<<<<<<<<
 *         self.errors = {k: self.initialerror[k] for k in args}
 *         self.covariance = None
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr7__pyx_v_k = NULL;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_6 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_k, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->initialvalue, __pyx_8genexpr7__pyx_v_k); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L44_error;};
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr7__pyx_v_k, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k);
    goto __pyx_L47_exit_scope;
    __pyx_L44_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k);
    goto __pyx_L1_error;
    __pyx_L47_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->values);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->values);
  __pyx_cur_scope->__pyx_v_self->values = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":335
 *         self.args = tuple(self.initialvalue[k] for k in args)
 *         self.values = {k: self.initialvalue[k] for k in args}
 *         self.errors = {k: self.initialerror[k] for k in args}             # <<<<<<<<<<<<<<
 *         self.covariance = None
 *         self.fval = 0.
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr8__pyx_v_k = NULL;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_6 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_k, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->initialerror, __pyx_8genexpr8__pyx_v_k); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L50_error;};
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr8__pyx_v_k, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k);
    goto __pyx_L53_exit_scope;
    __pyx_L50_error:;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k);
    goto __pyx_L1_error;
    __pyx_L53_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->errors);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->errors);
  __pyx_cur_scope->__pyx_v_self->errors = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":336
 *         self.values = {k: self.initialvalue[k] for k in args}
 *         self.errors = {k: self.initialerror[k] for k in args}
 *         self.covariance = None             # <<<<<<<<<<<<<<
 *         self.fval = 0.
 *         self.ncalls = 0
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->covariance);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->covariance);
  __pyx_cur_scope->__pyx_v_self->covariance = Py_None;

  /* "iminuit/_libiminuit.pyx":337
 *         self.errors = {k: self.initialerror[k] for k in args}
 *         self.covariance = None
 *         self.fval = 0.             # <<<<<<<<<<<<<<
 *         self.ncalls = 0
 *         self.edm = 1.
 */
  __pyx_cur_scope->__pyx_v_self->fval = 0.;

  /* "iminuit/_libiminuit.pyx":338
 *         self.covariance = None
 *         self.fval = 0.
 *         self.ncalls = 0             # <<<<<<<<<<<<<<
 *         self.edm = 1.
 *         self.merrors = {}
 */
  __pyx_cur_scope->__pyx_v_self->ncalls = 0;

  /* "iminuit/_libiminuit.pyx":339
 *         self.fval = 0.
 *         self.ncalls = 0
 *         self.edm = 1.             # <<<<<<<<<<<<<<
 *         self.merrors = {}
 *         self.gcc = None
 */
  __pyx_cur_scope->__pyx_v_self->edm = 1.;

  /* "iminuit/_libiminuit.pyx":340
 *         self.ncalls = 0
 *         self.edm = 1.
 *         self.merrors = {}             # <<<<<<<<<<<<<<
 *         self.gcc = None
 *         if pedantic: self.pedantic(kwds)
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->merrors);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->merrors);
  __pyx_cur_scope->__pyx_v_self->merrors = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":341
 *         self.edm = 1.
 *         self.merrors = {}
 *         self.gcc = None             # <<<<<<<<<<<<<<
 *         if pedantic: self.pedantic(kwds)
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->gcc);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->gcc);
  __pyx_cur_scope->__pyx_v_self->gcc = Py_None;

  /* "iminuit/_libiminuit.pyx":342
 *         self.merrors = {}
 *         self.gcc = None
 *         if pedantic: self.pedantic(kwds)             # <<<<<<<<<<<<<<
 * 
 *         self.fitarg = {}
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pedantic); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_pedantic); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_kwds); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_kwds);
      __Pyx_GIVEREF(__pyx_v_kwds);
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_kwds);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "iminuit/_libiminuit.pyx":344
 *         if pedantic: self.pedantic(kwds)
 * 
 *         self.fitarg = {}             # <<<<<<<<<<<<<<
 *         self.fitarg.update(self.initialvalue)
 *         self.fitarg.update({'error_' + k: v for k, v in self.initialerror.items()})
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->fitarg);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->fitarg);
  __pyx_cur_scope->__pyx_v_self->fitarg = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":345
 * 
 *         self.fitarg = {}
 *         self.fitarg.update(self.initialvalue)             # <<<<<<<<<<<<<<
 *         self.fitarg.update({'error_' + k: v for k, v in self.initialerror.items()})
 *         self.fitarg.update({'limit_' + k: v for k, v in self.initiallimit.items()})
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->fitarg, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_self->initialvalue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->initialvalue);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->initialvalue);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_cur_scope->__pyx_v_self->initialvalue);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":346
 *         self.fitarg = {}
 *         self.fitarg.update(self.initialvalue)
 *         self.fitarg.update({'error_' + k: v for k, v in self.initialerror.items()})             # <<<<<<<<<<<<<<
 *         self.fitarg.update({'limit_' + k: v for k, v in self.initiallimit.items()})
 *         self.fitarg.update({'fix_' + k: v for k, v in self.initialfix.items()})
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->fitarg, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  { /* enter inner scope */
    PyObject *__pyx_8genexpr9__pyx_v_k = NULL;
    PyObject *__pyx_8genexpr9__pyx_v_v = NULL;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->initialerror, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_12) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_8(__pyx_t_4);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_12 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        #else
        __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        __Pyx_GOTREF(__pyx_t_13);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_14 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext;
        index = 0; __pyx_t_12 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_12)) goto __pyx_L60_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L60_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_13);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        __pyx_t_15 = NULL;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L61_unpacking_done;
        __pyx_L60_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_15 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        __pyx_L61_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_k, __pyx_t_12);
      __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_v, __pyx_t_13);
      __pyx_t_13 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_n_u_error_2, __pyx_8genexpr9__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_t_1, (PyObject*)__pyx_8genexpr9__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v);
    goto __pyx_L62_exit_scope;
    __pyx_L57_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L62_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":347
 *         self.fitarg.update(self.initialvalue)
 *         self.fitarg.update({'error_' + k: v for k, v in self.initialerror.items()})
 *         self.fitarg.update({'limit_' + k: v for k, v in self.initiallimit.items()})             # <<<<<<<<<<<<<<
 *         self.fitarg.update({'fix_' + k: v for k, v in self.initialfix.items()})
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->fitarg, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  { /* enter inner scope */
    PyObject *__pyx_9genexpr10__pyx_v_k = NULL;
    PyObject *__pyx_9genexpr10__pyx_v_v = NULL;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->initiallimit, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_13 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_13) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_13); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_8(__pyx_t_4);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_13 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_12);
        #else
        __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        __Pyx_GOTREF(__pyx_t_12);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_14 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext;
        index = 0; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L68_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_13);
        index = 1; __pyx_t_12 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_12)) goto __pyx_L68_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        __pyx_t_15 = NULL;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L69_unpacking_done;
        __pyx_L68_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_15 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        __pyx_L69_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_k, __pyx_t_13);
      __pyx_t_13 = 0;
      __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_v, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_n_u_limit, __pyx_9genexpr10__pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_5, (PyObject*)__pyx_9genexpr10__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v);
    goto __pyx_L70_exit_scope;
    __pyx_L65_error:;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L70_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __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 = NULL;
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":348
 *         self.fitarg.update({'error_' + k: v for k, v in self.initialerror.items()})
 *         self.fitarg.update({'limit_' + k: v for k, v in self.initiallimit.items()})
 *         self.fitarg.update({'fix_' + k: v for k, v in self.initialfix.items()})             # <<<<<<<<<<<<<<
 * 
 *         self.narg = len(self.parameters)
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->fitarg, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  { /* enter inner scope */
    PyObject *__pyx_9genexpr11__pyx_v_k = NULL;
    PyObject *__pyx_9genexpr11__pyx_v_v = NULL;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->initialfix, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_12) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_8(__pyx_t_4);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_12 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        #else
        __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        __Pyx_GOTREF(__pyx_t_13);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_14 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext;
        index = 0; __pyx_t_12 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_12)) goto __pyx_L76_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L76_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_13);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        __pyx_t_15 = NULL;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L77_unpacking_done;
        __pyx_L76_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_15 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        __pyx_L77_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_k, __pyx_t_12);
      __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_v, __pyx_t_13);
      __pyx_t_13 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_n_u_fix, __pyx_9genexpr11__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_t_1, (PyObject*)__pyx_9genexpr11__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v);
    goto __pyx_L78_exit_scope;
    __pyx_L73_error:;
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L78_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":350
 *         self.fitarg.update({'fix_' + k: v for k, v in self.initialfix.items()})
 * 
 *         self.narg = len(self.parameters)             # <<<<<<<<<<<<<<
 * 
 *         self.merrors_struct = {}
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_self->parameters;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->narg);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->narg);
  __pyx_cur_scope->__pyx_v_self->narg = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":352
 *         self.narg = len(self.parameters)
 * 
 *         self.merrors_struct = {}             # <<<<<<<<<<<<<<
 * 
 *     def migrad(self, int ncall=10000, resume=True, int nsplit=1, precision=None):
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->merrors_struct);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->merrors_struct);
  __pyx_cur_scope->__pyx_v_self->merrors_struct = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":193
 *     """
 * 
 *     def __init__(self, fcn,             # <<<<<<<<<<<<<<
 *                  throw_nan=False, pedantic=True,
 *                  frontend=None, forced_parameters=None, print_level=1,
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_default_errordef);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":354
 *         self.merrors_struct = {}
 * 
 *     def migrad(self, int ncall=10000, resume=True, int nsplit=1, precision=None):             # <<<<<<<<<<<<<<
 *         """Run migrad.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3migrad(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_2migrad[] = "Minuit.migrad(self, int ncall=10000, resume=True, int nsplit=1, precision=None)\nRun migrad.\n\n        Migrad is an age-tested(over 40 years old, no kidding), super\n        robust and stable minimization algorithm. It even has\n        `wiki page <http://en.wikipedia.org/wiki/MINUIT>`_.\n        You can read how it does the magic at\n        `here <http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/minmain.html>`_.\n\n        **Arguments:**\n\n            * **ncall**: integer (approximate) maximum number of call before\n              migrad stop trying. Default 10000.\n\n            * **resume**: boolean indicating whether migrad should resume from\n              the previous minimizer attempt(True) or should start from the\n              beginning(False). Default True.\n\n            * **split**: split migrad in to *split* runs. Max fcn call\n              for each run is ncall/nsplit. Migrad stops when it found the\n              function minimum to be valid or ncall is reached. This is useful\n              for getting progress. However, you need to make sure that\n              ncall/nsplit is large enough. Otherwise, migrad will think\n              that the minimum is invalid due to exceeding max call\n              (ncall/nsplit). Default 1(no split).\n\n            * **precision**: override miniut own's internal precision.\n\n        **Return:**\n\n            :ref:`function-minimum-sruct`, list of :ref:`minuit-param-struct`\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3migrad(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_ncall;
  PyObject *__pyx_v_resume = 0;
  int __pyx_v_nsplit;
  PyObject *__pyx_v_precision = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("migrad (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ncall,&__pyx_n_s_resume,&__pyx_n_s_nsplit,&__pyx_n_s_precision,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ncall);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_resume);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nsplit);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "migrad") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_ncall = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_ncall == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ncall = ((int)0x2710);
    }
    __pyx_v_resume = values[1];
    if (values[2]) {
      __pyx_v_nsplit = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nsplit == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_nsplit = ((int)1);
    }
    __pyx_v_precision = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("migrad", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.migrad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_2migrad(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_ncall, __pyx_v_resume, __pyx_v_nsplit, __pyx_v_precision);

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_2migrad(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, int __pyx_v_ncall, PyObject *__pyx_v_resume, int __pyx_v_nsplit, PyObject *__pyx_v_precision) {
  MnUserParameterState *__pyx_v_ups;
  MnStrategy *__pyx_v_strat;
  PyObject *__pyx_v_ncall_round = NULL;
  PyObject *__pyx_v_totalcalls = NULL;
  int __pyx_v_first;
  PyObject *__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_t_5;
  PyObject *__pyx_t_6 = NULL;
  MnUserParameterState *__pyx_t_7;
  MnMigrad *__pyx_t_8;
  double __pyx_t_9;
  unsigned int __pyx_t_10;
  FunctionMinimum *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("migrad", 0);

  /* "iminuit/_libiminuit.pyx":388
 *         #construct new fcn and migrad if
 *         #it's a clean state or resume=False
 *         cdef MnUserParameterState*ups = NULL             # <<<<<<<<<<<<<<
 *         cdef MnStrategy*strat = NULL
 * 
 */
  __pyx_v_ups = NULL;

  /* "iminuit/_libiminuit.pyx":389
 *         #it's a clean state or resume=False
 *         cdef MnUserParameterState*ups = NULL
 *         cdef MnStrategy*strat = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self.print_level > 0:
 */
  __pyx_v_strat = NULL;

  /* "iminuit/_libiminuit.pyx":391
 *         cdef MnStrategy*strat = NULL
 * 
 *         if self.print_level > 0:             # <<<<<<<<<<<<<<
 *             self.frontend.print_banner('MIGRAD')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":392
 * 
 *         if self.print_level > 0:
 *             self.frontend.print_banner('MIGRAD')             # <<<<<<<<<<<<<<
 * 
 *         if not resume or self.is_clean_state():
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_banner); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":391
 *         cdef MnStrategy*strat = NULL
 * 
 *         if self.print_level > 0:             # <<<<<<<<<<<<<<
 *             self.frontend.print_banner('MIGRAD')
 * 
 */
  }

  /* "iminuit/_libiminuit.pyx":394
 *             self.frontend.print_banner('MIGRAD')
 * 
 *         if not resume or self.is_clean_state():             # <<<<<<<<<<<<<<
 *             self.construct_FCN()
 *             if self.minimizer is not NULL: del self.minimizer
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_resume); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_clean_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":395
 * 
 *         if not resume or self.is_clean_state():
 *             self.construct_FCN()             # <<<<<<<<<<<<<<
 *             if self.minimizer is not NULL: del self.minimizer
 *             ups = self.initialParameterState()
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->construct_FCN(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":396
 *         if not resume or self.is_clean_state():
 *             self.construct_FCN()
 *             if self.minimizer is not NULL: del self.minimizer             # <<<<<<<<<<<<<<
 *             ups = self.initialParameterState()
 *             strat = new MnStrategy(self.strategy)
 */
    __pyx_t_2 = ((__pyx_v_self->minimizer != NULL) != 0);
    if (__pyx_t_2) {
      delete __pyx_v_self->minimizer;
    }

    /* "iminuit/_libiminuit.pyx":397
 *             self.construct_FCN()
 *             if self.minimizer is not NULL: del self.minimizer
 *             ups = self.initialParameterState()             # <<<<<<<<<<<<<<
 *             strat = new MnStrategy(self.strategy)
 *             self.minimizer = \
 */
    __pyx_t_7 = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->initialParameterState(__pyx_v_self); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ups = __pyx_t_7;

    /* "iminuit/_libiminuit.pyx":398
 *             if self.minimizer is not NULL: del self.minimizer
 *             ups = self.initialParameterState()
 *             strat = new MnStrategy(self.strategy)             # <<<<<<<<<<<<<<
 *             self.minimizer = \
 *                 new MnMigrad(deref(self.pyfcn), deref(ups), deref(strat))
 */
    __pyx_v_strat = new MnStrategy(__pyx_v_self->strategy);

    /* "iminuit/_libiminuit.pyx":400
 *             strat = new MnStrategy(self.strategy)
 *             self.minimizer = \
 *                 new MnMigrad(deref(self.pyfcn), deref(ups), deref(strat))             # <<<<<<<<<<<<<<
 *             del ups;
 *             ups = NULL
 */
    try {
      __pyx_t_8 = new MnMigrad((*__pyx_v_self->pyfcn), (*__pyx_v_ups), (*__pyx_v_strat));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "iminuit/_libiminuit.pyx":399
 *             ups = self.initialParameterState()
 *             strat = new MnStrategy(self.strategy)
 *             self.minimizer = \             # <<<<<<<<<<<<<<
 *                 new MnMigrad(deref(self.pyfcn), deref(ups), deref(strat))
 *             del ups;
 */
    __pyx_v_self->minimizer = __pyx_t_8;

    /* "iminuit/_libiminuit.pyx":401
 *             self.minimizer = \
 *                 new MnMigrad(deref(self.pyfcn), deref(ups), deref(strat))
 *             del ups;             # <<<<<<<<<<<<<<
 *             ups = NULL
 *             del strat;
 */
    delete __pyx_v_ups;

    /* "iminuit/_libiminuit.pyx":402
 *                 new MnMigrad(deref(self.pyfcn), deref(ups), deref(strat))
 *             del ups;
 *             ups = NULL             # <<<<<<<<<<<<<<
 *             del strat;
 *             strat = NULL
 */
    __pyx_v_ups = NULL;

    /* "iminuit/_libiminuit.pyx":403
 *             del ups;
 *             ups = NULL
 *             del strat;             # <<<<<<<<<<<<<<
 *             strat = NULL
 * 
 */
    delete __pyx_v_strat;

    /* "iminuit/_libiminuit.pyx":404
 *             ups = NULL
 *             del strat;
 *             strat = NULL             # <<<<<<<<<<<<<<
 * 
 *         if not resume:
 */
    __pyx_v_strat = NULL;

    /* "iminuit/_libiminuit.pyx":394
 *             self.frontend.print_banner('MIGRAD')
 * 
 *         if not resume or self.is_clean_state():             # <<<<<<<<<<<<<<
 *             self.construct_FCN()
 *             if self.minimizer is not NULL: del self.minimizer
 */
  }

  /* "iminuit/_libiminuit.pyx":406
 *             strat = NULL
 * 
 *         if not resume:             # <<<<<<<<<<<<<<
 *             self.pyfcn.resetNumCall()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_resume); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((!__pyx_t_2) != 0);
  if (__pyx_t_5) {

    /* "iminuit/_libiminuit.pyx":407
 * 
 *         if not resume:
 *             self.pyfcn.resetNumCall()             # <<<<<<<<<<<<<<
 * 
 *         del self.cfmin  #remove the old one
 */
    __pyx_v_self->pyfcn->resetNumCall();

    /* "iminuit/_libiminuit.pyx":406
 *             strat = NULL
 * 
 *         if not resume:             # <<<<<<<<<<<<<<
 *             self.pyfcn.resetNumCall()
 * 
 */
  }

  /* "iminuit/_libiminuit.pyx":409
 *             self.pyfcn.resetNumCall()
 * 
 *         del self.cfmin  #remove the old one             # <<<<<<<<<<<<<<
 * 
 *         #this returns a real object need to copy
 */
  delete __pyx_v_self->cfmin;

  /* "iminuit/_libiminuit.pyx":412
 * 
 *         #this returns a real object need to copy
 *         ncall_round = round(1.0 * (ncall) / nsplit)             # <<<<<<<<<<<<<<
 *         assert (ncall_round > 0)
 *         totalcalls = 0
 */
  __pyx_t_9 = (1.0 * __pyx_v_ncall);
  if (unlikely(__pyx_v_nsplit == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = PyFloat_FromDouble((__pyx_t_9 / ((double)__pyx_v_nsplit))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ncall_round = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":413
 *         #this returns a real object need to copy
 *         ncall_round = round(1.0 * (ncall) / nsplit)
 *         assert (ncall_round > 0)             # <<<<<<<<<<<<<<
 *         totalcalls = 0
 *         first = True
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_ncall_round, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "iminuit/_libiminuit.pyx":414
 *         ncall_round = round(1.0 * (ncall) / nsplit)
 *         assert (ncall_round > 0)
 *         totalcalls = 0             # <<<<<<<<<<<<<<
 *         first = True
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_totalcalls = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":415
 *         assert (ncall_round > 0)
 *         totalcalls = 0
 *         first = True             # <<<<<<<<<<<<<<
 * 
 *         if precision is not None:
 */
  __pyx_v_first = 1;

  /* "iminuit/_libiminuit.pyx":417
 *         first = True
 * 
 *         if precision is not None:             # <<<<<<<<<<<<<<
 *             self.minimizer.SetPrecision(precision)
 * 
 */
  __pyx_t_5 = (__pyx_v_precision != Py_None);
  __pyx_t_2 = (__pyx_t_5 != 0);
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":418
 * 
 *         if precision is not None:
 *             self.minimizer.SetPrecision(precision)             # <<<<<<<<<<<<<<
 * 
 *         while (first) or \
 */
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_precision); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->minimizer->SetPrecision(__pyx_t_9);

    /* "iminuit/_libiminuit.pyx":417
 *         first = True
 * 
 *         if precision is not None:             # <<<<<<<<<<<<<<
 *             self.minimizer.SetPrecision(precision)
 * 
 */
  }

  /* "iminuit/_libiminuit.pyx":420
 *             self.minimizer.SetPrecision(precision)
 * 
 *         while (first) or \             # <<<<<<<<<<<<<<
 *                 (not self.cfmin.IsValid() and totalcalls < ncall):
 *             first = False
 */
  while (1) {
    __pyx_t_5 = (__pyx_v_first != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L12_bool_binop_done;
    }

    /* "iminuit/_libiminuit.pyx":421
 * 
 *         while (first) or \
 *                 (not self.cfmin.IsValid() and totalcalls < ncall):             # <<<<<<<<<<<<<<
 *             first = False
 *             self.cfmin = call_mnapplication_wrapper(
 */
    __pyx_t_5 = ((!(__pyx_v_self->cfmin->IsValid() != 0)) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ncall); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_totalcalls, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = __pyx_t_5;
    __pyx_L12_bool_binop_done:;
    if (!__pyx_t_2) break;

    /* "iminuit/_libiminuit.pyx":422
 *         while (first) or \
 *                 (not self.cfmin.IsValid() and totalcalls < ncall):
 *             first = False             # <<<<<<<<<<<<<<
 *             self.cfmin = call_mnapplication_wrapper(
 *                 deref(self.minimizer), ncall_round, self.tol)
 */
    __pyx_v_first = 0;

    /* "iminuit/_libiminuit.pyx":424
 *             first = False
 *             self.cfmin = call_mnapplication_wrapper(
 *                 deref(self.minimizer), ncall_round, self.tol)             # <<<<<<<<<<<<<<
 *             del self.last_upst
 *             self.last_upst = new MnUserParameterState(self.cfmin.UserState())
 */
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_v_ncall_round); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":423
 *                 (not self.cfmin.IsValid() and totalcalls < ncall):
 *             first = False
 *             self.cfmin = call_mnapplication_wrapper(             # <<<<<<<<<<<<<<
 *                 deref(self.minimizer), ncall_round, self.tol)
 *             del self.last_upst
 */
    try {
      __pyx_t_11 = call_mnapplication_wrapper((*__pyx_v_self->minimizer), __pyx_t_10, __pyx_v_self->tol);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_self->cfmin = __pyx_t_11;

    /* "iminuit/_libiminuit.pyx":425
 *             self.cfmin = call_mnapplication_wrapper(
 *                 deref(self.minimizer), ncall_round, self.tol)
 *             del self.last_upst             # <<<<<<<<<<<<<<
 *             self.last_upst = new MnUserParameterState(self.cfmin.UserState())
 *             totalcalls += ncall_round  #self.cfmin.NFcn()
 */
    delete __pyx_v_self->last_upst;

    /* "iminuit/_libiminuit.pyx":426
 *                 deref(self.minimizer), ncall_round, self.tol)
 *             del self.last_upst
 *             self.last_upst = new MnUserParameterState(self.cfmin.UserState())             # <<<<<<<<<<<<<<
 *             totalcalls += ncall_round  #self.cfmin.NFcn()
 *             if self.print_level > 1 and nsplit != 1: self.print_fmin()
 */
    __pyx_v_self->last_upst = new MnUserParameterState(__pyx_v_self->cfmin->UserState());

    /* "iminuit/_libiminuit.pyx":427
 *             del self.last_upst
 *             self.last_upst = new MnUserParameterState(self.cfmin.UserState())
 *             totalcalls += ncall_round  #self.cfmin.NFcn()             # <<<<<<<<<<<<<<
 *             if self.print_level > 1 and nsplit != 1: self.print_fmin()
 * 
 */
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_totalcalls, __pyx_v_ncall_round); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_totalcalls, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":428
 *             self.last_upst = new MnUserParameterState(self.cfmin.UserState())
 *             totalcalls += ncall_round  #self.cfmin.NFcn()
 *             if self.print_level > 1 and nsplit != 1: self.print_fmin()             # <<<<<<<<<<<<<<
 * 
 *         del self.last_upst
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L16_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_nsplit != 1) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L16_bool_binop_done:;
    if (__pyx_t_2) {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print_fmin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && 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);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
  }

  /* "iminuit/_libiminuit.pyx":430
 *             if self.print_level > 1 and nsplit != 1: self.print_fmin()
 * 
 *         del self.last_upst             # <<<<<<<<<<<<<<
 *         self.last_upst = new MnUserParameterState(self.cfmin.UserState())
 *         self.refreshInternalState()
 */
  delete __pyx_v_self->last_upst;

  /* "iminuit/_libiminuit.pyx":431
 * 
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(self.cfmin.UserState())             # <<<<<<<<<<<<<<
 *         self.refreshInternalState()
 * 
 */
  __pyx_v_self->last_upst = new MnUserParameterState(__pyx_v_self->cfmin->UserState());

  /* "iminuit/_libiminuit.pyx":432
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(self.cfmin.UserState())
 *         self.refreshInternalState()             # <<<<<<<<<<<<<<
 * 
 *         if self.print_level > 0:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->refreshInternalState(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":434
 *         self.refreshInternalState()
 * 
 *         if self.print_level > 0:             # <<<<<<<<<<<<<<
 *             self.print_fmin()
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":435
 * 
 *         if self.print_level > 0:
 *             self.print_fmin()             # <<<<<<<<<<<<<<
 * 
 *         return self.get_fmin(), self.get_param_states()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print_fmin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":434
 *         self.refreshInternalState()
 * 
 *         if self.print_level > 0:             # <<<<<<<<<<<<<<
 *             self.print_fmin()
 * 
 */
  }

  /* "iminuit/_libiminuit.pyx":437
 *             self.print_fmin()
 * 
 *         return self.get_fmin(), self.get_param_states()             # <<<<<<<<<<<<<<
 * 
 *     def hesse(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_fmin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_param_states); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (__pyx_t_12) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":354
 *         self.merrors_struct = {}
 * 
 *     def migrad(self, int ncall=10000, resume=True, int nsplit=1, precision=None):             # <<<<<<<<<<<<<<
 *         """Run migrad.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.migrad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ncall_round);
  __Pyx_XDECREF(__pyx_v_totalcalls);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":439
 *         return self.get_fmin(), self.get_param_states()
 * 
 *     def hesse(self):             # <<<<<<<<<<<<<<
 *         """Run HESSE.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_5hesse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_4hesse[] = "Minuit.hesse(self)\nRun HESSE.\n\n        HESSE estimates error matrix by the `second derivative at the minimim\n        <http://en.wikipedia.org/wiki/Hessian_matrix>`_. This error matrix\n        is good if your :math:`\\chi^2` or likelihood profile is parabolic at\n        the minimum. From my experience, most of the simple fits are.\n\n        :meth:`minos` makes no parabolic assumption and scan the likelihood\n        and give the correct error asymmetric error in all cases(Unless your\n        likelihood profile is utterly discontinuous near the minimum). But,\n        it is much more computationally expensive.\n\n        **Returns:**\n\n            list of :ref:`minuit-param-struct`\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_5hesse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hesse (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_4hesse(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4hesse(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  MnHesse *__pyx_v_hesse;
  MnUserParameterState __pyx_v_upst;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  MnUserParameterState __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hesse", 0);

  /* "iminuit/_libiminuit.pyx":457
 *         """
 * 
 *         cdef MnHesse*hesse = NULL             # <<<<<<<<<<<<<<
 *         cdef MnUserParameterState upst
 *         if self.print_level > 0: self.frontend.print_banner('HESSE')
 */
  __pyx_v_hesse = NULL;

  /* "iminuit/_libiminuit.pyx":459
 *         cdef MnHesse*hesse = NULL
 *         cdef MnUserParameterState upst
 *         if self.print_level > 0: self.frontend.print_banner('HESSE')             # <<<<<<<<<<<<<<
 *         if self.cfmin is NULL:
 *             raise RuntimeError('Run migrad first')
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_banner); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "iminuit/_libiminuit.pyx":460
 *         cdef MnUserParameterState upst
 *         if self.print_level > 0: self.frontend.print_banner('HESSE')
 *         if self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Run migrad first')
 *         hesse = new MnHesse(self.strategy)
 */
  __pyx_t_2 = ((__pyx_v_self->cfmin == NULL) != 0);
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":461
 *         if self.print_level > 0: self.frontend.print_banner('HESSE')
 *         if self.cfmin is NULL:
 *             raise RuntimeError('Run migrad first')             # <<<<<<<<<<<<<<
 *         hesse = new MnHesse(self.strategy)
 *         upst = hesse.call(deref(self.pyfcn), self.cfmin.UserState())
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":460
 *         cdef MnUserParameterState upst
 *         if self.print_level > 0: self.frontend.print_banner('HESSE')
 *         if self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Run migrad first')
 *         hesse = new MnHesse(self.strategy)
 */
  }

  /* "iminuit/_libiminuit.pyx":462
 *         if self.cfmin is NULL:
 *             raise RuntimeError('Run migrad first')
 *         hesse = new MnHesse(self.strategy)             # <<<<<<<<<<<<<<
 *         upst = hesse.call(deref(self.pyfcn), self.cfmin.UserState())
 *         if not upst.HasCovariance():
 */
  __pyx_v_hesse = new MnHesse(__pyx_v_self->strategy);

  /* "iminuit/_libiminuit.pyx":463
 *             raise RuntimeError('Run migrad first')
 *         hesse = new MnHesse(self.strategy)
 *         upst = hesse.call(deref(self.pyfcn), self.cfmin.UserState())             # <<<<<<<<<<<<<<
 *         if not upst.HasCovariance():
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",
 */
  try {
    __pyx_t_4 = __pyx_v_hesse->operator()((*__pyx_v_self->pyfcn), __pyx_v_self->cfmin->UserState(), NULL);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_upst = __pyx_t_4;

  /* "iminuit/_libiminuit.pyx":464
 *         hesse = new MnHesse(self.strategy)
 *         upst = hesse.call(deref(self.pyfcn), self.cfmin.UserState())
 *         if not upst.HasCovariance():             # <<<<<<<<<<<<<<
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",
 *                  HesseFailedWarning)
 */
  __pyx_t_2 = ((!(__pyx_v_upst.HasCovariance() != 0)) != 0);
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":465
 *         upst = hesse.call(deref(self.pyfcn), self.cfmin.UserState())
 *         if not upst.HasCovariance():
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",             # <<<<<<<<<<<<<<
 *                  HesseFailedWarning)
 *         del self.last_upst
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);

    /* "iminuit/_libiminuit.pyx":466
 *         if not upst.HasCovariance():
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",
 *                  HesseFailedWarning)             # <<<<<<<<<<<<<<
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(upst)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_HesseFailedWarning); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __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_kp_u_HESSE_Failed_Covariance_and_Glob);
    __Pyx_GIVEREF(__pyx_kp_u_HESSE_Failed_Covariance_and_Glob);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_kp_u_HESSE_Failed_Covariance_and_Glob);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":464
 *         hesse = new MnHesse(self.strategy)
 *         upst = hesse.call(deref(self.pyfcn), self.cfmin.UserState())
 *         if not upst.HasCovariance():             # <<<<<<<<<<<<<<
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",
 *                  HesseFailedWarning)
 */
  }

  /* "iminuit/_libiminuit.pyx":467
 *             warn("HESSE Failed. Covariance and GlobalCC will not be available",
 *                  HesseFailedWarning)
 *         del self.last_upst             # <<<<<<<<<<<<<<
 *         self.last_upst = new MnUserParameterState(upst)
 *         self.refreshInternalState()
 */
  delete __pyx_v_self->last_upst;

  /* "iminuit/_libiminuit.pyx":468
 *                  HesseFailedWarning)
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(upst)             # <<<<<<<<<<<<<<
 *         self.refreshInternalState()
 *         del hesse
 */
  __pyx_v_self->last_upst = new MnUserParameterState(__pyx_v_upst);

  /* "iminuit/_libiminuit.pyx":469
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(upst)
 *         self.refreshInternalState()             # <<<<<<<<<<<<<<
 *         del hesse
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->refreshInternalState(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":470
 *         self.last_upst = new MnUserParameterState(upst)
 *         self.refreshInternalState()
 *         del hesse             # <<<<<<<<<<<<<<
 * 
 *         if self.print_level > 0:
 */
  delete __pyx_v_hesse;

  /* "iminuit/_libiminuit.pyx":472
 *         del hesse
 * 
 *         if self.print_level > 0:             # <<<<<<<<<<<<<<
 *             self.print_param()
 *             self.print_matrix()
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":473
 * 
 *         if self.print_level > 0:
 *             self.print_param()             # <<<<<<<<<<<<<<
 *             self.print_matrix()
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print_param); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":474
 *         if self.print_level > 0:
 *             self.print_param()
 *             self.print_matrix()             # <<<<<<<<<<<<<<
 * 
 *         return self.get_param_states()
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":472
 *         del hesse
 * 
 *         if self.print_level > 0:             # <<<<<<<<<<<<<<
 *             self.print_param()
 *             self.print_matrix()
 */
  }

  /* "iminuit/_libiminuit.pyx":476
 *             self.print_matrix()
 * 
 *         return self.get_param_states()             # <<<<<<<<<<<<<<
 * 
 *     def minos(self, var = None, sigma = 1., unsigned int maxcall=1000):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_param_states); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_8) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":439
 *         return self.get_fmin(), self.get_param_states()
 * 
 *     def hesse(self):             # <<<<<<<<<<<<<<
 *         """Run HESSE.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.hesse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":478
 *         return self.get_param_states()
 * 
 *     def minos(self, var = None, sigma = 1., unsigned int maxcall=1000):             # <<<<<<<<<<<<<<
 *         """Run minos for parameter *var*.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7minos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_6minos[] = "Minuit.minos(self, var=None, sigma=1.0, unsigned int maxcall=1000)\nRun minos for parameter *var*.\n\n        If *var* is None it runs minos for all parameters\n\n        **Arguments:**\n\n            - **var**: optional variable name. Default None.(run minos for\n              every variable)\n            - **sigma**: number of :math:`\\sigma` error. Default 1.0.\n\n        **Returns:**\n\n            Dictionary of varname to :ref:`minos-error-struct`\n            if minos is requested for all parameters.\n\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7minos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_var = 0;
  PyObject *__pyx_v_sigma = 0;
  unsigned int __pyx_v_maxcall;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("minos (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_var,&__pyx_n_s_sigma,&__pyx_n_s_maxcall,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)__pyx_float_1_);
    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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sigma);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxcall);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minos") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_var = values[0];
    __pyx_v_sigma = values[1];
    if (values[2]) {
      __pyx_v_maxcall = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_maxcall == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_maxcall = ((unsigned int)0x3E8);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("minos", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.minos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6minos(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_var, __pyx_v_sigma, __pyx_v_maxcall);

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6minos(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_var, PyObject *__pyx_v_sigma, unsigned int __pyx_v_maxcall) {
  unsigned int __pyx_v_index;
  MnMinos *__pyx_v_minos;
  MinosError __pyx_v_mnerror;
  CYTHON_UNUSED char *__pyx_v_name;
  double __pyx_v_oldup;
  PyObject *__pyx_v_varlist = NULL;
  PyObject *__pyx_v_fixed_param = NULL;
  PyObject *__pyx_v_vname = 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;
  double __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  char *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  MinosError __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("minos", 0);

  /* "iminuit/_libiminuit.pyx":495
 * 
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Minos require function to be at the minimum.'
 *                                ' Run migrad first.')
 */
  __pyx_t_2 = ((__pyx_v_self->pyfcn == NULL) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_self->cfmin == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":496
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:
 *             raise RuntimeError('Minos require function to be at the minimum.'             # <<<<<<<<<<<<<<
 *                                ' Run migrad first.')
 *         cdef unsigned int index = 0
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":495
 * 
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Minos require function to be at the minimum.'
 *                                ' Run migrad first.')
 */
  }

  /* "iminuit/_libiminuit.pyx":498
 *             raise RuntimeError('Minos require function to be at the minimum.'
 *                                ' Run migrad first.')
 *         cdef unsigned int index = 0             # <<<<<<<<<<<<<<
 *         cdef MnMinos*minos = NULL
 *         cdef MinosError mnerror
 */
  __pyx_v_index = 0;

  /* "iminuit/_libiminuit.pyx":499
 *                                ' Run migrad first.')
 *         cdef unsigned int index = 0
 *         cdef MnMinos*minos = NULL             # <<<<<<<<<<<<<<
 *         cdef MinosError mnerror
 *         cdef char*name = NULL
 */
  __pyx_v_minos = NULL;

  /* "iminuit/_libiminuit.pyx":501
 *         cdef MnMinos*minos = NULL
 *         cdef MinosError mnerror
 *         cdef char*name = NULL             # <<<<<<<<<<<<<<
 *         cdef double oldup = self.pyfcn.Up()
 *         self.pyfcn.set_up(oldup * sigma * sigma)
 */
  __pyx_v_name = NULL;

  /* "iminuit/_libiminuit.pyx":502
 *         cdef MinosError mnerror
 *         cdef char*name = NULL
 *         cdef double oldup = self.pyfcn.Up()             # <<<<<<<<<<<<<<
 *         self.pyfcn.set_up(oldup * sigma * sigma)
 *         if self.print_level > 0: self.frontend.print_banner('MINOS')
 */
  __pyx_v_oldup = __pyx_v_self->pyfcn->Up();

  /* "iminuit/_libiminuit.pyx":503
 *         cdef char*name = NULL
 *         cdef double oldup = self.pyfcn.Up()
 *         self.pyfcn.set_up(oldup * sigma * sigma)             # <<<<<<<<<<<<<<
 *         if self.print_level > 0: self.frontend.print_banner('MINOS')
 *         if not self.cfmin.IsValid():
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_oldup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_v_sigma); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_v_sigma); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->pyfcn->set_up(__pyx_t_5);

  /* "iminuit/_libiminuit.pyx":504
 *         cdef double oldup = self.pyfcn.Up()
 *         self.pyfcn.set_up(oldup * sigma * sigma)
 *         if self.print_level > 0: self.frontend.print_banner('MINOS')             # <<<<<<<<<<<<<<
 *         if not self.cfmin.IsValid():
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_banner); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "iminuit/_libiminuit.pyx":505
 *         self.pyfcn.set_up(oldup * sigma * sigma)
 *         if self.print_level > 0: self.frontend.print_banner('MINOS')
 *         if not self.cfmin.IsValid():             # <<<<<<<<<<<<<<
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'
 *                                 ' migrad converge first'))
 */
  __pyx_t_1 = ((!(__pyx_v_self->cfmin->IsValid() != 0)) != 0);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":506
 *         if self.print_level > 0: self.frontend.print_banner('MINOS')
 *         if not self.cfmin.IsValid():
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'             # <<<<<<<<<<<<<<
 *                                 ' migrad converge first'))
 *         if var is not None and var not in self.parameters:
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":505
 *         self.pyfcn.set_up(oldup * sigma * sigma)
 *         if self.print_level > 0: self.frontend.print_banner('MINOS')
 *         if not self.cfmin.IsValid():             # <<<<<<<<<<<<<<
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'
 *                                 ' migrad converge first'))
 */
  }

  /* "iminuit/_libiminuit.pyx":508
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'
 *                                 ' migrad converge first'))
 *         if var is not None and var not in self.parameters:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Specified parameters(%r) cannot be found'
 *                                ' in parameter list :' % var + str(self.parameters))
 */
  __pyx_t_2 = (__pyx_v_var != Py_None);
  __pyx_t_6 = (__pyx_t_2 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_var, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_6 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":510
 *         if var is not None and var not in self.parameters:
 *             raise RuntimeError('Specified parameters(%r) cannot be found'
 *                                ' in parameter list :' % var + str(self.parameters))             # <<<<<<<<<<<<<<
 * 
 *         varlist = [var] if var is not None else self.parameters
 */
    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_Specified_parameters_r_cannot_be, __pyx_v_var); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->parameters);
    __Pyx_GIVEREF(__pyx_v_self->parameters);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->parameters);
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":509
 *                                 ' migrad converge first'))
 *         if var is not None and var not in self.parameters:
 *             raise RuntimeError('Specified parameters(%r) cannot be found'             # <<<<<<<<<<<<<<
 *                                ' in parameter list :' % var + str(self.parameters))
 * 
 */
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":508
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'
 *                                 ' migrad converge first'))
 *         if var is not None and var not in self.parameters:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Specified parameters(%r) cannot be found'
 *                                ' in parameter list :' % var + str(self.parameters))
 */
  }

  /* "iminuit/_libiminuit.pyx":512
 *                                ' in parameter list :' % var + str(self.parameters))
 * 
 *         varlist = [var] if var is not None else self.parameters             # <<<<<<<<<<<<<<
 * 
 *         fixed_param = self.list_of_fixed_param()
 */
  __pyx_t_1 = (__pyx_v_var != Py_None);
  if ((__pyx_t_1 != 0)) {
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_var);
    __Pyx_GIVEREF(__pyx_v_var);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_var);
    __pyx_t_3 = __pyx_t_7;
    __pyx_t_7 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_self->parameters);
    __pyx_t_3 = __pyx_v_self->parameters;
  }
  __pyx_v_varlist = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":514
 *         varlist = [var] if var is not None else self.parameters
 * 
 *         fixed_param = self.list_of_fixed_param()             # <<<<<<<<<<<<<<
 *         for vname in varlist:
 *             index = self.cfmin.UserState().Index(vname)
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list_of_fixed_param); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_fixed_param = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":515
 * 
 *         fixed_param = self.list_of_fixed_param()
 *         for vname in varlist:             # <<<<<<<<<<<<<<
 *             index = self.cfmin.UserState().Index(vname)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_varlist)) || PyTuple_CheckExact(__pyx_v_varlist)) {
    __pyx_t_3 = __pyx_v_varlist; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_varlist); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_9(__pyx_t_3);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_vname, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":516
 *         fixed_param = self.list_of_fixed_param()
 *         for vname in varlist:
 *             index = self.cfmin.UserState().Index(vname)             # <<<<<<<<<<<<<<
 * 
 *             if vname in fixed_param:
 */
    __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_vname); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_index = __pyx_v_self->cfmin->UserState().Index(__pyx_t_10);

    /* "iminuit/_libiminuit.pyx":518
 *             index = self.cfmin.UserState().Index(vname)
 * 
 *             if vname in fixed_param:             # <<<<<<<<<<<<<<
 *                 if var is not None:  #specifying vname but it's fixed
 *                     warn(RuntimeWarning(
 */
    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_vname, __pyx_v_fixed_param, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "iminuit/_libiminuit.pyx":519
 * 
 *             if vname in fixed_param:
 *                 if var is not None:  #specifying vname but it's fixed             # <<<<<<<<<<<<<<
 *                     warn(RuntimeWarning(
 *                         'Specified variable name for minos is set to fixed'))
 */
      __pyx_t_2 = (__pyx_v_var != Py_None);
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {

        /* "iminuit/_libiminuit.pyx":520
 *             if vname in fixed_param:
 *                 if var is not None:  #specifying vname but it's fixed
 *                     warn(RuntimeWarning(             # <<<<<<<<<<<<<<
 *                         'Specified variable name for minos is set to fixed'))
 *                     return None
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeWarning, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_12) {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL;
          __Pyx_GIVEREF(__pyx_t_11);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "iminuit/_libiminuit.pyx":522
 *                     warn(RuntimeWarning(
 *                         'Specified variable name for minos is set to fixed'))
 *                     return None             # <<<<<<<<<<<<<<
 *                 continue
 *             minos = new MnMinos(deref(
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_None);
        __pyx_r = Py_None;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L0;

        /* "iminuit/_libiminuit.pyx":519
 * 
 *             if vname in fixed_param:
 *                 if var is not None:  #specifying vname but it's fixed             # <<<<<<<<<<<<<<
 *                     warn(RuntimeWarning(
 *                         'Specified variable name for minos is set to fixed'))
 */
      }

      /* "iminuit/_libiminuit.pyx":523
 *                         'Specified variable name for minos is set to fixed'))
 *                     return None
 *                 continue             # <<<<<<<<<<<<<<
 *             minos = new MnMinos(deref(
 *                 self.pyfcn), deref(self.cfmin), self.strategy)
 */
      goto __pyx_L11_continue;

      /* "iminuit/_libiminuit.pyx":518
 *             index = self.cfmin.UserState().Index(vname)
 * 
 *             if vname in fixed_param:             # <<<<<<<<<<<<<<
 *                 if var is not None:  #specifying vname but it's fixed
 *                     warn(RuntimeWarning(
 */
    }

    /* "iminuit/_libiminuit.pyx":524
 *                     return None
 *                 continue
 *             minos = new MnMinos(deref(             # <<<<<<<<<<<<<<
 *                 self.pyfcn), deref(self.cfmin), self.strategy)
 *             mnerror = minos.Minos(index, maxcall)
 */
    __pyx_v_minos = new MnMinos((*__pyx_v_self->pyfcn), (*__pyx_v_self->cfmin), __pyx_v_self->strategy);

    /* "iminuit/_libiminuit.pyx":526
 *             minos = new MnMinos(deref(
 *                 self.pyfcn), deref(self.cfmin), self.strategy)
 *             mnerror = minos.Minos(index, maxcall)             # <<<<<<<<<<<<<<
 *             self.merrors_struct[vname] = minoserror2struct(mnerror)
 *             if self.print_level > 0:
 */
    try {
      __pyx_t_14 = __pyx_v_minos->Minos(__pyx_v_index, __pyx_v_maxcall);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_mnerror = __pyx_t_14;

    /* "iminuit/_libiminuit.pyx":527
 *                 self.pyfcn), deref(self.cfmin), self.strategy)
 *             mnerror = minos.Minos(index, maxcall)
 *             self.merrors_struct[vname] = minoserror2struct(mnerror)             # <<<<<<<<<<<<<<
 *             if self.print_level > 0:
 *                 self.frontend.print_merror(
 */
    __pyx_t_7 = __pyx_f_7iminuit_11_libiminuit_minoserror2struct(__pyx_v_mnerror); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely(PyObject_SetItem(__pyx_v_self->merrors_struct, __pyx_v_vname, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":528
 *             mnerror = minos.Minos(index, maxcall)
 *             self.merrors_struct[vname] = minoserror2struct(mnerror)
 *             if self.print_level > 0:             # <<<<<<<<<<<<<<
 *                 self.frontend.print_merror(
 *                     vname, self.merrors_struct[vname])
 */
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_1) {

      /* "iminuit/_libiminuit.pyx":529
 *             self.merrors_struct[vname] = minoserror2struct(mnerror)
 *             if self.print_level > 0:
 *                 self.frontend.print_merror(             # <<<<<<<<<<<<<<
 *                     vname, self.merrors_struct[vname])
 *         self.refreshInternalState()
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_merror); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "iminuit/_libiminuit.pyx":530
 *             if self.print_level > 0:
 *                 self.frontend.print_merror(
 *                     vname, self.merrors_struct[vname])             # <<<<<<<<<<<<<<
 *         self.refreshInternalState()
 *         del minos
 */
      __pyx_t_13 = PyObject_GetItem(__pyx_v_self->merrors_struct, __pyx_v_vname); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_11 = NULL;
      __pyx_t_15 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_15 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_11) {
        __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
      }
      __Pyx_INCREF(__pyx_v_vname);
      __Pyx_GIVEREF(__pyx_v_vname);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_15, __pyx_v_vname);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_15, __pyx_t_13);
      __pyx_t_13 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "iminuit/_libiminuit.pyx":528
 *             mnerror = minos.Minos(index, maxcall)
 *             self.merrors_struct[vname] = minoserror2struct(mnerror)
 *             if self.print_level > 0:             # <<<<<<<<<<<<<<
 *                 self.frontend.print_merror(
 *                     vname, self.merrors_struct[vname])
 */
    }

    /* "iminuit/_libiminuit.pyx":515
 * 
 *         fixed_param = self.list_of_fixed_param()
 *         for vname in varlist:             # <<<<<<<<<<<<<<
 *             index = self.cfmin.UserState().Index(vname)
 * 
 */
    __pyx_L11_continue:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":531
 *                 self.frontend.print_merror(
 *                     vname, self.merrors_struct[vname])
 *         self.refreshInternalState()             # <<<<<<<<<<<<<<
 *         del minos
 *         self.pyfcn.set_up(oldup)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->refreshInternalState(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":532
 *                     vname, self.merrors_struct[vname])
 *         self.refreshInternalState()
 *         del minos             # <<<<<<<<<<<<<<
 *         self.pyfcn.set_up(oldup)
 *         return self.merrors_struct
 */
  delete __pyx_v_minos;

  /* "iminuit/_libiminuit.pyx":533
 *         self.refreshInternalState()
 *         del minos
 *         self.pyfcn.set_up(oldup)             # <<<<<<<<<<<<<<
 *         return self.merrors_struct
 * 
 */
  __pyx_v_self->pyfcn->set_up(__pyx_v_oldup);

  /* "iminuit/_libiminuit.pyx":534
 *         del minos
 *         self.pyfcn.set_up(oldup)
 *         return self.merrors_struct             # <<<<<<<<<<<<<<
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->merrors_struct);
  __pyx_r = __pyx_v_self->merrors_struct;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":478
 *         return self.get_param_states()
 * 
 *     def minos(self, var = None, sigma = 1., unsigned int maxcall=1000):             # <<<<<<<<<<<<<<
 *         """Run minos for parameter *var*.
 * 
 */

  /* 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_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.minos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_varlist);
  __Pyx_XDECREF(__pyx_v_fixed_param);
  __Pyx_XDECREF(__pyx_v_vname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":536
 *         return self.merrors_struct
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """Error or correlation matrix in tuple or tuples format."""
 *         if self.last_upst is NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_9matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_8matrix[] = "Minuit.matrix(self, correlation=False, skip_fixed=True)\nError or correlation matrix in tuple or tuples format.";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_9matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_correlation = 0;
  PyObject *__pyx_v_skip_fixed = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_correlation,&__pyx_n_s_skip_fixed,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_False);
    values[1] = ((PyObject *)Py_True);
    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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_correlation);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip_fixed);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matrix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_correlation = values[0];
    __pyx_v_skip_fixed = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("matrix", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8matrix(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_correlation, __pyx_v_skip_fixed);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_2generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":550
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_2generator2, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_matrix_locals_genexpr_locals_gen); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr.genexpr", __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_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  unsigned int __pyx_t_7;
  double __pyx_t_8;
  unsigned int __pyx_t_9;
  unsigned int __pyx_t_10;
  double __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":551
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))
 *                       for iv1, v1 in enumerate(params)) \             # <<<<<<<<<<<<<<
 *                 for iv2, v2 in enumerate(params)
 *             )
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v1);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv1);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_iv1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":550
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_int(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2)) { __Pyx_RaiseClosureNameError("iv2"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_cov.operator()(__pyx_t_6, __pyx_t_7);
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_int(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2)) { __Pyx_RaiseClosureNameError("iv2"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_9 = __Pyx_PyInt_As_unsigned_int(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2)) { __Pyx_RaiseClosureNameError("iv2"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = sqrt((__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_cov.operator()(__pyx_t_7, __pyx_t_6) * __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_cov.operator()(__pyx_t_9, __pyx_t_10)));
    if (unlikely(__pyx_t_11 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyFloat_FromDouble((__pyx_t_8 / __pyx_t_11)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":551
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))
 *                       for iv1, v1 in enumerate(params)) \             # <<<<<<<<<<<<<<
 *                 for iv2, v2 in enumerate(params)
 *             )
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":550
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */

  /* 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_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_2generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_matrix_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr", __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_7iminuit_11_libiminuit_6Minuit_6matrix_2generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":552
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)             # <<<<<<<<<<<<<<
 *             )
 *         else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v2);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv2);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_iv2, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":550
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */
    __pyx_t_5 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __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;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":552
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)             # <<<<<<<<<<<<<<
 *             )
 *         else:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":550
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_5generator3(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_5generator4(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":556
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2)             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_5generator4, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_matrix_locals_genexpr_locals_gen); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr.genexpr", __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_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_5generator4(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":557
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2)
 *                       for iv1, v1 in enumerate(params)) \             # <<<<<<<<<<<<<<
 *                 for iv2, v2 in enumerate(params)
 *             )
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v1);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv1);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_iv1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":556
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2)             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_int(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2)) { __Pyx_RaiseClosureNameError("iv2"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_iv2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_cov.operator()(__pyx_t_6, __pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":557
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2)
 *                       for iv1, v1 in enumerate(params)) \             # <<<<<<<<<<<<<<
 *                 for iv2, v2 in enumerate(params)
 *             )
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":556
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2)             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */

  /* 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_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_5generator3, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_matrix_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr", __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_7iminuit_11_libiminuit_6Minuit_6matrix_5generator3(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":558
 *                 tuple(cov.get(iv1, iv2)
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)             # <<<<<<<<<<<<<<
 *             )
 *         return ret
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v2);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv2);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_iv2, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":556
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2)             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */
    __pyx_t_5 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __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;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":558
 *                 tuple(cov.get(iv1, iv2)
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)             # <<<<<<<<<<<<<<
 *             )
 *         return ret
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":556
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2)             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":536
 *         return self.merrors_struct
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """Error or correlation matrix in tuple or tuples format."""
 *         if self.last_upst is NULL:
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_correlation, PyObject *__pyx_v_skip_fixed) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *__pyx_cur_scope;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  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("matrix", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);

  /* "iminuit/_libiminuit.pyx":538
 *     def matrix(self, correlation=False, skip_fixed=True):
 *         """Error or correlation matrix in tuple or tuples format."""
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Run migrad/hesse first")
 *         if not skip_fixed:
 */
  __pyx_t_1 = ((__pyx_v_self->last_upst == NULL) != 0);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":539
 *         """Error or correlation matrix in tuple or tuples format."""
 *         if self.last_upst is NULL:
 *             raise RuntimeError("Run migrad/hesse first")             # <<<<<<<<<<<<<<
 *         if not skip_fixed:
 *             raise RuntimeError('skip_fixed=False is not supported')
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":538
 *     def matrix(self, correlation=False, skip_fixed=True):
 *         """Error or correlation matrix in tuple or tuples format."""
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Run migrad/hesse first")
 *         if not skip_fixed:
 */
  }

  /* "iminuit/_libiminuit.pyx":540
 *         if self.last_upst is NULL:
 *             raise RuntimeError("Run migrad/hesse first")
 *         if not skip_fixed:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('skip_fixed=False is not supported')
 *         if not self.last_upst.HasCovariance():
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_skip_fixed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!__pyx_t_1) != 0);
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":541
 *             raise RuntimeError("Run migrad/hesse first")
 *         if not skip_fixed:
 *             raise RuntimeError('skip_fixed=False is not supported')             # <<<<<<<<<<<<<<
 *         if not self.last_upst.HasCovariance():
 *             raise RuntimeError(
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":540
 *         if self.last_upst is NULL:
 *             raise RuntimeError("Run migrad/hesse first")
 *         if not skip_fixed:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('skip_fixed=False is not supported')
 *         if not self.last_upst.HasCovariance():
 */
  }

  /* "iminuit/_libiminuit.pyx":542
 *         if not skip_fixed:
 *             raise RuntimeError('skip_fixed=False is not supported')
 *         if not self.last_upst.HasCovariance():             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "Covariance is not valid. May be the last Hesse call failed?")
 */
  __pyx_t_3 = ((!(__pyx_v_self->last_upst->HasCovariance() != 0)) != 0);
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":543
 *             raise RuntimeError('skip_fixed=False is not supported')
 *         if not self.last_upst.HasCovariance():
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 "Covariance is not valid. May be the last Hesse call failed?")
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":542
 *         if not skip_fixed:
 *             raise RuntimeError('skip_fixed=False is not supported')
 *         if not self.last_upst.HasCovariance():             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "Covariance is not valid. May be the last Hesse call failed?")
 */
  }

  /* "iminuit/_libiminuit.pyx":546
 *                 "Covariance is not valid. May be the last Hesse call failed?")
 * 
 *         cdef MnUserCovariance cov = self.last_upst.Covariance()             # <<<<<<<<<<<<<<
 *         params = self.list_of_vary_param()
 *         if correlation:
 */
  __pyx_cur_scope->__pyx_v_cov = __pyx_v_self->last_upst->Covariance();

  /* "iminuit/_libiminuit.pyx":547
 * 
 *         cdef MnUserCovariance cov = self.last_upst.Covariance()
 *         params = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 *         if correlation:
 *             ret = tuple(
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list_of_vary_param); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_params = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":548
 *         cdef MnUserCovariance cov = self.last_upst.Covariance()
 *         params = self.list_of_vary_param()
 *         if correlation:             # <<<<<<<<<<<<<<
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_correlation); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":550
 *         if correlation:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */
    __pyx_t_2 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "iminuit/_libiminuit.pyx":549
 *         params = self.list_of_vary_param()
 *         if correlation:
 *             ret = tuple(             # <<<<<<<<<<<<<<
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))
 *                       for iv1, v1 in enumerate(params)) \
 */
    __pyx_t_4 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_ret = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":548
 *         cdef MnUserCovariance cov = self.last_upst.Covariance()
 *         params = self.list_of_vary_param()
 *         if correlation:             # <<<<<<<<<<<<<<
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2) / sqrt(cov.get(iv1, iv1) * cov.get(iv2, iv2))
 */
    goto __pyx_L6;
  }

  /* "iminuit/_libiminuit.pyx":555
 *             )
 *         else:
 *             ret = tuple(             # <<<<<<<<<<<<<<
 *                 tuple(cov.get(iv1, iv2)
 *                       for iv1, v1 in enumerate(params)) \
 */
  /*else*/ {

    /* "iminuit/_libiminuit.pyx":556
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1, iv2)             # <<<<<<<<<<<<<<
 *                       for iv1, v1 in enumerate(params)) \
 *                 for iv2, v2 in enumerate(params)
 */
    __pyx_t_4 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);

    /* "iminuit/_libiminuit.pyx":555
 *             )
 *         else:
 *             ret = tuple(             # <<<<<<<<<<<<<<
 *                 tuple(cov.get(iv1, iv2)
 *                       for iv1, v1 in enumerate(params)) \
 */
    __pyx_t_2 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_ret = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L6:;

  /* "iminuit/_libiminuit.pyx":560
 *                 for iv2, v2 in enumerate(params)
 *             )
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def print_matrix(self, **kwds):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":536
 *         return self.merrors_struct
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """Error or correlation matrix in tuple or tuples format."""
 *         if self.last_upst is NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":562
 *         return ret
 * 
 *     def print_matrix(self, **kwds):             # <<<<<<<<<<<<<<
 *         """Show error_matrix"""
 *         matrix = self.matrix(correlation=True)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_10print_matrix[] = "Minuit.print_matrix(self, **kwds)\nShow error_matrix";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_kwds = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_matrix (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("print_matrix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "print_matrix", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_kwds = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwds)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwds);
  } else {
    __pyx_v_kwds = NULL;
  }
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_10print_matrix(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_kwds);

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_10print_matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_kwds) {
  PyObject *__pyx_v_matrix = NULL;
  PyObject *__pyx_v_vnames = 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("print_matrix", 0);

  /* "iminuit/_libiminuit.pyx":564
 *     def print_matrix(self, **kwds):
 *         """Show error_matrix"""
 *         matrix = self.matrix(correlation=True)             # <<<<<<<<<<<<<<
 *         vnames = self.list_of_vary_param()
 *         self.frontend.print_matrix(vnames, matrix, **kwds)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_correlation, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_matrix = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":565
 *         """Show error_matrix"""
 *         matrix = self.matrix(correlation=True)
 *         vnames = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 *         self.frontend.print_matrix(vnames, matrix, **kwds)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list_of_vary_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_vnames = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":566
 *         matrix = self.matrix(correlation=True)
 *         vnames = self.list_of_vary_param()
 *         self.frontend.print_matrix(vnames, matrix, **kwds)             # <<<<<<<<<<<<<<
 * 
 *     def latex_matrix(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_matrix); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_vnames);
  __Pyx_GIVEREF(__pyx_v_vnames);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vnames);
  __Pyx_INCREF(__pyx_v_matrix);
  __Pyx_GIVEREF(__pyx_v_matrix);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_matrix);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_v_kwds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":562
 *         return ret
 * 
 *     def print_matrix(self, **kwds):             # <<<<<<<<<<<<<<
 *         """Show error_matrix"""
 *         matrix = self.matrix(correlation=True)
 */

  /* 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("iminuit._libiminuit.Minuit.print_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_matrix);
  __Pyx_XDECREF(__pyx_v_vnames);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":568
 *         self.frontend.print_matrix(vnames, matrix, **kwds)
 * 
 *     def latex_matrix(self):             # <<<<<<<<<<<<<<
 *         """Build :class:`LatexFactory` object with the correlation matrix
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_13latex_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_12latex_matrix[] = "Minuit.latex_matrix(self)\nBuild :class:`LatexFactory` object with the correlation matrix\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_13latex_matrix(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("latex_matrix (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_12latex_matrix(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_12latex_matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_matrix = NULL;
  PyObject *__pyx_v_vnames = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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("latex_matrix", 0);

  /* "iminuit/_libiminuit.pyx":571
 *         """Build :class:`LatexFactory` object with the correlation matrix
 *         """
 *         matrix = self.matrix(correlation=True)             # <<<<<<<<<<<<<<
 *         vnames = self.list_of_vary_param()
 *         return LatexFactory.build_matrix(vnames, matrix)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_correlation, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_matrix = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":572
 *         """
 *         matrix = self.matrix(correlation=True)
 *         vnames = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 *         return LatexFactory.build_matrix(vnames, matrix)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list_of_vary_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_vnames = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":573
 *         matrix = self.matrix(correlation=True)
 *         vnames = self.list_of_vary_param()
 *         return LatexFactory.build_matrix(vnames, matrix)             # <<<<<<<<<<<<<<
 * 
 *     def np_matrix(self, correlation=False, skip_fixed=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LatexFactory); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_build_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __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(__pyx_v_vnames);
  __Pyx_GIVEREF(__pyx_v_vnames);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_vnames);
  __Pyx_INCREF(__pyx_v_matrix);
  __Pyx_GIVEREF(__pyx_v_matrix);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_matrix);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":568
 *         self.frontend.print_matrix(vnames, matrix, **kwds)
 * 
 *     def latex_matrix(self):             # <<<<<<<<<<<<<<
 *         """Build :class:`LatexFactory` object with the correlation matrix
 *         """
 */

  /* 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("iminuit._libiminuit.Minuit.latex_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_matrix);
  __Pyx_XDECREF(__pyx_v_vnames);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":575
 *         return LatexFactory.build_matrix(vnames, matrix)
 * 
 *     def np_matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """Error or correlation matrix in numpy array format.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_15np_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_14np_matrix[] = "Minuit.np_matrix(self, correlation=False, skip_fixed=True)\nError or correlation matrix in numpy array format.\n\n        The name of this function was chosen to be analogous to :meth:`matrix`,\n        it returns the same information in a different format.\n\n        Note that a ``numpy.ndarray`` is returned, not a ``numpy.matrix``\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_15np_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_correlation = 0;
  PyObject *__pyx_v_skip_fixed = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("np_matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_correlation,&__pyx_n_s_skip_fixed,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_False);
    values[1] = ((PyObject *)Py_True);
    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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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 = PyDict_GetItem(__pyx_kwds, __pyx_n_s_correlation);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip_fixed);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "np_matrix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_correlation = values[0];
    __pyx_v_skip_fixed = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("np_matrix", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.np_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_14np_matrix(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_correlation, __pyx_v_skip_fixed);

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_14np_matrix(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_correlation, PyObject *__pyx_v_skip_fixed) {
  PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_v_matrix = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("np_matrix", 0);

  /* "iminuit/_libiminuit.pyx":583
 *         Note that a ``numpy.ndarray`` is returned, not a ``numpy.matrix``
 *         """
 *         import numpy as np             # <<<<<<<<<<<<<<
 *         matrix = self.matrix(correlation=correlation, skip_fixed=skip_fixed)
 *         return np.array(matrix, dtype=np.float64)
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":584
 *         """
 *         import numpy as np
 *         matrix = self.matrix(correlation=correlation, skip_fixed=skip_fixed)             # <<<<<<<<<<<<<<
 *         return np.array(matrix, dtype=np.float64)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_correlation, __pyx_v_correlation) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_skip_fixed, __pyx_v_skip_fixed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_matrix = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":585
 *         import numpy as np
 *         matrix = self.matrix(correlation=correlation, skip_fixed=skip_fixed)
 *         return np.array(matrix, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *     def is_fixed(self, vname):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_matrix);
  __Pyx_GIVEREF(__pyx_v_matrix);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_matrix);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":575
 *         return LatexFactory.build_matrix(vnames, matrix)
 * 
 *     def np_matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """Error or correlation matrix in numpy array format.
 * 
 */

  /* 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("iminuit._libiminuit.Minuit.np_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_matrix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":587
 *         return np.array(matrix, dtype=np.float64)
 * 
 *     def is_fixed(self, vname):             # <<<<<<<<<<<<<<
 *         """Check if variable *vname* is (initially) fixed"""
 *         if vname not in self.parameters:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_17is_fixed(PyObject *__pyx_v_self, PyObject *__pyx_v_vname); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_16is_fixed[] = "Minuit.is_fixed(self, vname)\nCheck if variable *vname* is (initially) fixed";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_17is_fixed(PyObject *__pyx_v_self, PyObject *__pyx_v_vname) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_fixed (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_16is_fixed(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_vname));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_16is_fixed(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname) {
  unsigned int __pyx_v_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_fixed", 0);

  /* "iminuit/_libiminuit.pyx":589
 *     def is_fixed(self, vname):
 *         """Check if variable *vname* is (initially) fixed"""
 *         if vname not in self.parameters:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Cannot find %s in list of variables.')
 *         cdef unsigned int index = self.var2pos[vname]
 */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_vname, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":590
 *         """Check if variable *vname* is (initially) fixed"""
 *         if vname not in self.parameters:
 *             raise RuntimeError('Cannot find %s in list of variables.')             # <<<<<<<<<<<<<<
 *         cdef unsigned int index = self.var2pos[vname]
 *         if self.last_upst is NULL:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":589
 *     def is_fixed(self, vname):
 *         """Check if variable *vname* is (initially) fixed"""
 *         if vname not in self.parameters:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Cannot find %s in list of variables.')
 *         cdef unsigned int index = self.var2pos[vname]
 */
  }

  /* "iminuit/_libiminuit.pyx":591
 *         if vname not in self.parameters:
 *             raise RuntimeError('Cannot find %s in list of variables.')
 *         cdef unsigned int index = self.var2pos[vname]             # <<<<<<<<<<<<<<
 *         if self.last_upst is NULL:
 *             return self.initialfix[vname]
 */
  __pyx_t_3 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_vname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_index = __pyx_t_4;

  /* "iminuit/_libiminuit.pyx":592
 *             raise RuntimeError('Cannot find %s in list of variables.')
 *         cdef unsigned int index = self.var2pos[vname]
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             return self.initialfix[vname]
 *         else:
 */
  __pyx_t_2 = ((__pyx_v_self->last_upst == NULL) != 0);
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":593
 *         cdef unsigned int index = self.var2pos[vname]
 *         if self.last_upst is NULL:
 *             return self.initialfix[vname]             # <<<<<<<<<<<<<<
 *         else:
 *             return self.last_upst.MinuitParameters()[index].IsFixed()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_vname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "iminuit/_libiminuit.pyx":592
 *             raise RuntimeError('Cannot find %s in list of variables.')
 *         cdef unsigned int index = self.var2pos[vname]
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             return self.initialfix[vname]
 *         else:
 */
  }

  /* "iminuit/_libiminuit.pyx":595
 *             return self.initialfix[vname]
 *         else:
 *             return self.last_upst.MinuitParameters()[index].IsFixed()             # <<<<<<<<<<<<<<
 * 
 *     def _prepare_param(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_self->last_upst->MinuitParameters()[__pyx_v_index]).IsFixed()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "iminuit/_libiminuit.pyx":587
 *         return np.array(matrix, dtype=np.float64)
 * 
 *     def is_fixed(self, vname):             # <<<<<<<<<<<<<<
 *         """Check if variable *vname* is (initially) fixed"""
 *         if vname not in self.parameters:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.is_fixed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":597
 *             return self.last_upst.MinuitParameters()[index].IsFixed()
 * 
 *     def _prepare_param(self):             # <<<<<<<<<<<<<<
 *         cdef vector[MinuitParameter] vmps = self.last_upst.MinuitParameters()
 *         cdef int i
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_19_prepare_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_18_prepare_param[] = "Minuit._prepare_param(self)";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_19_prepare_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_prepare_param (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_18_prepare_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_18_prepare_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  std::vector<MinuitParameter>  __pyx_v_vmps;
  int __pyx_v_i;
  PyObject *__pyx_v_tmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __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("_prepare_param", 0);

  /* "iminuit/_libiminuit.pyx":598
 * 
 *     def _prepare_param(self):
 *         cdef vector[MinuitParameter] vmps = self.last_upst.MinuitParameters()             # <<<<<<<<<<<<<<
 *         cdef int i
 *         tmp = []
 */
  __pyx_v_vmps = __pyx_v_self->last_upst->MinuitParameters();

  /* "iminuit/_libiminuit.pyx":600
 *         cdef vector[MinuitParameter] vmps = self.last_upst.MinuitParameters()
 *         cdef int i
 *         tmp = []             # <<<<<<<<<<<<<<
 *         for i in range(vmps.size()):
 *             tmp.append(minuitparam2struct(vmps[i]))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tmp = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":601
 *         cdef int i
 *         tmp = []
 *         for i in range(vmps.size()):             # <<<<<<<<<<<<<<
 *             tmp.append(minuitparam2struct(vmps[i]))
 *         return tmp
 */
  __pyx_t_2 = __pyx_v_vmps.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "iminuit/_libiminuit.pyx":602
 *         tmp = []
 *         for i in range(vmps.size()):
 *             tmp.append(minuitparam2struct(vmps[i]))             # <<<<<<<<<<<<<<
 *         return tmp
 * 
 */
    __pyx_t_1 = __pyx_f_7iminuit_11_libiminuit_minuitparam2struct((__pyx_v_vmps[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_tmp, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "iminuit/_libiminuit.pyx":603
 *         for i in range(vmps.size()):
 *             tmp.append(minuitparam2struct(vmps[i]))
 *         return tmp             # <<<<<<<<<<<<<<
 * 
 *     #dealing with frontend conversion
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tmp);
  __pyx_r = __pyx_v_tmp;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":597
 *             return self.last_upst.MinuitParameters()[index].IsFixed()
 * 
 *     def _prepare_param(self):             # <<<<<<<<<<<<<<
 *         cdef vector[MinuitParameter] vmps = self.last_upst.MinuitParameters()
 *         cdef int i
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._prepare_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":606
 * 
 *     #dealing with frontend conversion
 *     def print_param(self, **kwds):             # <<<<<<<<<<<<<<
 *         """Print current parameter state.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_21print_param(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_20print_param[] = "Minuit.print_param(self, **kwds)\nPrint current parameter state.\n\n        Extra keyword arguments will be passed to frontend.print_param.\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_21print_param(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_kwds = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_param (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("print_param", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "print_param", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_kwds = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwds)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwds);
  } else {
    __pyx_v_kwds = NULL;
  }
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_20print_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_kwds);

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_20print_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_kwds) {
  PyObject *__pyx_v_p = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_param", 0);

  /* "iminuit/_libiminuit.pyx":611
 *         Extra keyword arguments will be passed to frontend.print_param.
 *         """
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             self.print_initial_param(**kwds)
 *             return
 */
  __pyx_t_1 = ((__pyx_v_self->last_upst == NULL) != 0);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":612
 *         """
 *         if self.last_upst is NULL:
 *             self.print_initial_param(**kwds)             # <<<<<<<<<<<<<<
 *             return
 *         p = self._prepare_param()
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print_initial_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_v_kwds); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":613
 *         if self.last_upst is NULL:
 *             self.print_initial_param(**kwds)
 *             return             # <<<<<<<<<<<<<<
 *         p = self._prepare_param()
 *         self.frontend.print_param(p, self.merrors_struct, **kwds)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "iminuit/_libiminuit.pyx":611
 *         Extra keyword arguments will be passed to frontend.print_param.
 *         """
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             self.print_initial_param(**kwds)
 *             return
 */
  }

  /* "iminuit/_libiminuit.pyx":614
 *             self.print_initial_param(**kwds)
 *             return
 *         p = self._prepare_param()             # <<<<<<<<<<<<<<
 *         self.frontend.print_param(p, self.merrors_struct, **kwds)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prepare_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_p = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":615
 *             return
 *         p = self._prepare_param()
 *         self.frontend.print_param(p, self.merrors_struct, **kwds)             # <<<<<<<<<<<<<<
 * 
 *     def latex_param(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_param); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_p);
  __Pyx_GIVEREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_p);
  __Pyx_INCREF(__pyx_v_self->merrors_struct);
  __Pyx_GIVEREF(__pyx_v_self->merrors_struct);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->merrors_struct);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_v_kwds); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":606
 * 
 *     #dealing with frontend conversion
 *     def print_param(self, **kwds):             # <<<<<<<<<<<<<<
 *         """Print current parameter state.
 * 
 */

  /* 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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.print_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":617
 *         self.frontend.print_param(p, self.merrors_struct, **kwds)
 * 
 *     def latex_param(self):             # <<<<<<<<<<<<<<
 *         """build :class:`iminuit.latex.LatexTable` for current parameter"""
 *         p = self._prepare_param()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_23latex_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_22latex_param[] = "Minuit.latex_param(self)\nbuild :class:`iminuit.latex.LatexTable` for current parameter";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_23latex_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("latex_param (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_22latex_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_22latex_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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("latex_param", 0);

  /* "iminuit/_libiminuit.pyx":619
 *     def latex_param(self):
 *         """build :class:`iminuit.latex.LatexTable` for current parameter"""
 *         p = self._prepare_param()             # <<<<<<<<<<<<<<
 *         return LatexFactory.build_param_table(p, self.merrors_struct)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prepare_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":620
 *         """build :class:`iminuit.latex.LatexTable` for current parameter"""
 *         p = self._prepare_param()
 *         return LatexFactory.build_param_table(p, self.merrors_struct)             # <<<<<<<<<<<<<<
 * 
 *     def _prepare_initial_param(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LatexFactory); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_build_param_table); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __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(__pyx_v_p);
  __Pyx_GIVEREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_p);
  __Pyx_INCREF(__pyx_v_self->merrors_struct);
  __Pyx_GIVEREF(__pyx_v_self->merrors_struct);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_self->merrors_struct);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":617
 *         self.frontend.print_param(p, self.merrors_struct, **kwds)
 * 
 *     def latex_param(self):             # <<<<<<<<<<<<<<
 *         """build :class:`iminuit.latex.LatexTable` for current parameter"""
 *         p = self._prepare_param()
 */

  /* 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("iminuit._libiminuit.Minuit.latex_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":622
 *         return LatexFactory.build_param_table(p, self.merrors_struct)
 * 
 *     def _prepare_initial_param(self):             # <<<<<<<<<<<<<<
 *         tmp = []
 *         for i, vname in enumerate(self.parameters):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_25_prepare_initial_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_24_prepare_initial_param[] = "Minuit._prepare_initial_param(self)";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_25_prepare_initial_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_prepare_initial_param (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_24_prepare_initial_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_24_prepare_initial_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_tmp = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_vname = NULL;
  PyObject *__pyx_v_mps = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_prepare_initial_param", 0);

  /* "iminuit/_libiminuit.pyx":623
 * 
 *     def _prepare_initial_param(self):
 *         tmp = []             # <<<<<<<<<<<<<<
 *         for i, vname in enumerate(self.parameters):
 *             mps = Struct(
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tmp = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":624
 *     def _prepare_initial_param(self):
 *         tmp = []
 *         for i, vname in enumerate(self.parameters):             # <<<<<<<<<<<<<<
 *             mps = Struct(
 *                 number=i + 1,
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_self->parameters)) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_2 = __pyx_v_self->parameters; __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_self->parameters); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_vname, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":625
 *         tmp = []
 *         for i, vname in enumerate(self.parameters):
 *             mps = Struct(             # <<<<<<<<<<<<<<
 *                 number=i + 1,
 *                 name=vname,
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Struct); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);

    /* "iminuit/_libiminuit.pyx":626
 *         for i, vname in enumerate(self.parameters):
 *             mps = Struct(
 *                 number=i + 1,             # <<<<<<<<<<<<<<
 *                 name=vname,
 *                 value=self.initialvalue[vname],
 */
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_number, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":627
 *             mps = Struct(
 *                 number=i + 1,
 *                 name=vname,             # <<<<<<<<<<<<<<
 *                 value=self.initialvalue[vname],
 *                 error=self.initialerror[vname],
 */
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_v_vname) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":628
 *                 number=i + 1,
 *                 name=vname,
 *                 value=self.initialvalue[vname],             # <<<<<<<<<<<<<<
 *                 error=self.initialerror[vname],
 *                 is_const=False,
 */
    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->initialvalue, __pyx_v_vname); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":629
 *                 name=vname,
 *                 value=self.initialvalue[vname],
 *                 error=self.initialerror[vname],             # <<<<<<<<<<<<<<
 *                 is_const=False,
 *                 is_fixed=self.initialfix[vname],
 */
    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->initialerror, __pyx_v_vname); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_error, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":630
 *                 value=self.initialvalue[vname],
 *                 error=self.initialerror[vname],
 *                 is_const=False,             # <<<<<<<<<<<<<<
 *                 is_fixed=self.initialfix[vname],
 *                 has_limits=self.initiallimit[vname] is not None,
 */
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_is_const, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":631
 *                 error=self.initialerror[vname],
 *                 is_const=False,
 *                 is_fixed=self.initialfix[vname],             # <<<<<<<<<<<<<<
 *                 has_limits=self.initiallimit[vname] is not None,
 *                 lower_limit=self.initiallimit[vname][0]
 */
    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_vname); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_is_fixed, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":632
 *                 is_const=False,
 *                 is_fixed=self.initialfix[vname],
 *                 has_limits=self.initiallimit[vname] is not None,             # <<<<<<<<<<<<<<
 *                 lower_limit=self.initiallimit[vname][0]
 *                 if self.initiallimit[vname] is not None else None,
 */
    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = (__pyx_t_7 != Py_None);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_has_limits, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":634
 *                 has_limits=self.initiallimit[vname] is not None,
 *                 lower_limit=self.initiallimit[vname][0]
 *                 if self.initiallimit[vname] is not None else None,             # <<<<<<<<<<<<<<
 *                 upper_limit=self.initiallimit[vname][1]
 *                 if self.initiallimit[vname] is not None else None,
 */
    __pyx_t_9 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = (__pyx_t_9 != Py_None);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if ((__pyx_t_8 != 0)) {

      /* "iminuit/_libiminuit.pyx":633
 *                 is_fixed=self.initialfix[vname],
 *                 has_limits=self.initiallimit[vname] is not None,
 *                 lower_limit=self.initiallimit[vname][0]             # <<<<<<<<<<<<<<
 *                 if self.initiallimit[vname] is not None else None,
 *                 upper_limit=self.initiallimit[vname][1]
 */
      __pyx_t_9 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_7 = __pyx_t_10;
      __pyx_t_10 = 0;
    } else {

      /* "iminuit/_libiminuit.pyx":634
 *                 has_limits=self.initiallimit[vname] is not None,
 *                 lower_limit=self.initiallimit[vname][0]
 *                 if self.initiallimit[vname] is not None else None,             # <<<<<<<<<<<<<<
 *                 upper_limit=self.initiallimit[vname][1]
 *                 if self.initiallimit[vname] is not None else None,
 */
      __Pyx_INCREF(Py_None);
      __pyx_t_7 = Py_None;
    }
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_lower_limit, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":636
 *                 if self.initiallimit[vname] is not None else None,
 *                 upper_limit=self.initiallimit[vname][1]
 *                 if self.initiallimit[vname] is not None else None,             # <<<<<<<<<<<<<<
 *                 has_lower_limit=self.initiallimit[vname] is not None
 *                                 and self.initiallimit[vname][0] is not None,
 */
    __pyx_t_10 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = (__pyx_t_10 != Py_None);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if ((__pyx_t_8 != 0)) {

      /* "iminuit/_libiminuit.pyx":635
 *                 lower_limit=self.initiallimit[vname][0]
 *                 if self.initiallimit[vname] is not None else None,
 *                 upper_limit=self.initiallimit[vname][1]             # <<<<<<<<<<<<<<
 *                 if self.initiallimit[vname] is not None else None,
 *                 has_lower_limit=self.initiallimit[vname] is not None
 */
      __pyx_t_10 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_7 = __pyx_t_9;
      __pyx_t_9 = 0;
    } else {

      /* "iminuit/_libiminuit.pyx":636
 *                 if self.initiallimit[vname] is not None else None,
 *                 upper_limit=self.initiallimit[vname][1]
 *                 if self.initiallimit[vname] is not None else None,             # <<<<<<<<<<<<<<
 *                 has_lower_limit=self.initiallimit[vname] is not None
 *                                 and self.initiallimit[vname][0] is not None,
 */
      __Pyx_INCREF(Py_None);
      __pyx_t_7 = Py_None;
    }
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_upper_limit, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":637
 *                 upper_limit=self.initiallimit[vname][1]
 *                 if self.initiallimit[vname] is not None else None,
 *                 has_lower_limit=self.initiallimit[vname] is not None             # <<<<<<<<<<<<<<
 *                                 and self.initiallimit[vname][0] is not None,
 *                 has_upper_limit=self.initiallimit[vname] is not None
 */
    __pyx_t_9 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = (__pyx_t_9 != Py_None);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_8) {
    } else {
      __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = __pyx_t_9;
      __pyx_t_9 = 0;
      goto __pyx_L5_bool_binop_done;
    }

    /* "iminuit/_libiminuit.pyx":638
 *                 if self.initiallimit[vname] is not None else None,
 *                 has_lower_limit=self.initiallimit[vname] is not None
 *                                 and self.initiallimit[vname][0] is not None,             # <<<<<<<<<<<<<<
 *                 has_upper_limit=self.initiallimit[vname] is not None
 *                                 and self.initiallimit[vname][1] is not None
 */
    __pyx_t_9 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_8 = (__pyx_t_10 != Py_None);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_7 = __pyx_t_10;
    __pyx_t_10 = 0;
    __pyx_L5_bool_binop_done:;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_has_lower_limit, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":639
 *                 has_lower_limit=self.initiallimit[vname] is not None
 *                                 and self.initiallimit[vname][0] is not None,
 *                 has_upper_limit=self.initiallimit[vname] is not None             # <<<<<<<<<<<<<<
 *                                 and self.initiallimit[vname][1] is not None
 *             )
 */
    __pyx_t_10 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = (__pyx_t_10 != Py_None);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (__pyx_t_8) {
    } else {
      __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __pyx_t_10;
      __pyx_t_10 = 0;
      goto __pyx_L7_bool_binop_done;
    }

    /* "iminuit/_libiminuit.pyx":640
 *                                 and self.initiallimit[vname][0] is not None,
 *                 has_upper_limit=self.initiallimit[vname] is not None
 *                                 and self.initiallimit[vname][1] is not None             # <<<<<<<<<<<<<<
 *             )
 *             tmp.append(mps)
 */
    __pyx_t_10 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_8 = (__pyx_t_9 != Py_None);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = __pyx_t_9;
    __pyx_t_9 = 0;
    __pyx_L7_bool_binop_done:;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_has_upper_limit, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":625
 *         tmp = []
 *         for i, vname in enumerate(self.parameters):
 *             mps = Struct(             # <<<<<<<<<<<<<<
 *                 number=i + 1,
 *                 name=vname,
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_mps, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":642
 *                                 and self.initiallimit[vname][1] is not None
 *             )
 *             tmp.append(mps)             # <<<<<<<<<<<<<<
 *         return tmp
 * 
 */
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_tmp, __pyx_v_mps); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":624
 *     def _prepare_initial_param(self):
 *         tmp = []
 *         for i, vname in enumerate(self.parameters):             # <<<<<<<<<<<<<<
 *             mps = Struct(
 *                 number=i + 1,
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":643
 *             )
 *             tmp.append(mps)
 *         return tmp             # <<<<<<<<<<<<<<
 * 
 *     def print_initial_param(self, **kwds):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tmp);
  __pyx_r = __pyx_v_tmp;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":622
 *         return LatexFactory.build_param_table(p, self.merrors_struct)
 * 
 *     def _prepare_initial_param(self):             # <<<<<<<<<<<<<<
 *         tmp = []
 *         for i, vname in enumerate(self.parameters):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._prepare_initial_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_vname);
  __Pyx_XDECREF(__pyx_v_mps);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":645
 *         return tmp
 * 
 *     def print_initial_param(self, **kwds):             # <<<<<<<<<<<<<<
 *         """Print initial parameters"""
 *         p = self._prepare_initial_param()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_27print_initial_param(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_26print_initial_param[] = "Minuit.print_initial_param(self, **kwds)\nPrint initial parameters";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_27print_initial_param(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_kwds = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_initial_param (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("print_initial_param", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "print_initial_param", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_kwds = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwds)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwds);
  } else {
    __pyx_v_kwds = NULL;
  }
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_26print_initial_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_kwds);

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_26print_initial_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_kwds) {
  PyObject *__pyx_v_p = 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("print_initial_param", 0);

  /* "iminuit/_libiminuit.pyx":647
 *     def print_initial_param(self, **kwds):
 *         """Print initial parameters"""
 *         p = self._prepare_initial_param()             # <<<<<<<<<<<<<<
 *         self.frontend.print_param(p, {}, **kwds)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prepare_initial_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":648
 *         """Print initial parameters"""
 *         p = self._prepare_initial_param()
 *         self.frontend.print_param(p, {}, **kwds)             # <<<<<<<<<<<<<<
 * 
 *     def latex_initial_param(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_param); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_p);
  __Pyx_GIVEREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":645
 *         return tmp
 * 
 *     def print_initial_param(self, **kwds):             # <<<<<<<<<<<<<<
 *         """Print initial parameters"""
 *         p = self._prepare_initial_param()
 */

  /* 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("iminuit._libiminuit.Minuit.print_initial_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":650
 *         self.frontend.print_param(p, {}, **kwds)
 * 
 *     def latex_initial_param(self):             # <<<<<<<<<<<<<<
 *         """Build :class:`iminuit.latex.LatexTable` for initial parameter"""
 *         p = self._prepare_initial_param()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_29latex_initial_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_28latex_initial_param[] = "Minuit.latex_initial_param(self)\nBuild :class:`iminuit.latex.LatexTable` for initial parameter";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_29latex_initial_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("latex_initial_param (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_28latex_initial_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_28latex_initial_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_p = 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;
  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("latex_initial_param", 0);

  /* "iminuit/_libiminuit.pyx":652
 *     def latex_initial_param(self):
 *         """Build :class:`iminuit.latex.LatexTable` for initial parameter"""
 *         p = self._prepare_initial_param()             # <<<<<<<<<<<<<<
 *         return LatexFactory.build_param_table(p, {})
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prepare_initial_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":653
 *         """Build :class:`iminuit.latex.LatexTable` for initial parameter"""
 *         p = self._prepare_initial_param()
 *         return LatexFactory.build_param_table(p, {})             # <<<<<<<<<<<<<<
 * 
 *     def print_fmin(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LatexFactory); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_build_param_table); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __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_p);
  __Pyx_GIVEREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_p);
  __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_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":650
 *         self.frontend.print_param(p, {}, **kwds)
 * 
 *     def latex_initial_param(self):             # <<<<<<<<<<<<<<
 *         """Build :class:`iminuit.latex.LatexTable` for initial parameter"""
 *         p = self._prepare_initial_param()
 */

  /* 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("iminuit._libiminuit.Minuit.latex_initial_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":655
 *         return LatexFactory.build_param_table(p, {})
 * 
 *     def print_fmin(self):             # <<<<<<<<<<<<<<
 *         """Print current function minimum state"""
 *         #cdef MnUserParameterState ust = MnUserParameterState(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_31print_fmin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_30print_fmin[] = "Minuit.print_fmin(self)\nPrint current function minimum state";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_31print_fmin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_fmin (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_30print_fmin(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_30print_fmin(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_sfmin = NULL;
  long __pyx_v_ncalls;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_fmin", 0);

  /* "iminuit/_libiminuit.pyx":659
 *         #cdef MnUserParameterState ust = MnUserParameterState(
 *         #                               self.cfmin.UserState())
 *         if self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Function minimum has not been calculated.")
 *         sfmin = cfmin2struct(self.cfmin)
 */
  __pyx_t_1 = ((__pyx_v_self->cfmin == NULL) != 0);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":660
 *         #                               self.cfmin.UserState())
 *         if self.cfmin is NULL:
 *             raise RuntimeError("Function minimum has not been calculated.")             # <<<<<<<<<<<<<<
 *         sfmin = cfmin2struct(self.cfmin)
 *         ncalls = 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":659
 *         #cdef MnUserParameterState ust = MnUserParameterState(
 *         #                               self.cfmin.UserState())
 *         if self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Function minimum has not been calculated.")
 *         sfmin = cfmin2struct(self.cfmin)
 */
  }

  /* "iminuit/_libiminuit.pyx":661
 *         if self.cfmin is NULL:
 *             raise RuntimeError("Function minimum has not been calculated.")
 *         sfmin = cfmin2struct(self.cfmin)             # <<<<<<<<<<<<<<
 *         ncalls = 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 * 
 */
  __pyx_t_2 = __pyx_f_7iminuit_11_libiminuit_cfmin2struct(__pyx_v_self->cfmin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_sfmin = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":662
 *             raise RuntimeError("Function minimum has not been calculated.")
 *         sfmin = cfmin2struct(self.cfmin)
 *         ncalls = 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()             # <<<<<<<<<<<<<<
 * 
 *         self.frontend.print_hline()
 */
  if (((__pyx_v_self->pyfcn == NULL) != 0)) {
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = __pyx_v_self->pyfcn->getNumCall();
  }
  __pyx_v_ncalls = __pyx_t_3;

  /* "iminuit/_libiminuit.pyx":664
 *         ncalls = 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 * 
 *         self.frontend.print_hline()             # <<<<<<<<<<<<<<
 *         self.frontend.print_fmin(sfmin, self.tol, ncalls)
 *         self.print_param()
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_hline); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":665
 * 
 *         self.frontend.print_hline()
 *         self.frontend.print_fmin(sfmin, self.tol, ncalls)             # <<<<<<<<<<<<<<
 *         self.print_param()
 *         self.frontend.print_hline()
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_fmin); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->tol); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_ncalls); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(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;
    }
  }
  __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __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_INCREF(__pyx_v_sfmin);
  __Pyx_GIVEREF(__pyx_v_sfmin);
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_sfmin);
  __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_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_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":666
 *         self.frontend.print_hline()
 *         self.frontend.print_fmin(sfmin, self.tol, ncalls)
 *         self.print_param()             # <<<<<<<<<<<<<<
 *         self.frontend.print_hline()
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_print_param); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_9) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":667
 *         self.frontend.print_fmin(sfmin, self.tol, ncalls)
 *         self.print_param()
 *         self.frontend.print_hline()             # <<<<<<<<<<<<<<
 * 
 *     def print_all_minos(self):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_hline); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_9) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":655
 *         return LatexFactory.build_param_table(p, {})
 * 
 *     def print_fmin(self):             # <<<<<<<<<<<<<<
 *         """Print current function minimum state"""
 *         #cdef MnUserParameterState ust = MnUserParameterState(
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.print_fmin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sfmin);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":669
 *         self.frontend.print_hline()
 * 
 *     def print_all_minos(self):             # <<<<<<<<<<<<<<
 *         """Print all minos errors (and its states)"""
 *         for vname in self.list_of_vary_param():
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_33print_all_minos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_32print_all_minos[] = "Minuit.print_all_minos(self)\nPrint all minos errors (and its states)";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_33print_all_minos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_all_minos (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_32print_all_minos(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_32print_all_minos(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_vname = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_all_minos", 0);

  /* "iminuit/_libiminuit.pyx":671
 *     def print_all_minos(self):
 *         """Print all minos errors (and its states)"""
 *         for vname in self.list_of_vary_param():             # <<<<<<<<<<<<<<
 *             if vname in self.merrors_struct:
 *                 self.frontend.print_merror(vname, self.merrors_struct[vname])
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list_of_vary_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_vname, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":672
 *         """Print all minos errors (and its states)"""
 *         for vname in self.list_of_vary_param():
 *             if vname in self.merrors_struct:             # <<<<<<<<<<<<<<
 *                 self.frontend.print_merror(vname, self.merrors_struct[vname])
 * 
 */
    __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_vname, __pyx_v_self->merrors_struct, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (__pyx_t_7) {

      /* "iminuit/_libiminuit.pyx":673
 *         for vname in self.list_of_vary_param():
 *             if vname in self.merrors_struct:
 *                 self.frontend.print_merror(vname, self.merrors_struct[vname])             # <<<<<<<<<<<<<<
 * 
 *     def set_up(self, double errordef):
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->frontend, __pyx_n_s_print_merror); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyObject_GetItem(__pyx_v_self->merrors_struct, __pyx_v_vname); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __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_INCREF(__pyx_v_vname);
      __Pyx_GIVEREF(__pyx_v_vname);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_vname);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "iminuit/_libiminuit.pyx":672
 *         """Print all minos errors (and its states)"""
 *         for vname in self.list_of_vary_param():
 *             if vname in self.merrors_struct:             # <<<<<<<<<<<<<<
 *                 self.frontend.print_merror(vname, self.merrors_struct[vname])
 * 
 */
    }

    /* "iminuit/_libiminuit.pyx":671
 *     def print_all_minos(self):
 *         """Print all minos errors (and its states)"""
 *         for vname in self.list_of_vary_param():             # <<<<<<<<<<<<<<
 *             if vname in self.merrors_struct:
 *                 self.frontend.print_merror(vname, self.merrors_struct[vname])
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":669
 *         self.frontend.print_hline()
 * 
 *     def print_all_minos(self):             # <<<<<<<<<<<<<<
 *         """Print all minos errors (and its states)"""
 *         for vname in self.list_of_vary_param():
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.print_all_minos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":675
 *                 self.frontend.print_merror(vname, self.merrors_struct[vname])
 * 
 *     def set_up(self, double errordef):             # <<<<<<<<<<<<<<
 *         """Alias for :meth:`set_errordef`"""
 *         self.set_errordef(errordef)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_35set_up(PyObject *__pyx_v_self, PyObject *__pyx_arg_errordef); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_34set_up[] = "Minuit.set_up(self, double errordef)\nAlias for :meth:`set_errordef`";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_35set_up(PyObject *__pyx_v_self, PyObject *__pyx_arg_errordef) {
  double __pyx_v_errordef;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_up (wrapper)", 0);
  assert(__pyx_arg_errordef); {
    __pyx_v_errordef = __pyx_PyFloat_AsDouble(__pyx_arg_errordef); if (unlikely((__pyx_v_errordef == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.set_up", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_34set_up(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((double)__pyx_v_errordef));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_34set_up(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, double __pyx_v_errordef) {
  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("set_up", 0);

  /* "iminuit/_libiminuit.pyx":677
 *     def set_up(self, double errordef):
 *         """Alias for :meth:`set_errordef`"""
 *         self.set_errordef(errordef)             # <<<<<<<<<<<<<<
 * 
 *     def set_errordef(self, double errordef):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_errordef); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_errordef); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __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 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":675
 *                 self.frontend.print_merror(vname, self.merrors_struct[vname])
 * 
 *     def set_up(self, double errordef):             # <<<<<<<<<<<<<<
 *         """Alias for :meth:`set_errordef`"""
 *         self.set_errordef(errordef)
 */

  /* 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_AddTraceback("iminuit._libiminuit.Minuit.set_up", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":679
 *         self.set_errordef(errordef)
 * 
 *     def set_errordef(self, double errordef):             # <<<<<<<<<<<<<<
 *         """Set error parameter 1 for :math:`\chi^2` and 0.5 for log likelihood.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_37set_errordef(PyObject *__pyx_v_self, PyObject *__pyx_arg_errordef); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_36set_errordef[] = "Minuit.set_errordef(self, double errordef)\nSet error parameter 1 for :math:`\\chi^2` and 0.5 for log likelihood.\n\n        See page 37 of http://hep.fi.infn.it/minuit.pdf\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_37set_errordef(PyObject *__pyx_v_self, PyObject *__pyx_arg_errordef) {
  double __pyx_v_errordef;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_errordef (wrapper)", 0);
  assert(__pyx_arg_errordef); {
    __pyx_v_errordef = __pyx_PyFloat_AsDouble(__pyx_arg_errordef); if (unlikely((__pyx_v_errordef == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.set_errordef", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_36set_errordef(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((double)__pyx_v_errordef));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_36set_errordef(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, double __pyx_v_errordef) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("set_errordef", 0);

  /* "iminuit/_libiminuit.pyx":687
 *         # It was this before, but that is currently broken.
 *         # http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/node31.html
 *         self.errordef = errordef             # <<<<<<<<<<<<<<
 *         if self.pyfcn is not NULL:
 *             self.pyfcn.set_up(errordef)
 */
  __pyx_v_self->errordef = __pyx_v_errordef;

  /* "iminuit/_libiminuit.pyx":688
 *         # http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/node31.html
 *         self.errordef = errordef
 *         if self.pyfcn is not NULL:             # <<<<<<<<<<<<<<
 *             self.pyfcn.set_up(errordef)
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->pyfcn != NULL) != 0);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":689
 *         self.errordef = errordef
 *         if self.pyfcn is not NULL:
 *             self.pyfcn.set_up(errordef)             # <<<<<<<<<<<<<<
 * 
 *     def set_strategy(self, value):
 */
    __pyx_v_self->pyfcn->set_up(__pyx_v_errordef);

    /* "iminuit/_libiminuit.pyx":688
 *         # http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/node31.html
 *         self.errordef = errordef
 *         if self.pyfcn is not NULL:             # <<<<<<<<<<<<<<
 *             self.pyfcn.set_up(errordef)
 * 
 */
  }

  /* "iminuit/_libiminuit.pyx":679
 *         self.set_errordef(errordef)
 * 
 *     def set_errordef(self, double errordef):             # <<<<<<<<<<<<<<
 *         """Set error parameter 1 for :math:`\chi^2` and 0.5 for log likelihood.
 * 
 */

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

/* "iminuit/_libiminuit.pyx":691
 *             self.pyfcn.set_up(errordef)
 * 
 *     def set_strategy(self, value):             # <<<<<<<<<<<<<<
 *         """Set strategy.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_39set_strategy(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_38set_strategy[] = "Minuit.set_strategy(self, value)\nSet strategy.\n\n        - 0 = fast\n        - 1 = default\n        - 2 = slow but accurate\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_39set_strategy(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_strategy (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_38set_strategy(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_38set_strategy(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_strategy", 0);

  /* "iminuit/_libiminuit.pyx":698
 *         - 2 = slow but accurate
 *         """
 *         self.strategy = value             # <<<<<<<<<<<<<<
 * 
 *     def set_print_level(self, lvl):
 */
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->strategy = __pyx_t_1;

  /* "iminuit/_libiminuit.pyx":691
 *             self.pyfcn.set_up(errordef)
 * 
 *     def set_strategy(self, value):             # <<<<<<<<<<<<<<
 *         """Set strategy.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.set_strategy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":700
 *         self.strategy = value
 * 
 *     def set_print_level(self, lvl):             # <<<<<<<<<<<<<<
 *         """Set print level.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_41set_print_level(PyObject *__pyx_v_self, PyObject *__pyx_v_lvl); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_40set_print_level[] = "Minuit.set_print_level(self, lvl)\nSet print level.\n\n        - 0 quiet\n        - 1 normal\n        - 2 paranoid\n        - 3 really paranoid\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_41set_print_level(PyObject *__pyx_v_self, PyObject *__pyx_v_lvl) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_print_level (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_40set_print_level(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_lvl));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_40set_print_level(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_lvl) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_print_level", 0);

  /* "iminuit/_libiminuit.pyx":708
 *         - 3 really paranoid
 *         """
 *         self.print_level = lvl             # <<<<<<<<<<<<<<
 *         set_migrad_print_level(lvl)
 * 
 */
  __Pyx_INCREF(__pyx_v_lvl);
  __Pyx_GIVEREF(__pyx_v_lvl);
  __Pyx_GOTREF(__pyx_v_self->print_level);
  __Pyx_DECREF(__pyx_v_self->print_level);
  __pyx_v_self->print_level = __pyx_v_lvl;

  /* "iminuit/_libiminuit.pyx":709
 *         """
 *         self.print_level = lvl
 *         set_migrad_print_level(lvl)             # <<<<<<<<<<<<<<
 * 
 *     def get_fmin(self):
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_lvl); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  VariableMetricBuilder::setPrintLevel(__pyx_t_1);

  /* "iminuit/_libiminuit.pyx":700
 *         self.strategy = value
 * 
 *     def set_print_level(self, lvl):             # <<<<<<<<<<<<<<
 *         """Set print level.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.set_print_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":711
 *         set_migrad_print_level(lvl)
 * 
 *     def get_fmin(self):             # <<<<<<<<<<<<<<
 *         """Current FunctionMinimum Struct"""
 *         return cfmin2struct(self.cfmin) if self.cfmin is not NULL else None
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_43get_fmin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_42get_fmin[] = "Minuit.get_fmin(self)\nCurrent FunctionMinimum Struct";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_43get_fmin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fmin (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_42get_fmin(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_42get_fmin(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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("get_fmin", 0);

  /* "iminuit/_libiminuit.pyx":713
 *     def get_fmin(self):
 *         """Current FunctionMinimum Struct"""
 *         return cfmin2struct(self.cfmin) if self.cfmin is not NULL else None             # <<<<<<<<<<<<<<
 * 
 *     # Expose internal state using various structs
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->cfmin != NULL) != 0)) {
    __pyx_t_2 = __pyx_f_7iminuit_11_libiminuit_cfmin2struct(__pyx_v_self->cfmin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":711
 *         set_migrad_print_level(lvl)
 * 
 *     def get_fmin(self):             # <<<<<<<<<<<<<<
 *         """Current FunctionMinimum Struct"""
 *         return cfmin2struct(self.cfmin) if self.cfmin is not NULL else None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.get_fmin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":717
 *     # Expose internal state using various structs
 * 
 *     def get_param_states(self):             # <<<<<<<<<<<<<<
 *         """List of current MinuitParameter Struct for all parameters"""
 *         if self.last_upst is NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_45get_param_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_44get_param_states[] = "Minuit.get_param_states(self)\nList of current MinuitParameter Struct for all parameters";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_45get_param_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_param_states (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_44get_param_states(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_44get_param_states(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  std::vector<MinuitParameter>  __pyx_v_vmps;
  int __pyx_v_i;
  PyObject *__pyx_v_ret = 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;
  size_t __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("get_param_states", 0);

  /* "iminuit/_libiminuit.pyx":719
 *     def get_param_states(self):
 *         """List of current MinuitParameter Struct for all parameters"""
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             return self.get_initial_param_state()
 *         cdef vector[MinuitParameter] vmps = self.last_upst.MinuitParameters()
 */
  __pyx_t_1 = ((__pyx_v_self->last_upst == NULL) != 0);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":720
 *         """List of current MinuitParameter Struct for all parameters"""
 *         if self.last_upst is NULL:
 *             return self.get_initial_param_state()             # <<<<<<<<<<<<<<
 *         cdef vector[MinuitParameter] vmps = self.last_upst.MinuitParameters()
 *         cdef int i
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_initial_param_state); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __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;

    /* "iminuit/_libiminuit.pyx":719
 *     def get_param_states(self):
 *         """List of current MinuitParameter Struct for all parameters"""
 *         if self.last_upst is NULL:             # <<<<<<<<<<<<<<
 *             return self.get_initial_param_state()
 *         cdef vector[MinuitParameter] vmps = self.last_upst.MinuitParameters()
 */
  }

  /* "iminuit/_libiminuit.pyx":721
 *         if self.last_upst is NULL:
 *             return self.get_initial_param_state()
 *         cdef vector[MinuitParameter] vmps = self.last_upst.MinuitParameters()             # <<<<<<<<<<<<<<
 *         cdef int i
 *         ret = []
 */
  __pyx_v_vmps = __pyx_v_self->last_upst->MinuitParameters();

  /* "iminuit/_libiminuit.pyx":723
 *         cdef vector[MinuitParameter] vmps = self.last_upst.MinuitParameters()
 *         cdef int i
 *         ret = []             # <<<<<<<<<<<<<<
 *         for i in range(vmps.size()):
 *             ret.append(minuitparam2struct(vmps[i]))
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ret = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":724
 *         cdef int i
 *         ret = []
 *         for i in range(vmps.size()):             # <<<<<<<<<<<<<<
 *             ret.append(minuitparam2struct(vmps[i]))
 *         return ret
 */
  __pyx_t_5 = __pyx_v_vmps.size();
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "iminuit/_libiminuit.pyx":725
 *         ret = []
 *         for i in range(vmps.size()):
 *             ret.append(minuitparam2struct(vmps[i]))             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __pyx_t_2 = __pyx_f_7iminuit_11_libiminuit_minuitparam2struct((__pyx_v_vmps[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "iminuit/_libiminuit.pyx":726
 *         for i in range(vmps.size()):
 *             ret.append(minuitparam2struct(vmps[i]))
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def get_merrors(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":717
 *     # Expose internal state using various structs
 * 
 *     def get_param_states(self):             # <<<<<<<<<<<<<<
 *         """List of current MinuitParameter Struct for all parameters"""
 *         if self.last_upst is NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.get_param_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":728
 *         return ret
 * 
 *     def get_merrors(self):             # <<<<<<<<<<<<<<
 *         """Dictionary of varname-> MinosError Struct"""
 *         return self.merrors_struct
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_47get_merrors(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_46get_merrors[] = "Minuit.get_merrors(self)\nDictionary of varname-> MinosError Struct";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_47get_merrors(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_merrors (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_46get_merrors(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_46get_merrors(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_merrors", 0);

  /* "iminuit/_libiminuit.pyx":730
 *     def get_merrors(self):
 *         """Dictionary of varname-> MinosError Struct"""
 *         return self.merrors_struct             # <<<<<<<<<<<<<<
 * 
 *     def get_initial_param_state(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->merrors_struct);
  __pyx_r = __pyx_v_self->merrors_struct;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":728
 *         return ret
 * 
 *     def get_merrors(self):             # <<<<<<<<<<<<<<
 *         """Dictionary of varname-> MinosError Struct"""
 *         return self.merrors_struct
 */

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

/* "iminuit/_libiminuit.pyx":732
 *         return self.merrors_struct
 * 
 *     def get_initial_param_state(self):             # <<<<<<<<<<<<<<
 *         """Initial setting in form of MinuitParameter Struct"""
 *         raise NotImplementedError
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_49get_initial_param_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_48get_initial_param_state[] = "Minuit.get_initial_param_state(self)\nInitial setting in form of MinuitParameter Struct";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_49get_initial_param_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_initial_param_state (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_48get_initial_param_state(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_48get_initial_param_state(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_initial_param_state", 0);

  /* "iminuit/_libiminuit.pyx":734
 *     def get_initial_param_state(self):
 *         """Initial setting in form of MinuitParameter Struct"""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def get_num_call_fcn(self):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "iminuit/_libiminuit.pyx":732
 *         return self.merrors_struct
 * 
 *     def get_initial_param_state(self):             # <<<<<<<<<<<<<<
 *         """Initial setting in form of MinuitParameter Struct"""
 *         raise NotImplementedError
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.get_initial_param_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":736
 *         raise NotImplementedError
 * 
 *     def get_num_call_fcn(self):             # <<<<<<<<<<<<<<
 *         """Total number of calls to FCN (not just the last operation)"""
 *         return 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_51get_num_call_fcn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_50get_num_call_fcn[] = "Minuit.get_num_call_fcn(self)\nTotal number of calls to FCN (not just the last operation)";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_51get_num_call_fcn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_num_call_fcn (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_50get_num_call_fcn(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_50get_num_call_fcn(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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("get_num_call_fcn", 0);

  /* "iminuit/_libiminuit.pyx":738
 *     def get_num_call_fcn(self):
 *         """Total number of calls to FCN (not just the last operation)"""
 *         return 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()             # <<<<<<<<<<<<<<
 * 
 *     def migrad_ok(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->pyfcn == NULL) != 0)) {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_1 = __pyx_int_0;
  } else {
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->pyfcn->getNumCall()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":736
 *         raise NotImplementedError
 * 
 *     def get_num_call_fcn(self):             # <<<<<<<<<<<<<<
 *         """Total number of calls to FCN (not just the last operation)"""
 *         return 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.get_num_call_fcn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":740
 *         return 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 * 
 *     def migrad_ok(self):             # <<<<<<<<<<<<<<
 *         """Check if minimum is valid"""
 *         return self.cfmin is not NULL and self.cfmin.IsValid()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_53migrad_ok(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_52migrad_ok[] = "Minuit.migrad_ok(self)\nCheck if minimum is valid";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_53migrad_ok(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("migrad_ok (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_52migrad_ok(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_52migrad_ok(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("migrad_ok", 0);

  /* "iminuit/_libiminuit.pyx":742
 *     def migrad_ok(self):
 *         """Check if minimum is valid"""
 *         return self.cfmin is not NULL and self.cfmin.IsValid()             # <<<<<<<<<<<<<<
 * 
 *     def matrix_accurate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__pyx_v_self->cfmin != NULL);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __pyx_v_self->cfmin->IsValid();
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":740
 *         return 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 * 
 *     def migrad_ok(self):             # <<<<<<<<<<<<<<
 *         """Check if minimum is valid"""
 *         return self.cfmin is not NULL and self.cfmin.IsValid()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.migrad_ok", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":744
 *         return self.cfmin is not NULL and self.cfmin.IsValid()
 * 
 *     def matrix_accurate(self):             # <<<<<<<<<<<<<<
 *         """Check if covariance (of the last migrad) is accurate"""
 *         return self.last_upst is not NULL and \
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_55matrix_accurate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_54matrix_accurate[] = "Minuit.matrix_accurate(self)\nCheck if covariance (of the last migrad) is accurate";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_55matrix_accurate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix_accurate (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_54matrix_accurate(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_54matrix_accurate(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix_accurate", 0);

  /* "iminuit/_libiminuit.pyx":746
 *     def matrix_accurate(self):
 *         """Check if covariance (of the last migrad) is accurate"""
 *         return self.last_upst is not NULL and \             # <<<<<<<<<<<<<<
 *                self.cfmin is not NULL and \
 *                self.cfmin.HasAccurateCovar()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__pyx_v_self->last_upst != NULL);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "iminuit/_libiminuit.pyx":747
 *         """Check if covariance (of the last migrad) is accurate"""
 *         return self.last_upst is not NULL and \
 *                self.cfmin is not NULL and \             # <<<<<<<<<<<<<<
 *                self.cfmin.HasAccurateCovar()
 * 
 */
  __pyx_t_2 = (__pyx_v_self->cfmin != NULL);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "iminuit/_libiminuit.pyx":748
 *         return self.last_upst is not NULL and \
 *                self.cfmin is not NULL and \
 *                self.cfmin.HasAccurateCovar()             # <<<<<<<<<<<<<<
 * 
 *     def list_of_fixed_param(self):
 */
  __pyx_t_2 = __pyx_v_self->cfmin->HasAccurateCovar();
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":744
 *         return self.cfmin is not NULL and self.cfmin.IsValid()
 * 
 *     def matrix_accurate(self):             # <<<<<<<<<<<<<<
 *         """Check if covariance (of the last migrad) is accurate"""
 *         return self.last_upst is not NULL and \
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix_accurate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":750
 *                self.cfmin.HasAccurateCovar()
 * 
 *     def list_of_fixed_param(self):             # <<<<<<<<<<<<<<
 *         """List of (initially) fixed parameters"""
 *         return [v for v in self.parameters if self.initialfix[v]]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_57list_of_fixed_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_56list_of_fixed_param[] = "Minuit.list_of_fixed_param(self)\nList of (initially) fixed parameters";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_57list_of_fixed_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_of_fixed_param (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_56list_of_fixed_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_56list_of_fixed_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_of_fixed_param", 0);

  /* "iminuit/_libiminuit.pyx":752
 *     def list_of_fixed_param(self):
 *         """List of (initially) fixed parameters"""
 *         return [v for v in self.parameters if self.initialfix[v]]             # <<<<<<<<<<<<<<
 * 
 *     def list_of_vary_param(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_v_self->parameters)) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_2 = __pyx_v_self->parameters; __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_self->parameters); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_v); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":750
 *                self.cfmin.HasAccurateCovar()
 * 
 *     def list_of_fixed_param(self):             # <<<<<<<<<<<<<<
 *         """List of (initially) fixed parameters"""
 *         return [v for v in self.parameters if self.initialfix[v]]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.list_of_fixed_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":754
 *         return [v for v in self.parameters if self.initialfix[v]]
 * 
 *     def list_of_vary_param(self):             # <<<<<<<<<<<<<<
 *         """List of (initially) float varying parameters"""
 *         return [v for v in self.parameters if not self.initialfix[v]]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_59list_of_vary_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_58list_of_vary_param[] = "Minuit.list_of_vary_param(self)\nList of (initially) float varying parameters";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_59list_of_vary_param(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_of_vary_param (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_58list_of_vary_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_58list_of_vary_param(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_of_vary_param", 0);

  /* "iminuit/_libiminuit.pyx":756
 *     def list_of_vary_param(self):
 *         """List of (initially) float varying parameters"""
 *         return [v for v in self.parameters if not self.initialfix[v]]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_v_self->parameters)) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_2 = __pyx_v_self->parameters; __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_self->parameters); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_v); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = ((!__pyx_t_6) != 0);
    if (__pyx_t_7) {
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":754
 *         return [v for v in self.parameters if self.initialfix[v]]
 * 
 *     def list_of_vary_param(self):             # <<<<<<<<<<<<<<
 *         """List of (initially) float varying parameters"""
 *         return [v for v in self.parameters if not self.initialfix[v]]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.list_of_vary_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":761
 *     # Various utility functions
 * 
 *     cdef construct_FCN(self):             # <<<<<<<<<<<<<<
 *         """Construct or re-construct FCN"""
 *         del self.pyfcn
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_6Minuit_construct_FCN(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::string>  __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("construct_FCN", 0);

  /* "iminuit/_libiminuit.pyx":763
 *     cdef construct_FCN(self):
 *         """Construct or re-construct FCN"""
 *         del self.pyfcn             # <<<<<<<<<<<<<<
 *         self.pyfcn = new PythonFCN(
 *             self.fcn,
 */
  delete __pyx_v_self->pyfcn;

  /* "iminuit/_libiminuit.pyx":765
 *         del self.pyfcn
 *         self.pyfcn = new PythonFCN(
 *             self.fcn,             # <<<<<<<<<<<<<<
 *             self.errordef,
 *             self.parameters,
 */
  __pyx_t_1 = __pyx_v_self->fcn;
  __Pyx_INCREF(__pyx_t_1);

  /* "iminuit/_libiminuit.pyx":767
 *             self.fcn,
 *             self.errordef,
 *             self.parameters,             # <<<<<<<<<<<<<<
 *             self.throw_nan)
 * 
 */
  __pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_v_self->parameters); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "iminuit/_libiminuit.pyx":764
 *         """Construct or re-construct FCN"""
 *         del self.pyfcn
 *         self.pyfcn = new PythonFCN(             # <<<<<<<<<<<<<<
 *             self.fcn,
 *             self.errordef,
 */
  __pyx_v_self->pyfcn = new PythonFCN(__pyx_t_1, __pyx_v_self->errordef, __pyx_t_2, __pyx_v_self->throw_nan);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":761
 *     # Various utility functions
 * 
 *     cdef construct_FCN(self):             # <<<<<<<<<<<<<<
 *         """Construct or re-construct FCN"""
 *         del self.pyfcn
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.construct_FCN", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":770
 *             self.throw_nan)
 * 
 *     def is_clean_state(self):             # <<<<<<<<<<<<<<
 *         """Check if minuit is in a clean state, ie. no migrad call"""
 *         return self.pyfcn is NULL and \
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_61is_clean_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_60is_clean_state[] = "Minuit.is_clean_state(self)\nCheck if minuit is in a clean state, ie. no migrad call";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_61is_clean_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_clean_state (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_60is_clean_state(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_60is_clean_state(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_clean_state", 0);

  /* "iminuit/_libiminuit.pyx":772
 *     def is_clean_state(self):
 *         """Check if minuit is in a clean state, ie. no migrad call"""
 *         return self.pyfcn is NULL and \             # <<<<<<<<<<<<<<
 *                self.minimizer is NULL and self.cfmin is NULL
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__pyx_v_self->pyfcn == NULL);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "iminuit/_libiminuit.pyx":773
 *         """Check if minuit is in a clean state, ie. no migrad call"""
 *         return self.pyfcn is NULL and \
 *                self.minimizer is NULL and self.cfmin is NULL             # <<<<<<<<<<<<<<
 * 
 *     cdef void clear_cobj(self):
 */
  __pyx_t_2 = (__pyx_v_self->minimizer == NULL);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->cfmin == NULL);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":770
 *             self.throw_nan)
 * 
 *     def is_clean_state(self):             # <<<<<<<<<<<<<<
 *         """Check if minuit is in a clean state, ie. no migrad call"""
 *         return self.pyfcn is NULL and \
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.is_clean_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":775
 *                self.minimizer is NULL and self.cfmin is NULL
 * 
 *     cdef void clear_cobj(self):             # <<<<<<<<<<<<<<
 *         #clear C++ internal state
 *         del self.pyfcn;
 */

static void __pyx_f_7iminuit_11_libiminuit_6Minuit_clear_cobj(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_cobj", 0);

  /* "iminuit/_libiminuit.pyx":777
 *     cdef void clear_cobj(self):
 *         #clear C++ internal state
 *         del self.pyfcn;             # <<<<<<<<<<<<<<
 *         self.pyfcn = NULL
 *         del self.minimizer;
 */
  delete __pyx_v_self->pyfcn;

  /* "iminuit/_libiminuit.pyx":778
 *         #clear C++ internal state
 *         del self.pyfcn;
 *         self.pyfcn = NULL             # <<<<<<<<<<<<<<
 *         del self.minimizer;
 *         self.minimizer = NULL
 */
  __pyx_v_self->pyfcn = NULL;

  /* "iminuit/_libiminuit.pyx":779
 *         del self.pyfcn;
 *         self.pyfcn = NULL
 *         del self.minimizer;             # <<<<<<<<<<<<<<
 *         self.minimizer = NULL
 *         del self.cfmin;
 */
  delete __pyx_v_self->minimizer;

  /* "iminuit/_libiminuit.pyx":780
 *         self.pyfcn = NULL
 *         del self.minimizer;
 *         self.minimizer = NULL             # <<<<<<<<<<<<<<
 *         del self.cfmin;
 *         self.cfmin = NULL
 */
  __pyx_v_self->minimizer = NULL;

  /* "iminuit/_libiminuit.pyx":781
 *         del self.minimizer;
 *         self.minimizer = NULL
 *         del self.cfmin;             # <<<<<<<<<<<<<<
 *         self.cfmin = NULL
 *         del self.last_upst;
 */
  delete __pyx_v_self->cfmin;

  /* "iminuit/_libiminuit.pyx":782
 *         self.minimizer = NULL
 *         del self.cfmin;
 *         self.cfmin = NULL             # <<<<<<<<<<<<<<
 *         del self.last_upst;
 *         self.last_upst = NULL
 */
  __pyx_v_self->cfmin = NULL;

  /* "iminuit/_libiminuit.pyx":783
 *         del self.cfmin;
 *         self.cfmin = NULL
 *         del self.last_upst;             # <<<<<<<<<<<<<<
 *         self.last_upst = NULL
 * 
 */
  delete __pyx_v_self->last_upst;

  /* "iminuit/_libiminuit.pyx":784
 *         self.cfmin = NULL
 *         del self.last_upst;
 *         self.last_upst = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->last_upst = NULL;

  /* "iminuit/_libiminuit.pyx":775
 *                self.minimizer is NULL and self.cfmin is NULL
 * 
 *     cdef void clear_cobj(self):             # <<<<<<<<<<<<<<
 *         #clear C++ internal state
 *         del self.pyfcn;
 */

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

/* "iminuit/_libiminuit.pyx":786
 *         self.last_upst = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.clear_cobj()
 * 
 */

/* Python wrapper */
static void __pyx_pw_7iminuit_11_libiminuit_6Minuit_63__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7iminuit_11_libiminuit_6Minuit_63__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7iminuit_11_libiminuit_6Minuit_62__dealloc__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static void __pyx_pf_7iminuit_11_libiminuit_6Minuit_62__dealloc__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "iminuit/_libiminuit.pyx":787
 * 
 *     def __dealloc__(self):
 *         self.clear_cobj()             # <<<<<<<<<<<<<<
 * 
 *     def pedantic(self, kwds):
 */
  ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->clear_cobj(__pyx_v_self);

  /* "iminuit/_libiminuit.pyx":786
 *         self.last_upst = NULL
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.clear_cobj()
 * 
 */

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

/* "iminuit/_libiminuit.pyx":789
 *         self.clear_cobj()
 * 
 *     def pedantic(self, kwds):             # <<<<<<<<<<<<<<
 *         for vn in self.parameters:
 *             if vn not in kwds:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_65pedantic(PyObject *__pyx_v_self, PyObject *__pyx_v_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_64pedantic[] = "Minuit.pedantic(self, kwds)";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_65pedantic(PyObject *__pyx_v_self, PyObject *__pyx_v_kwds) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pedantic (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_64pedantic(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_kwds));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_64pedantic(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_kwds) {
  PyObject *__pyx_v_vn = NULL;
  PyObject *__pyx_v_vlim = NULL;
  PyObject *__pyx_v_vfix = NULL;
  PyObject *__pyx_v_verr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pedantic", 0);

  /* "iminuit/_libiminuit.pyx":790
 * 
 *     def pedantic(self, kwds):
 *         for vn in self.parameters:             # <<<<<<<<<<<<<<
 *             if vn not in kwds:
 *                 warn(('Parameter %s does not have initial value. '
 */
  if (likely(PyList_CheckExact(__pyx_v_self->parameters)) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_1 = __pyx_v_self->parameters; __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_self->parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_vn, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":791
 *     def pedantic(self, kwds):
 *         for vn in self.parameters:
 *             if vn not in kwds:             # <<<<<<<<<<<<<<
 *                 warn(('Parameter %s does not have initial value. '
 *                       'Assume 0.') % (vn), InitialParamWarning)
 */
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_vn, __pyx_v_kwds, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "iminuit/_libiminuit.pyx":792
 *         for vn in self.parameters:
 *             if vn not in kwds:
 *                 warn(('Parameter %s does not have initial value. '             # <<<<<<<<<<<<<<
 *                       'Assume 0.') % (vn), InitialParamWarning)
 *             if 'error_' + vn not in kwds and 'fix_' + param_name(vn) not in kwds:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);

      /* "iminuit/_libiminuit.pyx":793
 *             if vn not in kwds:
 *                 warn(('Parameter %s does not have initial value. '
 *                       'Assume 0.') % (vn), InitialParamWarning)             # <<<<<<<<<<<<<<
 *             if 'error_' + vn not in kwds and 'fix_' + param_name(vn) not in kwds:
 *                 warn(('Parameter %s is floating but does not '
 */
      __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_Parameter_s_does_not_have_initia, __pyx_v_vn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_InitialParamWarning); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_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_8);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_9);
      __pyx_t_8 = 0;
      __pyx_t_9 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "iminuit/_libiminuit.pyx":791
 *     def pedantic(self, kwds):
 *         for vn in self.parameters:
 *             if vn not in kwds:             # <<<<<<<<<<<<<<
 *                 warn(('Parameter %s does not have initial value. '
 *                       'Assume 0.') % (vn), InitialParamWarning)
 */
    }

    /* "iminuit/_libiminuit.pyx":794
 *                 warn(('Parameter %s does not have initial value. '
 *                       'Assume 0.') % (vn), InitialParamWarning)
 *             if 'error_' + vn not in kwds and 'fix_' + param_name(vn) not in kwds:             # <<<<<<<<<<<<<<
 *                 warn(('Parameter %s is floating but does not '
 *                       'have initial step size. Assume 1.') % (vn),
 */
    __pyx_t_4 = PyNumber_Add(__pyx_n_u_error_2, __pyx_v_vn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_kwds, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = (__pyx_t_5 != 0);
    if (__pyx_t_13) {
    } else {
      __pyx_t_6 = __pyx_t_13;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_param_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_12) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_vn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL;
      __Pyx_INCREF(__pyx_v_vn);
      __Pyx_GIVEREF(__pyx_v_vn);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_vn);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_n_u_fix, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_v_kwds, Py_NE)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = (__pyx_t_13 != 0);
    __pyx_t_6 = __pyx_t_5;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_6) {

      /* "iminuit/_libiminuit.pyx":795
 *                       'Assume 0.') % (vn), InitialParamWarning)
 *             if 'error_' + vn not in kwds and 'fix_' + param_name(vn) not in kwds:
 *                 warn(('Parameter %s is floating but does not '             # <<<<<<<<<<<<<<
 *                       'have initial step size. Assume 1.') % (vn),
 *                      InitialParamWarning)
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "iminuit/_libiminuit.pyx":796
 *             if 'error_' + vn not in kwds and 'fix_' + param_name(vn) not in kwds:
 *                 warn(('Parameter %s is floating but does not '
 *                       'have initial step size. Assume 1.') % (vn),             # <<<<<<<<<<<<<<
 *                      InitialParamWarning)
 *         for vlim in extract_limit(kwds):
 */
      __pyx_t_9 = PyUnicode_Format(__pyx_kp_u_Parameter_s_is_floating_but_does, __pyx_v_vn); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);

      /* "iminuit/_libiminuit.pyx":797
 *                 warn(('Parameter %s is floating but does not '
 *                       'have initial step size. Assume 1.') % (vn),
 *                      InitialParamWarning)             # <<<<<<<<<<<<<<
 *         for vlim in extract_limit(kwds):
 *             if param_name(vlim) not in self.parameters:
 */
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_InitialParamWarning); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_8 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && 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_11 = 1;
        }
      }
      __pyx_t_10 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __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_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_11, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_11, __pyx_t_12);
      __pyx_t_9 = 0;
      __pyx_t_12 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "iminuit/_libiminuit.pyx":794
 *                 warn(('Parameter %s does not have initial value. '
 *                       'Assume 0.') % (vn), InitialParamWarning)
 *             if 'error_' + vn not in kwds and 'fix_' + param_name(vn) not in kwds:             # <<<<<<<<<<<<<<
 *                 warn(('Parameter %s is floating but does not '
 *                       'have initial step size. Assume 1.') % (vn),
 */
    }

    /* "iminuit/_libiminuit.pyx":790
 * 
 *     def pedantic(self, kwds):
 *         for vn in self.parameters:             # <<<<<<<<<<<<<<
 *             if vn not in kwds:
 *                 warn(('Parameter %s does not have initial value. '
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":798
 *                       'have initial step size. Assume 1.') % (vn),
 *                      InitialParamWarning)
 *         for vlim in extract_limit(kwds):             # <<<<<<<<<<<<<<
 *             if param_name(vlim) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. '
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_extract_limit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_kwds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_kwds);
    __Pyx_GIVEREF(__pyx_v_kwds);
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_kwds);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_3(__pyx_t_7);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_vlim, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":799
 *                      InitialParamWarning)
 *         for vlim in extract_limit(kwds):
 *             if param_name(vlim) not in self.parameters:             # <<<<<<<<<<<<<<
 *                 warn(('%s is given. But there is no parameter %s. '
 *                       'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 */
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_param_name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_vlim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_vlim);
      __Pyx_GIVEREF(__pyx_v_vlim);
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_vlim);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (__pyx_t_5) {

      /* "iminuit/_libiminuit.pyx":800
 *         for vlim in extract_limit(kwds):
 *             if param_name(vlim) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. '             # <<<<<<<<<<<<<<
 *                       'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 *         for vfix in extract_fix(kwds):
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);

      /* "iminuit/_libiminuit.pyx":801
 *             if param_name(vlim) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. '
 *                       'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))             # <<<<<<<<<<<<<<
 *         for vfix in extract_fix(kwds):
 *             if param_name(vfix) not in self.parameters:
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_param_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_vlim); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_vlim);
        __Pyx_GIVEREF(__pyx_v_vlim);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_vlim);
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_vlim);
      __Pyx_GIVEREF(__pyx_v_vlim);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_vlim);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = PyUnicode_Format(__pyx_kp_u_s_is_given_But_there_is_no_para, __pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InitialParamWarning); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "iminuit/_libiminuit.pyx":800
 *         for vlim in extract_limit(kwds):
 *             if param_name(vlim) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. '             # <<<<<<<<<<<<<<
 *                       'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 *         for vfix in extract_fix(kwds):
 */
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4);
      __pyx_t_12 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "iminuit/_libiminuit.pyx":799
 *                      InitialParamWarning)
 *         for vlim in extract_limit(kwds):
 *             if param_name(vlim) not in self.parameters:             # <<<<<<<<<<<<<<
 *                 warn(('%s is given. But there is no parameter %s. '
 *                       'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 */
    }

    /* "iminuit/_libiminuit.pyx":798
 *                       'have initial step size. Assume 1.') % (vn),
 *                      InitialParamWarning)
 *         for vlim in extract_limit(kwds):             # <<<<<<<<<<<<<<
 *             if param_name(vlim) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. '
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "iminuit/_libiminuit.pyx":802
 *                 warn(('%s is given. But there is no parameter %s. '
 *                       'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 *         for vfix in extract_fix(kwds):             # <<<<<<<<<<<<<<
 *             if param_name(vfix) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. \
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_extract_fix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_10) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_kwds); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
    __Pyx_INCREF(__pyx_v_kwds);
    __Pyx_GIVEREF(__pyx_v_kwds);
    PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_kwds);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  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_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_vfix, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":803
 *                       'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 *         for vfix in extract_fix(kwds):
 *             if param_name(vfix) not in self.parameters:             # <<<<<<<<<<<<<<
 *                 warn(('%s is given. But there is no parameter %s. \
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 */
    __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_param_name); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    if (!__pyx_t_10) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_vfix); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL;
      __Pyx_INCREF(__pyx_v_vfix);
      __Pyx_GIVEREF(__pyx_v_vfix);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_vfix);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "iminuit/_libiminuit.pyx":804
 *         for vfix in extract_fix(kwds):
 *             if param_name(vfix) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. \             # <<<<<<<<<<<<<<
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 *         for verr in extract_error(kwds):
 */
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);

      /* "iminuit/_libiminuit.pyx":805
 *             if param_name(vfix) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. \
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))             # <<<<<<<<<<<<<<
 *         for verr in extract_error(kwds):
 *             if param_name(verr) not in self.parameters:
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_param_name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_vfix); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_vfix);
        __Pyx_GIVEREF(__pyx_v_vfix);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_vfix);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_vfix);
      __Pyx_GIVEREF(__pyx_v_vfix);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_vfix);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_s_is_given_But_there_is_no_para_2, __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_InitialParamWarning); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);

      /* "iminuit/_libiminuit.pyx":804
 *         for vfix in extract_fix(kwds):
 *             if param_name(vfix) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. \             # <<<<<<<<<<<<<<
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 *         for verr in extract_error(kwds):
 */
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      if (!__pyx_t_10) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL;
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "iminuit/_libiminuit.pyx":803
 *                       'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 *         for vfix in extract_fix(kwds):
 *             if param_name(vfix) not in self.parameters:             # <<<<<<<<<<<<<<
 *                 warn(('%s is given. But there is no parameter %s. \
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 */
    }

    /* "iminuit/_libiminuit.pyx":802
 *                 warn(('%s is given. But there is no parameter %s. '
 *                       'Ignore.' % (vlim, param_name(vlim)), InitialParamWarning))
 *         for vfix in extract_fix(kwds):             # <<<<<<<<<<<<<<
 *             if param_name(vfix) not in self.parameters:
 *                 warn(('%s is given. But there is no parameter %s. \
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":806
 *                 warn(('%s is given. But there is no parameter %s. \
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 *         for verr in extract_error(kwds):             # <<<<<<<<<<<<<<
 *             if param_name(verr) not in self.parameters:
 *                 warn(('%s float. But there is no parameter %s. \
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_extract_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_kwds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); __pyx_t_12 = NULL;
    __Pyx_INCREF(__pyx_v_kwds);
    __Pyx_GIVEREF(__pyx_v_kwds);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_kwds);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_3(__pyx_t_7);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_verr, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":807
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 *         for verr in extract_error(kwds):
 *             if param_name(verr) not in self.parameters:             # <<<<<<<<<<<<<<
 *                 warn(('%s float. But there is no parameter %s. \
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_param_name); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
      }
    }
    if (!__pyx_t_12) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_verr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL;
      __Pyx_INCREF(__pyx_v_verr);
      __Pyx_GIVEREF(__pyx_v_verr);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_verr);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (__pyx_t_5) {

      /* "iminuit/_libiminuit.pyx":808
 *         for verr in extract_error(kwds):
 *             if param_name(verr) not in self.parameters:
 *                 warn(('%s float. But there is no parameter %s. \             # <<<<<<<<<<<<<<
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)
 * 
 */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);

      /* "iminuit/_libiminuit.pyx":809
 *             if param_name(verr) not in self.parameters:
 *                 warn(('%s float. But there is no parameter %s. \
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)             # <<<<<<<<<<<<<<
 * 
 *     def mnprofile(self, vname, bins=30, bound=2, subtract_min=False):
 */
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_param_name); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      if (!__pyx_t_10) {
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_verr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __pyx_t_10 = NULL;
        __Pyx_INCREF(__pyx_v_verr);
        __Pyx_GIVEREF(__pyx_v_verr);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_verr);
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_v_verr);
      __Pyx_GIVEREF(__pyx_v_verr);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_verr);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = PyUnicode_Format(__pyx_kp_u_s_float_But_there_is_no_paramet, __pyx_t_12); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_InitialParamWarning); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_4 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && 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_11 = 1;
        }
      }
      __pyx_t_10 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_11, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_11, __pyx_t_12);
      __pyx_t_9 = 0;
      __pyx_t_12 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "iminuit/_libiminuit.pyx":807
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 *         for verr in extract_error(kwds):
 *             if param_name(verr) not in self.parameters:             # <<<<<<<<<<<<<<
 *                 warn(('%s float. But there is no parameter %s. \
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)
 */
    }

    /* "iminuit/_libiminuit.pyx":806
 *                 warn(('%s is given. But there is no parameter %s. \
 *                     Ignore.' % (vfix, param_name(vfix)), InitialParamWarning))
 *         for verr in extract_error(kwds):             # <<<<<<<<<<<<<<
 *             if param_name(verr) not in self.parameters:
 *                 warn(('%s float. But there is no parameter %s. \
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "iminuit/_libiminuit.pyx":789
 *         self.clear_cobj()
 * 
 *     def pedantic(self, kwds):             # <<<<<<<<<<<<<<
 *         for vn in self.parameters:
 *             if vn not in kwds:
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.pedantic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vn);
  __Pyx_XDECREF(__pyx_v_vlim);
  __Pyx_XDECREF(__pyx_v_vfix);
  __Pyx_XDECREF(__pyx_v_verr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":811
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)
 * 
 *     def mnprofile(self, vname, bins=30, bound=2, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """Calculate minos profile around the specified range.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_67mnprofile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_66mnprofile[] = "Minuit.mnprofile(self, vname, bins=30, bound=2, subtract_min=False)\nCalculate minos profile around the specified range.\n\n        That is Migrad minimum results with **vname** fixed at various places within **bound**.\n\n        **Arguments:**\n\n            * **vname** name of variable to scan\n\n            * **bins** number of scanning bins. Default 30.\n\n            * **bound**\n              If bound is tuple, (left, right) scanning bound.\n              If bound is\\ a number, it specifies how many :math:`\\sigma`\n              symmetrically from minimum (minimum+- bound* :math:`\\sigma`).\n              Default 2\n\n            * **subtract_min** subtract_minimum off from return value. This\n              makes it easy to label confidence interval. Default False.\n\n        **Returns:**\n\n            bins(center point), value, migrad results\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_67mnprofile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vname = 0;
  PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_bound = 0;
  PyObject *__pyx_v_subtract_min = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mnprofile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vname,&__pyx_n_s_bins,&__pyx_n_s_bound,&__pyx_n_s_subtract_min,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_30);
    values[2] = ((PyObject *)__pyx_int_2);
    values[3] = ((PyObject *)Py_False);
    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);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vname)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bound);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subtract_min);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mnprofile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_vname = values[0];
    __pyx_v_bins = values[1];
    __pyx_v_bound = values[2];
    __pyx_v_subtract_min = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mnprofile", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.mnprofile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_66mnprofile(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_vname, __pyx_v_bins, __pyx_v_bound, __pyx_v_subtract_min);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_9mnprofile_2generator5(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":849
 * 
 *         values = array.array(ARRAY_DOUBLE_TYPECODE,
 *                              (bound[0] + binstep * i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         results = array.array(ARRAY_DOUBLE_TYPECODE)
 *         migrad_status = []
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_9mnprofile_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_9mnprofile_2generator5, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_mnprofile_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.mnprofile.genexpr", __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_7iminuit_11_libiminuit_6Minuit_9mnprofile_2generator5(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins)) { __Pyx_RaiseClosureNameError("bins"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bound)) { __Pyx_RaiseClosureNameError("bound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bound, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_binstep)) { __Pyx_RaiseClosureNameError("binstep"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_binstep, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_9mnprofile_5generator6(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":868
 *             themin = min(results)
 *             results = array.array(ARRAY_DOUBLE_TYPECODE,
 *                                   (x - themin for x in results))             # <<<<<<<<<<<<<<
 * 
 *         return values, results, migrad_status
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_9mnprofile_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_9mnprofile_5generator6, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_mnprofile_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.mnprofile.genexpr", __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_7iminuit_11_libiminuit_6Minuit_9mnprofile_5generator6(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_results)) { __Pyx_RaiseClosureNameError("results"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_results)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_results)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_results; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_results); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_themin)) { __Pyx_RaiseClosureNameError("themin"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_4 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_x, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_themin); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __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();
    /* 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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":811
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)
 * 
 *     def mnprofile(self, vname, bins=30, bound=2, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """Calculate minos profile around the specified range.
 * 
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_66mnprofile(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_subtract_min) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *__pyx_cur_scope;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_sigma = NULL;
  PyObject *__pyx_v_blength = NULL;
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_migrad_status = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_fitparam = NULL;
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_m = 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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mnprofile", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_bins = __pyx_v_bins;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bins);
  __pyx_cur_scope->__pyx_v_bound = __pyx_v_bound;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bound);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bound);

  /* "iminuit/_libiminuit.pyx":835
 *             bins(center point), value, migrad results
 *         """
 *         if vname not in self.parameters:             # <<<<<<<<<<<<<<
 *             raise ValueError('Unknown parameter %s' % vname)
 * 
 */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_vname, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":836
 *         """
 *         if vname not in self.parameters:
 *             raise ValueError('Unknown parameter %s' % vname)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(bound, (int, long, float)):
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unknown_parameter_s, __pyx_v_vname); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":835
 *             bins(center point), value, migrad results
 *         """
 *         if vname not in self.parameters:             # <<<<<<<<<<<<<<
 *             raise ValueError('Unknown parameter %s' % vname)
 * 
 */
  }

  /* "iminuit/_libiminuit.pyx":838
 *             raise ValueError('Unknown parameter %s' % vname)
 * 
 *         if isinstance(bound, (int, long, float)):             # <<<<<<<<<<<<<<
 *             if not self.matrix_accurate():
 *                 warn('Specify nsigma bound but error '
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_bound;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyInt_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__pyx_t_1 != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_bound;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = PyLong_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_5 != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_bound;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = PyFloat_Check(__pyx_t_3); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  __pyx_t_5 = (__pyx_t_2 != 0);
  if (__pyx_t_5) {

    /* "iminuit/_libiminuit.pyx":839
 * 
 *         if isinstance(bound, (int, long, float)):
 *             if not self.matrix_accurate():             # <<<<<<<<<<<<<<
 *                 warn('Specify nsigma bound but error '
 *                      'but error matrix is not accurate.')
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matrix_accurate); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = ((!__pyx_t_5) != 0);
    if (__pyx_t_2) {

      /* "iminuit/_libiminuit.pyx":840
 *         if isinstance(bound, (int, long, float)):
 *             if not self.matrix_accurate():
 *                 warn('Specify nsigma bound but error '             # <<<<<<<<<<<<<<
 *                      'but error matrix is not accurate.')
 *             start = self.values[vname]
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "iminuit/_libiminuit.pyx":839
 * 
 *         if isinstance(bound, (int, long, float)):
 *             if not self.matrix_accurate():             # <<<<<<<<<<<<<<
 *                 warn('Specify nsigma bound but error '
 *                      'but error matrix is not accurate.')
 */
    }

    /* "iminuit/_libiminuit.pyx":842
 *                 warn('Specify nsigma bound but error '
 *                      'but error matrix is not accurate.')
 *             start = self.values[vname]             # <<<<<<<<<<<<<<
 *             sigma = self.errors[vname]
 *             bound = (start - bound * sigma, start + bound * sigma)
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->values, __pyx_v_vname); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_start = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":843
 *                      'but error matrix is not accurate.')
 *             start = self.values[vname]
 *             sigma = self.errors[vname]             # <<<<<<<<<<<<<<
 *             bound = (start - bound * sigma, start + bound * sigma)
 *         blength = bound[1] - bound[0]
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->errors, __pyx_v_vname); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_sigma = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":844
 *             start = self.values[vname]
 *             sigma = self.errors[vname]
 *             bound = (start - bound * sigma, start + bound * sigma)             # <<<<<<<<<<<<<<
 *         blength = bound[1] - bound[0]
 *         binstep = blength / (bins - 1)
 */
    __pyx_t_4 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_bound, __pyx_v_sigma); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_start, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_bound, __pyx_v_sigma); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Add(__pyx_v_start, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
    __pyx_t_3 = 0;
    __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_bound);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_bound, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":838
 *             raise ValueError('Unknown parameter %s' % vname)
 * 
 *         if isinstance(bound, (int, long, float)):             # <<<<<<<<<<<<<<
 *             if not self.matrix_accurate():
 *                 warn('Specify nsigma bound but error '
 */
  }

  /* "iminuit/_libiminuit.pyx":845
 *             sigma = self.errors[vname]
 *             bound = (start - bound * sigma, start + bound * sigma)
 *         blength = bound[1] - bound[0]             # <<<<<<<<<<<<<<
 *         binstep = blength / (bins - 1)
 * 
 */
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bound, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bound, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_blength = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":846
 *             bound = (start - bound * sigma, start + bound * sigma)
 *         blength = bound[1] - bound[0]
 *         binstep = blength / (bins - 1)             # <<<<<<<<<<<<<<
 * 
 *         values = array.array(ARRAY_DOUBLE_TYPECODE,
 */
  __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_cur_scope->__pyx_v_bins, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_blength, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_binstep = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":848
 *         binstep = blength / (bins - 1)
 * 
 *         values = array.array(ARRAY_DOUBLE_TYPECODE,             # <<<<<<<<<<<<<<
 *                              (bound[0] + binstep * i for i in xrange(bins)))
 *         results = array.array(ARRAY_DOUBLE_TYPECODE)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ARRAY_DOUBLE_TYPECODE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "iminuit/_libiminuit.pyx":849
 * 
 *         values = array.array(ARRAY_DOUBLE_TYPECODE,
 *                              (bound[0] + binstep * i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         results = array.array(ARRAY_DOUBLE_TYPECODE)
 *         migrad_status = []
 */
  __pyx_t_7 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_9mnprofile_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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_9 = 1;
    }
  }
  __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __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_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_values = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":850
 *         values = array.array(ARRAY_DOUBLE_TYPECODE,
 *                              (bound[0] + binstep * i for i in xrange(bins)))
 *         results = array.array(ARRAY_DOUBLE_TYPECODE)             # <<<<<<<<<<<<<<
 *         migrad_status = []
 *         for i, v in enumerate(values):
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ARRAY_DOUBLE_TYPECODE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_results = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":851
 *                              (bound[0] + binstep * i for i in xrange(bins)))
 *         results = array.array(ARRAY_DOUBLE_TYPECODE)
 *         migrad_status = []             # <<<<<<<<<<<<<<
 *         for i, v in enumerate(values):
 *             fitparam = self.fitarg.copy()
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_migrad_status = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":852
 *         results = array.array(ARRAY_DOUBLE_TYPECODE)
 *         migrad_status = []
 *         for i, v in enumerate(values):             # <<<<<<<<<<<<<<
 *             fitparam = self.fitarg.copy()
 *             fitparam[vname] = v
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_6 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
    __pyx_t_10 = __pyx_v_values; __Pyx_INCREF(__pyx_t_10); __pyx_t_9 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_10))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_10)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_11(__pyx_t_10);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6);
    __pyx_t_6 = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":853
 *         migrad_status = []
 *         for i, v in enumerate(values):
 *             fitparam = self.fitarg.copy()             # <<<<<<<<<<<<<<
 *             fitparam[vname] = v
 *             fitparam['fix_%s' % vname] = True
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->fitarg, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_fitparam, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":854
 *         for i, v in enumerate(values):
 *             fitparam = self.fitarg.copy()
 *             fitparam[vname] = v             # <<<<<<<<<<<<<<
 *             fitparam['fix_%s' % vname] = True
 *             m = Minuit(self.fcn, print_level=0,
 */
    if (unlikely(PyObject_SetItem(__pyx_v_fitparam, __pyx_v_vname, __pyx_v_v) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":855
 *             fitparam = self.fitarg.copy()
 *             fitparam[vname] = v
 *             fitparam['fix_%s' % vname] = True             # <<<<<<<<<<<<<<
 *             m = Minuit(self.fcn, print_level=0,
 *                        pedantic=False, forced_parameters=self.parameters,
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_fix__s, __pyx_v_vname); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyObject_SetItem(__pyx_v_fitparam, __pyx_t_3, Py_True) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":856
 *             fitparam[vname] = v
 *             fitparam['fix_%s' % vname] = True
 *             m = Minuit(self.fcn, print_level=0,             # <<<<<<<<<<<<<<
 *                        pedantic=False, forced_parameters=self.parameters,
 *                        **fitparam)
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->fcn);
    __Pyx_GIVEREF(__pyx_v_self->fcn);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->fcn);
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_print_level, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":857
 *             fitparam['fix_%s' % vname] = True
 *             m = Minuit(self.fcn, print_level=0,
 *                        pedantic=False, forced_parameters=self.parameters,             # <<<<<<<<<<<<<<
 *                        **fitparam)
 *             m.migrad()
 */
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_pedantic, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_forced_parameters, __pyx_v_self->parameters) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":858
 *             m = Minuit(self.fcn, print_level=0,
 *                        pedantic=False, forced_parameters=self.parameters,
 *                        **fitparam)             # <<<<<<<<<<<<<<
 *             m.migrad()
 *             migrad_status.append(m.migrad_ok())
 */
    if (unlikely(__pyx_v_fitparam == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__Pyx_MergeKeywords(__pyx_t_4, __pyx_v_fitparam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":856
 *             fitparam[vname] = v
 *             fitparam['fix_%s' % vname] = True
 *             m = Minuit(self.fcn, print_level=0,             # <<<<<<<<<<<<<<
 *                        pedantic=False, forced_parameters=self.parameters,
 *                        **fitparam)
 */
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7iminuit_11_libiminuit_Minuit), __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_m, ((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":859
 *                        pedantic=False, forced_parameters=self.parameters,
 *                        **fitparam)
 *             m.migrad()             # <<<<<<<<<<<<<<
 *             migrad_status.append(m.migrad_ok())
 *             if not m.migrad_ok():
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_migrad); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":860
 *                        **fitparam)
 *             m.migrad()
 *             migrad_status.append(m.migrad_ok())             # <<<<<<<<<<<<<<
 *             if not m.migrad_ok():
 *                 warn(('Migrad fails to converge for %s=%f') % (vname, v))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_migrad_ok); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_migrad_status, __pyx_t_7); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":861
 *             m.migrad()
 *             migrad_status.append(m.migrad_ok())
 *             if not m.migrad_ok():             # <<<<<<<<<<<<<<
 *                 warn(('Migrad fails to converge for %s=%f') % (vname, v))
 *             results.append(m.fval)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_migrad_ok); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = ((!__pyx_t_2) != 0);
    if (__pyx_t_5) {

      /* "iminuit/_libiminuit.pyx":862
 *             migrad_status.append(m.migrad_ok())
 *             if not m.migrad_ok():
 *                 warn(('Migrad fails to converge for %s=%f') % (vname, v))             # <<<<<<<<<<<<<<
 *             results.append(m.fval)
 * 
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_vname);
      __Pyx_GIVEREF(__pyx_v_vname);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vname);
      __Pyx_INCREF(__pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_v);
      __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_Migrad_fails_to_converge_for_s_f, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else {
        __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "iminuit/_libiminuit.pyx":861
 *             m.migrad()
 *             migrad_status.append(m.migrad_ok())
 *             if not m.migrad_ok():             # <<<<<<<<<<<<<<
 *                 warn(('Migrad fails to converge for %s=%f') % (vname, v))
 *             results.append(m.fval)
 */
    }

    /* "iminuit/_libiminuit.pyx":863
 *             if not m.migrad_ok():
 *                 warn(('Migrad fails to converge for %s=%f') % (vname, v))
 *             results.append(m.fval)             # <<<<<<<<<<<<<<
 * 
 *         if subtract_min:
 */
    __pyx_t_7 = PyFloat_FromDouble(__pyx_v_m->fval); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = __Pyx_PyObject_Append(__pyx_cur_scope->__pyx_v_results, __pyx_t_7); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":852
 *         results = array.array(ARRAY_DOUBLE_TYPECODE)
 *         migrad_status = []
 *         for i, v in enumerate(values):             # <<<<<<<<<<<<<<
 *             fitparam = self.fitarg.copy()
 *             fitparam[vname] = v
 */
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":865
 *             results.append(m.fval)
 * 
 *         if subtract_min:             # <<<<<<<<<<<<<<
 *             themin = min(results)
 *             results = array.array(ARRAY_DOUBLE_TYPECODE,
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "iminuit/_libiminuit.pyx":866
 * 
 *         if subtract_min:
 *             themin = min(results)             # <<<<<<<<<<<<<<
 *             results = array.array(ARRAY_DOUBLE_TYPECODE,
 *                                   (x - themin for x in results))
 */
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_results);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_results);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_results);
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_cur_scope->__pyx_v_themin = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "iminuit/_libiminuit.pyx":867
 *         if subtract_min:
 *             themin = min(results)
 *             results = array.array(ARRAY_DOUBLE_TYPECODE,             # <<<<<<<<<<<<<<
 *                                   (x - themin for x in results))
 * 
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ARRAY_DOUBLE_TYPECODE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);

    /* "iminuit/_libiminuit.pyx":868
 *             themin = min(results)
 *             results = array.array(ARRAY_DOUBLE_TYPECODE,
 *                                   (x - themin for x in results))             # <<<<<<<<<<<<<<
 * 
 *         return values, results, migrad_status
 */
    __pyx_t_4 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_9mnprofile_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_13 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_9 = 1;
      }
    }
    __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_13) {
      __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_13); __pyx_t_13 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_t_4);
    __pyx_t_6 = 0;
    __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_results);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_results, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;

    /* "iminuit/_libiminuit.pyx":865
 *             results.append(m.fval)
 * 
 *         if subtract_min:             # <<<<<<<<<<<<<<
 *             themin = min(results)
 *             results = array.array(ARRAY_DOUBLE_TYPECODE,
 */
  }

  /* "iminuit/_libiminuit.pyx":870
 *                                   (x - themin for x in results))
 * 
 *         return values, results, migrad_status             # <<<<<<<<<<<<<<
 * 
 *     def draw_mnprofile(self, vname, bins=30, bound=2, subtract_min=False,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_values);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_results);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_results);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_results);
  __Pyx_INCREF(__pyx_v_migrad_status);
  __Pyx_GIVEREF(__pyx_v_migrad_status);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_migrad_status);
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":811
 *                     Ignore.') % (verr, param_name(verr)), InitialParamWarning)
 * 
 *     def mnprofile(self, vname, bins=30, bound=2, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """Calculate minos profile around the specified range.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.mnprofile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_sigma);
  __Pyx_XDECREF(__pyx_v_blength);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_migrad_status);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_fitparam);
  __Pyx_XDECREF((PyObject *)__pyx_v_m);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":872
 *         return values, results, migrad_status
 * 
 *     def draw_mnprofile(self, vname, bins=30, bound=2, subtract_min=False,             # <<<<<<<<<<<<<<
 *                        band=True, text=True):
 *         """Draw minos profile around the specified range.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_69draw_mnprofile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_68draw_mnprofile[] = "Minuit.draw_mnprofile(self, vname, bins=30, bound=2, subtract_min=False, band=True, text=True)\nDraw minos profile around the specified range.\n\n        It is obtained by finding Migrad results with **vname** fixed\n        at various places within **bound**.\n\n        **Arguments:**\n\n            * **vname** variable name to scan\n\n            * **bins** number of scanning bin. Default 30.\n\n            * **bound**\n              If bound is tuple, (left, right) scanning bound.\n              If bound is a number, it specifies how many :math:`\\sigma`\n              symmetrically from minimum (minimum+- bound* :math:`\\sigma`).\n              Default 2.\n\n            * **subtract_min** subtract_minimum off from return value. This\n              makes it easy to label confidence interval. Default False.\n\n            * **band** show green band to indicate the increase of fcn by\n              *errordef*. Default True.\n\n            * **text** show text for the location where the fcn is increased\n              by *errordef*. This is less accurate than :meth:`minos`.\n              Default True.\n\n        **Returns:**\n\n            bins(center point), value, migrad results\n\n        .. plot:: pyplots/draw_mnprofile.py\n            :include-source:\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_69draw_mnprofile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vname = 0;
  PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_bound = 0;
  PyObject *__pyx_v_subtract_min = 0;
  PyObject *__pyx_v_band = 0;
  PyObject *__pyx_v_text = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_mnprofile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vname,&__pyx_n_s_bins,&__pyx_n_s_bound,&__pyx_n_s_subtract_min,&__pyx_n_s_band,&__pyx_n_s_text,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_30);
    values[2] = ((PyObject *)__pyx_int_2);
    values[3] = ((PyObject *)Py_False);

    /* "iminuit/_libiminuit.pyx":873
 * 
 *     def draw_mnprofile(self, vname, bins=30, bound=2, subtract_min=False,
 *                        band=True, text=True):             # <<<<<<<<<<<<<<
 *         """Draw minos profile around the specified range.
 * 
 */
    values[4] = ((PyObject *)Py_True);
    values[5] = ((PyObject *)Py_True);
    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);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vname)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bound);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subtract_min);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_band);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_mnprofile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_vname = values[0];
    __pyx_v_bins = values[1];
    __pyx_v_bound = values[2];
    __pyx_v_subtract_min = values[3];
    __pyx_v_band = values[4];
    __pyx_v_text = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_mnprofile", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.draw_mnprofile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_68draw_mnprofile(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_vname, __pyx_v_bins, __pyx_v_bound, __pyx_v_subtract_min, __pyx_v_band, __pyx_v_text);

  /* "iminuit/_libiminuit.pyx":872
 *         return values, results, migrad_status
 * 
 *     def draw_mnprofile(self, vname, bins=30, bound=2, subtract_min=False,             # <<<<<<<<<<<<<<
 *                        band=True, text=True):
 *         """Draw minos profile around the specified range.
 */

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_68draw_mnprofile(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_subtract_min, PyObject *__pyx_v_band, PyObject *__pyx_v_text) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_mnprofile", 0);

  /* "iminuit/_libiminuit.pyx":908
 *             :include-source:
 *         """
 *         x, y, s = self.mnprofile(vname, bins, bound, subtract_min)             # <<<<<<<<<<<<<<
 *         return _plotting.draw_profile(self, vname, x, y, s,
 *                                       band=band, text=text)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mnprofile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __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_vname);
  __Pyx_GIVEREF(__pyx_v_vname);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_vname);
  __Pyx_INCREF(__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_bins);
  __Pyx_INCREF(__pyx_v_bound);
  __Pyx_GIVEREF(__pyx_v_bound);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_bound);
  __Pyx_INCREF(__pyx_v_subtract_min);
  __Pyx_GIVEREF(__pyx_v_subtract_min);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_subtract_min);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __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_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 2; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_s = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":909
 *         """
 *         x, y, s = self.mnprofile(vname, bins, bound, subtract_min)
 *         return _plotting.draw_profile(self, vname, x, y, s,             # <<<<<<<<<<<<<<
 *                                       band=band, text=text)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_plotting); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_draw_profile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __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_INCREF(__pyx_v_vname);
  __Pyx_GIVEREF(__pyx_v_vname);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_vname);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_y);
  __Pyx_INCREF(__pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_s);

  /* "iminuit/_libiminuit.pyx":910
 *         x, y, s = self.mnprofile(vname, bins, bound, subtract_min)
 *         return _plotting.draw_profile(self, vname, x, y, s,
 *                                       band=band, text=text)             # <<<<<<<<<<<<<<
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_band, __pyx_v_band) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_text, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "iminuit/_libiminuit.pyx":909
 *         """
 *         x, y, s = self.mnprofile(vname, bins, bound, subtract_min)
 *         return _plotting.draw_profile(self, vname, x, y, s,             # <<<<<<<<<<<<<<
 *                                       band=band, text=text)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":872
 *         return values, results, migrad_status
 * 
 *     def draw_mnprofile(self, vname, bins=30, bound=2, subtract_min=False,             # <<<<<<<<<<<<<<
 *                        band=True, text=True):
 *         """Draw minos profile around the specified range.
 */

  /* 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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.draw_mnprofile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":912
 *                                       band=band, text=text)
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """Calculate cost function profile around specify range.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_71profile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_70profile[] = "Minuit.profile(self, vname, bins=100, bound=2, args=None, subtract_min=False)\nCalculate cost function profile around specify range.\n\n        **Arguments:**\n\n            * **vname** variable name to scan\n\n            * **bins** number of scanning bin. Default 100.\n\n            * **bound**\n              If bound is tuple, (left, right) scanning bound.\n              If bound is a number, it specifies how many :math:`\\sigma`\n              symmetrically from minimum (minimum+- bound* :math:`\\sigma`).\n              Default 2\n\n            * **subtract_min** subtract_minimum off from return value. This\n              makes it easy to label confidence interval. Default False.\n\n        **Returns:**\n\n            bins(center point), value\n\n        .. seealso::\n\n            :meth:`mnprofile`\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_71profile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vname = 0;
  PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_bound = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_subtract_min = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("profile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vname,&__pyx_n_s_bins,&__pyx_n_s_bound,&__pyx_n_s_args,&__pyx_n_s_subtract_min,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_100);
    values[2] = ((PyObject *)__pyx_int_2);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_False);
    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);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vname)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bound);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subtract_min);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "profile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_vname = values[0];
    __pyx_v_bins = values[1];
    __pyx_v_bound = values[2];
    __pyx_v_args = values[3];
    __pyx_v_subtract_min = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("profile", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.profile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_70profile(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_vname, __pyx_v_bins, __pyx_v_bound, __pyx_v_args, __pyx_v_subtract_min);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7profile_2generator7(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":948
 *         # center value
 *         bins = array.array(ARRAY_DOUBLE_TYPECODE,
 *                            (bound[0] + binstep * i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         ret = array.array(ARRAY_DOUBLE_TYPECODE)
 *         pos = self.var2pos[vname]
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7profile_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_7profile_2generator7, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_profile_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.profile.genexpr", __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_7iminuit_11_libiminuit_6Minuit_7profile_2generator7(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins)) { __Pyx_RaiseClosureNameError("bins"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bound)) { __Pyx_RaiseClosureNameError("bound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bound, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_binstep)) { __Pyx_RaiseClosureNameError("binstep"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_binstep, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":912
 *                                       band=band, text=text)
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """Calculate cost function profile around specify range.
 * 
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_70profile(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_subtract_min) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *__pyx_cur_scope;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_sigma = NULL;
  PyObject *__pyx_v_blength = NULL;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_pos = NULL;
  double __pyx_v_minval;
  PyObject *__pyx_v_val = NULL;
  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;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  double __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("profile", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_10_profile(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_10_profile, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_bins = __pyx_v_bins;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bins);
  __pyx_cur_scope->__pyx_v_bound = __pyx_v_bound;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bound);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bound);
  __Pyx_INCREF(__pyx_v_args);

  /* "iminuit/_libiminuit.pyx":938
 *             :meth:`mnprofile`
 *         """
 *         if isinstance(bound, (int, long, float)):             # <<<<<<<<<<<<<<
 *             start = self.values[vname]
 *             sigma = self.errors[vname]
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_bound;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyInt_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 = __pyx_cur_scope->__pyx_v_bound;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = PyLong_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_bound;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  __pyx_t_4 = (__pyx_t_1 != 0);
  if (__pyx_t_4) {

    /* "iminuit/_libiminuit.pyx":939
 *         """
 *         if isinstance(bound, (int, long, float)):
 *             start = self.values[vname]             # <<<<<<<<<<<<<<
 *             sigma = self.errors[vname]
 *             bound = (start - bound * sigma,
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v_self->values, __pyx_v_vname); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_start = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":940
 *         if isinstance(bound, (int, long, float)):
 *             start = self.values[vname]
 *             sigma = self.errors[vname]             # <<<<<<<<<<<<<<
 *             bound = (start - bound * sigma,
 *                      start + bound * sigma)
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v_self->errors, __pyx_v_vname); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_sigma = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":941
 *             start = self.values[vname]
 *             sigma = self.errors[vname]
 *             bound = (start - bound * sigma,             # <<<<<<<<<<<<<<
 *                      start + bound * sigma)
 *         blength = bound[1] - bound[0]
 */
    __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_bound, __pyx_v_sigma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_start, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":942
 *             sigma = self.errors[vname]
 *             bound = (start - bound * sigma,
 *                      start + bound * sigma)             # <<<<<<<<<<<<<<
 *         blength = bound[1] - bound[0]
 *         binstep = blength / (bins - 1.)
 */
    __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_bound, __pyx_v_sigma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyNumber_Add(__pyx_v_start, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":941
 *             start = self.values[vname]
 *             sigma = self.errors[vname]
 *             bound = (start - bound * sigma,             # <<<<<<<<<<<<<<
 *                      start + bound * sigma)
 *         blength = bound[1] - bound[0]
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_bound);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_bound, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":938
 *             :meth:`mnprofile`
 *         """
 *         if isinstance(bound, (int, long, float)):             # <<<<<<<<<<<<<<
 *             start = self.values[vname]
 *             sigma = self.errors[vname]
 */
  }

  /* "iminuit/_libiminuit.pyx":943
 *             bound = (start - bound * sigma,
 *                      start + bound * sigma)
 *         blength = bound[1] - bound[0]             # <<<<<<<<<<<<<<
 *         binstep = blength / (bins - 1.)
 *         args = list(self.args) if args is None else args
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bound, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bound, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_blength = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":944
 *                      start + bound * sigma)
 *         blength = bound[1] - bound[0]
 *         binstep = blength / (bins - 1.)             # <<<<<<<<<<<<<<
 *         args = list(self.args) if args is None else args
 *         # center value
 */
  __pyx_t_5 = __Pyx_PyFloat_SubtractObjC(__pyx_cur_scope->__pyx_v_bins, __pyx_float_1_, 1., 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_blength, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_binstep = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":945
 *         blength = bound[1] - bound[0]
 *         binstep = blength / (bins - 1.)
 *         args = list(self.args) if args is None else args             # <<<<<<<<<<<<<<
 *         # center value
 *         bins = array.array(ARRAY_DOUBLE_TYPECODE,
 */
  __pyx_t_4 = (__pyx_v_args == Py_None);
  if ((__pyx_t_4 != 0)) {
    __pyx_t_5 = PySequence_List(__pyx_v_self->args); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_args);
    __pyx_t_6 = __pyx_v_args;
  }
  __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":947
 *         args = list(self.args) if args is None else args
 *         # center value
 *         bins = array.array(ARRAY_DOUBLE_TYPECODE,             # <<<<<<<<<<<<<<
 *                            (bound[0] + binstep * i for i in xrange(bins)))
 *         ret = array.array(ARRAY_DOUBLE_TYPECODE)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ARRAY_DOUBLE_TYPECODE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);

  /* "iminuit/_libiminuit.pyx":948
 *         # center value
 *         bins = array.array(ARRAY_DOUBLE_TYPECODE,
 *                            (bound[0] + binstep * i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         ret = array.array(ARRAY_DOUBLE_TYPECODE)
 *         pos = self.var2pos[vname]
 */
  __pyx_t_7 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7profile_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __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_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_bins, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":949
 *         bins = array.array(ARRAY_DOUBLE_TYPECODE,
 *                            (bound[0] + binstep * i for i in xrange(bins)))
 *         ret = array.array(ARRAY_DOUBLE_TYPECODE)             # <<<<<<<<<<<<<<
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ARRAY_DOUBLE_TYPECODE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_ret = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":950
 *                            (bound[0] + binstep * i for i in xrange(bins)))
 *         ret = array.array(ARRAY_DOUBLE_TYPECODE)
 *         pos = self.var2pos[vname]             # <<<<<<<<<<<<<<
 *         if subtract_min and self.cfmin is NULL:
 *             raise RuntimeError("Request for minimization "
 */
  __pyx_t_6 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_vname); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_pos = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":951
 *         ret = array.array(ARRAY_DOUBLE_TYPECODE)
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Request for minimization "
 *                                "subtraction but no minimization has been done. "
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {
  } else {
    __pyx_t_4 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_v_self->cfmin == NULL) != 0);
  __pyx_t_4 = __pyx_t_1;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_4) {

    /* "iminuit/_libiminuit.pyx":952
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:
 *             raise RuntimeError("Request for minimization "             # <<<<<<<<<<<<<<
 *                                "subtraction but no minimization has been done. "
 *                                "Run migrad first.")
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":951
 *         ret = array.array(ARRAY_DOUBLE_TYPECODE)
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Request for minimization "
 *                                "subtraction but no minimization has been done. "
 */
  }

  /* "iminuit/_libiminuit.pyx":955
 *                                "subtraction but no minimization has been done. "
 *                                "Run migrad first.")
 *         minval = self.cfmin.Fval() if subtract_min else 0.             # <<<<<<<<<<<<<<
 *         for val in bins:
 *             args[pos] = val
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {
    __pyx_t_11 = __pyx_v_self->cfmin->Fval();
  } else {
    __pyx_t_11 = 0.;
  }
  __pyx_v_minval = __pyx_t_11;

  /* "iminuit/_libiminuit.pyx":956
 *                                "Run migrad first.")
 *         minval = self.cfmin.Fval() if subtract_min else 0.
 *         for val in bins:             # <<<<<<<<<<<<<<
 *             args[pos] = val
 *             ret.append(self.fcn(*args) - minval)
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_bins)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_bins)) {
    __pyx_t_6 = __pyx_cur_scope->__pyx_v_bins; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
    __pyx_t_12 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_bins); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_12)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      }
    } else {
      __pyx_t_10 = __pyx_t_12(__pyx_t_6);
      if (unlikely(!__pyx_t_10)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_10);
    }
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "iminuit/_libiminuit.pyx":957
 *         minval = self.cfmin.Fval() if subtract_min else 0.
 *         for val in bins:
 *             args[pos] = val             # <<<<<<<<<<<<<<
 *             ret.append(self.fcn(*args) - minval)
 *         return bins, ret
 */
    if (unlikely(PyObject_SetItem(__pyx_v_args, __pyx_v_pos, __pyx_v_val) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":958
 *         for val in bins:
 *             args[pos] = val
 *             ret.append(self.fcn(*args) - minval)             # <<<<<<<<<<<<<<
 *         return bins, ret
 * 
 */
    __pyx_t_10 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_self->fcn, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyFloat_FromDouble(__pyx_v_minval); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_ret, __pyx_t_2); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":956
 *                                "Run migrad first.")
 *         minval = self.cfmin.Fval() if subtract_min else 0.
 *         for val in bins:             # <<<<<<<<<<<<<<
 *             args[pos] = val
 *             ret.append(self.fcn(*args) - minval)
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":959
 *             args[pos] = val
 *             ret.append(self.fcn(*args) - minval)
 *         return bins, ret             # <<<<<<<<<<<<<<
 * 
 *     def draw_profile(self, vname, bins=100, bound=2, args=None,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_bins);
  __Pyx_INCREF(__pyx_v_ret);
  __Pyx_GIVEREF(__pyx_v_ret);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_ret);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":912
 *                                       band=band, text=text)
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """Calculate cost function profile around specify range.
 * 
 */

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.profile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_sigma);
  __Pyx_XDECREF(__pyx_v_blength);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":961
 *         return bins, ret
 * 
 *     def draw_profile(self, vname, bins=100, bound=2, args=None,             # <<<<<<<<<<<<<<
 *                      subtract_min=False, band=True, text=True):
 *         """A convenient wrapper for drawing profile using matplotlib.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_73draw_profile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_72draw_profile[] = "Minuit.draw_profile(self, vname, bins=100, bound=2, args=None, subtract_min=False, band=True, text=True)\nA convenient wrapper for drawing profile using matplotlib.\n\n        .. note::\n            This is not a real minos profile. It's just a simple 1D scan.\n            The number shown on the plot is taken from the green band.\n            They are not minos error. To get a real minos profile call\n            :meth:`mnprofile` or :meth:`draw_mnprofile`\n\n        **Arguments:**\n\n            In addition to argument listed on :meth:`profile`. draw_profile\n            take these addition argument:\n\n            * **band** show green band to indicate the increase of fcn by\n              *errordef*. Note again that this is NOT minos error in general.\n              Default True.\n\n            * **text** show text for the location where the fcn is increased\n              by *errordef*. This is less accurate than :meth:`minos`\n              Note again that this is NOT minos error in general. Default True.\n\n        .. seealso::\n            :meth:`mnprofile`\n            :meth:`draw_mnprofile`\n            :meth:`profile`\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_73draw_profile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vname = 0;
  PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_bound = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_subtract_min = 0;
  PyObject *__pyx_v_band = 0;
  PyObject *__pyx_v_text = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_profile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vname,&__pyx_n_s_bins,&__pyx_n_s_bound,&__pyx_n_s_args,&__pyx_n_s_subtract_min,&__pyx_n_s_band,&__pyx_n_s_text,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_100);
    values[2] = ((PyObject *)__pyx_int_2);
    values[3] = ((PyObject *)Py_None);

    /* "iminuit/_libiminuit.pyx":962
 * 
 *     def draw_profile(self, vname, bins=100, bound=2, args=None,
 *                      subtract_min=False, band=True, text=True):             # <<<<<<<<<<<<<<
 *         """A convenient wrapper for drawing profile using matplotlib.
 * 
 */
    values[4] = ((PyObject *)Py_False);
    values[5] = ((PyObject *)Py_True);
    values[6] = ((PyObject *)Py_True);
    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);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vname)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bound);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subtract_min);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_band);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_profile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_vname = values[0];
    __pyx_v_bins = values[1];
    __pyx_v_bound = values[2];
    __pyx_v_args = values[3];
    __pyx_v_subtract_min = values[4];
    __pyx_v_band = values[5];
    __pyx_v_text = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_profile", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.draw_profile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_72draw_profile(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_vname, __pyx_v_bins, __pyx_v_bound, __pyx_v_args, __pyx_v_subtract_min, __pyx_v_band, __pyx_v_text);

  /* "iminuit/_libiminuit.pyx":961
 *         return bins, ret
 * 
 *     def draw_profile(self, vname, bins=100, bound=2, args=None,             # <<<<<<<<<<<<<<
 *                      subtract_min=False, band=True, text=True):
 *         """A convenient wrapper for drawing profile using matplotlib.
 */

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_72draw_profile(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_vname, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_subtract_min, PyObject *__pyx_v_band, PyObject *__pyx_v_text) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_profile", 0);

  /* "iminuit/_libiminuit.pyx":989
 *             :meth:`profile`
 *         """
 *         x, y = self.profile(vname, bins, bound, args, subtract_min)             # <<<<<<<<<<<<<<
 *         x, y, s = _plotting.draw_profile(self, vname, x, y,
 *                                          band=band, text=text)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_profile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_5 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __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_vname);
  __Pyx_GIVEREF(__pyx_v_vname);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_vname);
  __Pyx_INCREF(__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_bins);
  __Pyx_INCREF(__pyx_v_bound);
  __Pyx_GIVEREF(__pyx_v_bound);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_bound);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_args);
  __Pyx_INCREF(__pyx_v_subtract_min);
  __Pyx_GIVEREF(__pyx_v_subtract_min);
  PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_subtract_min);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = 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_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":990
 *         """
 *         x, y = self.profile(vname, bins, bound, args, subtract_min)
 *         x, y, s = _plotting.draw_profile(self, vname, x, y,             # <<<<<<<<<<<<<<
 *                                          band=band, text=text)
 *         return x, y
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_plotting); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_draw_profile); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __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_INCREF(__pyx_v_vname);
  __Pyx_GIVEREF(__pyx_v_vname);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_vname);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_y);

  /* "iminuit/_libiminuit.pyx":991
 *         x, y = self.profile(vname, bins, bound, args, subtract_min)
 *         x, y, s = _plotting.draw_profile(self, vname, x, y,
 *                                          band=band, text=text)             # <<<<<<<<<<<<<<
 *         return x, y
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_band, __pyx_v_band) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_text, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "iminuit/_libiminuit.pyx":990
 *         """
 *         x, y = self.profile(vname, bins, bound, args, subtract_min)
 *         x, y, s = _plotting.draw_profile(self, vname, x, y,             # <<<<<<<<<<<<<<
 *                                          band=band, text=text)
 *         return x, y
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __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_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 2; __pyx_t_5 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_7), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_s = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":992
 *         x, y, s = _plotting.draw_profile(self, vname, x, y,
 *                                          band=band, text=text)
 *         return x, y             # <<<<<<<<<<<<<<
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_y);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":961
 *         return bins, ret
 * 
 *     def draw_profile(self, vname, bins=100, bound=2, args=None,             # <<<<<<<<<<<<<<
 *                      subtract_min=False, band=True, text=True):
 *         """A convenient wrapper for drawing profile using matplotlib.
 */

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.draw_profile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":994
 *         return x, y
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D contour scan.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_75contour(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_74contour[] = "Minuit.contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False)\n2D contour scan.\n\n        return contour of migrad result obtained by fixing all\n        others parameters except **x** and **y** which are let to varied.\n\n        **Arguments:**\n\n            - **x** variable name for X axis of scan\n\n            - **y** variable name for Y axis of scan\n\n            - **bound**\n              If bound is 2x2 array [[v1min,v1max],[v2min,v2max]].\n              If bound is a number, it specifies how many :math:`\\sigma`\n              symmetrically from minimum (minimum+- bound*:math:`\\sigma`).\n              Default 2\n\n            - **subtract_min** subtract_minimum off from return value. This\n              makes it easy to label confidence interval. Default False.\n\n        **Returns:**\n\n            x_bins, y_bins, values\n\n            values[y, x] <-- this choice is so that you can pass it\n            to through matplotlib contour()\n\n        .. seealso::\n\n            :meth:`mncontour`\n\n        .. note::\n\n            If `subtract_min=True`, the return value has the minimum subtracted\n            off. The value on the contour can be interpreted *loosely* as\n            :math:`i^2 \\times \\textrm{up}` where i is number of standard\n            deviation away from the fitted value *WITHOUT* taking into account\n            correlation with other parameters that's fixed.\n\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_75contour(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_bound = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_subtract_min = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contour (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_bins,&__pyx_n_s_bound,&__pyx_n_s_args,&__pyx_n_s_subtract_min,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_int_20);
    values[3] = ((PyObject *)__pyx_int_2);
    values[4] = ((PyObject *)Py_None);
    values[5] = ((PyObject *)Py_False);
    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);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("contour", 0, 2, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bound);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subtract_min);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contour") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_x = values[0];
    __pyx_v_y = values[1];
    __pyx_v_bins = values[2];
    __pyx_v_bound = values[3];
    __pyx_v_args = values[4];
    __pyx_v_subtract_min = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("contour", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.contour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_74contour(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_bins, __pyx_v_bound, __pyx_v_args, __pyx_v_subtract_min);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_2generator8(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":1057
 * 
 *         x_val = array.array(ARRAY_DOUBLE_TYPECODE,
 *                             (x_bound[0] + x_binstep * i for i in xrange(x_bins)))             # <<<<<<<<<<<<<<
 *         y_val = array.array(ARRAY_DOUBLE_TYPECODE,
 *                             (y_bound[0] + y_binstep * i for i in xrange(y_bins)))
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_2generator8, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_contour_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.contour.genexpr", __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_7iminuit_11_libiminuit_6Minuit_7contour_2generator8(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bins)) { __Pyx_RaiseClosureNameError("x_bins"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bins);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bins);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bound)) { __Pyx_RaiseClosureNameError("x_bound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bound, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_binstep)) { __Pyx_RaiseClosureNameError("x_binstep"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_binstep, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_5generator9(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":1059
 *                             (x_bound[0] + x_binstep * i for i in xrange(x_bins)))
 *         y_val = array.array(ARRAY_DOUBLE_TYPECODE,
 *                             (y_bound[0] + y_binstep * i for i in xrange(y_bins)))             # <<<<<<<<<<<<<<
 * 
 *         x_pos = self.var2pos[x]
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_5generator9, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_contour_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.contour.genexpr", __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_7iminuit_11_libiminuit_6Minuit_7contour_5generator9(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bins)) { __Pyx_RaiseClosureNameError("y_bins"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bins);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bins);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bound)) { __Pyx_RaiseClosureNameError("y_bound"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bound, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_binstep)) { __Pyx_RaiseClosureNameError("y_binstep"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_5 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_binstep, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":994
 *         return x, y
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D contour scan.
 * 
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_74contour(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_subtract_min) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *__pyx_cur_scope;
  PyObject *__pyx_v_x_start = NULL;
  PyObject *__pyx_v_x_sigma = NULL;
  PyObject *__pyx_v_y_start = NULL;
  PyObject *__pyx_v_y_sigma = NULL;
  PyObject *__pyx_v_x_blength = NULL;
  PyObject *__pyx_v_y_blength = NULL;
  PyObject *__pyx_v_x_val = NULL;
  PyObject *__pyx_v_y_val = NULL;
  PyObject *__pyx_v_x_pos = NULL;
  PyObject *__pyx_v_y_pos = NULL;
  double __pyx_v_minval;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_yy = NULL;
  PyObject *__pyx_v_tmp = NULL;
  PyObject *__pyx_v_xx = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  double __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("contour", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_12_contour(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_12_contour, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_INCREF(__pyx_v_args);

  /* "iminuit/_libiminuit.pyx":1036
 *         """
 *         #don't want to use numpy as requirement for this
 *         if isinstance(bound, (int, long, float)):             # <<<<<<<<<<<<<<
 *             x_start = self.values[x]
 *             x_sigma = self.errors[x]
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_bound); 
  __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_bound); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyFloat_Check(__pyx_v_bound); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":1037
 *         #don't want to use numpy as requirement for this
 *         if isinstance(bound, (int, long, float)):
 *             x_start = self.values[x]             # <<<<<<<<<<<<<<
 *             x_sigma = self.errors[x]
 *             x_bound = (x_start - bound * x_sigma, x_start + bound * x_sigma)
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->values, __pyx_v_x); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_x_start = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1038
 *         if isinstance(bound, (int, long, float)):
 *             x_start = self.values[x]
 *             x_sigma = self.errors[x]             # <<<<<<<<<<<<<<
 *             x_bound = (x_start - bound * x_sigma, x_start + bound * x_sigma)
 *             y_start = self.values[y]
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->errors, __pyx_v_x); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_x_sigma = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1039
 *             x_start = self.values[x]
 *             x_sigma = self.errors[x]
 *             x_bound = (x_start - bound * x_sigma, x_start + bound * x_sigma)             # <<<<<<<<<<<<<<
 *             y_start = self.values[y]
 *             y_sigma = self.errors[y]
 */
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_x_sigma); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_x_start, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_x_sigma); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Add(__pyx_v_x_start, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __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_6);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_x_bound = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1040
 *             x_sigma = self.errors[x]
 *             x_bound = (x_start - bound * x_sigma, x_start + bound * x_sigma)
 *             y_start = self.values[y]             # <<<<<<<<<<<<<<
 *             y_sigma = self.errors[y]
 *             y_bound = (y_start - bound * y_sigma, y_start + bound * y_sigma)
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->values, __pyx_v_y); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_y_start = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1041
 *             x_bound = (x_start - bound * x_sigma, x_start + bound * x_sigma)
 *             y_start = self.values[y]
 *             y_sigma = self.errors[y]             # <<<<<<<<<<<<<<
 *             y_bound = (y_start - bound * y_sigma, y_start + bound * y_sigma)
 *         else:
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->errors, __pyx_v_y); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_y_sigma = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1042
 *             y_start = self.values[y]
 *             y_sigma = self.errors[y]
 *             y_bound = (y_start - bound * y_sigma, y_start + bound * y_sigma)             # <<<<<<<<<<<<<<
 *         else:
 *             x_bound = bound[0]
 */
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_y_sigma); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Subtract(__pyx_v_y_start, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_y_sigma); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Add(__pyx_v_y_start, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_y_bound = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1036
 *         """
 *         #don't want to use numpy as requirement for this
 *         if isinstance(bound, (int, long, float)):             # <<<<<<<<<<<<<<
 *             x_start = self.values[x]
 *             x_sigma = self.errors[x]
 */
    goto __pyx_L3;
  }

  /* "iminuit/_libiminuit.pyx":1044
 *             y_bound = (y_start - bound * y_sigma, y_start + bound * y_sigma)
 *         else:
 *             x_bound = bound[0]             # <<<<<<<<<<<<<<
 *             y_bound = bound[1]
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_bound, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_x_bound = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1045
 *         else:
 *             x_bound = bound[0]
 *             y_bound = bound[1]             # <<<<<<<<<<<<<<
 * 
 *         x_bins = bins
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_bound, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_y_bound = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":1047
 *             y_bound = bound[1]
 * 
 *         x_bins = bins             # <<<<<<<<<<<<<<
 *         y_bins = bins
 * 
 */
  __Pyx_INCREF(__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  __pyx_cur_scope->__pyx_v_x_bins = __pyx_v_bins;

  /* "iminuit/_libiminuit.pyx":1048
 * 
 *         x_bins = bins
 *         y_bins = bins             # <<<<<<<<<<<<<<
 * 
 *         x_blength = x_bound[1] - x_bound[0]
 */
  __Pyx_INCREF(__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  __pyx_cur_scope->__pyx_v_y_bins = __pyx_v_bins;

  /* "iminuit/_libiminuit.pyx":1050
 *         y_bins = bins
 * 
 *         x_blength = x_bound[1] - x_bound[0]             # <<<<<<<<<<<<<<
 *         x_binstep = x_blength / (x_bins - 1.)
 * 
 */
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_x_bound, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_x_bound, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __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_x_blength = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1051
 * 
 *         x_blength = x_bound[1] - x_bound[0]
 *         x_binstep = x_blength / (x_bins - 1.)             # <<<<<<<<<<<<<<
 * 
 *         y_blength = y_bound[1] - y_bound[0]
 */
  __pyx_t_6 = __Pyx_PyFloat_SubtractObjC(__pyx_cur_scope->__pyx_v_x_bins, __pyx_float_1_, 1., 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_x_blength, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_x_binstep = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":1053
 *         x_binstep = x_blength / (x_bins - 1.)
 * 
 *         y_blength = y_bound[1] - y_bound[0]             # <<<<<<<<<<<<<<
 *         y_binstep = y_blength / (y_bins - 1.)
 * 
 */
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_y_bound, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_y_bound, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_y_blength = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":1054
 * 
 *         y_blength = y_bound[1] - y_bound[0]
 *         y_binstep = y_blength / (y_bins - 1.)             # <<<<<<<<<<<<<<
 * 
 *         x_val = array.array(ARRAY_DOUBLE_TYPECODE,
 */
  __pyx_t_4 = __Pyx_PyFloat_SubtractObjC(__pyx_cur_scope->__pyx_v_y_bins, __pyx_float_1_, 1., 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_y_blength, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_y_binstep = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1056
 *         y_binstep = y_blength / (y_bins - 1.)
 * 
 *         x_val = array.array(ARRAY_DOUBLE_TYPECODE,             # <<<<<<<<<<<<<<
 *                             (x_bound[0] + x_binstep * i for i in xrange(x_bins)))
 *         y_val = array.array(ARRAY_DOUBLE_TYPECODE,
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ARRAY_DOUBLE_TYPECODE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "iminuit/_libiminuit.pyx":1057
 * 
 *         x_val = array.array(ARRAY_DOUBLE_TYPECODE,
 *                             (x_bound[0] + x_binstep * i for i in xrange(x_bins)))             # <<<<<<<<<<<<<<
 *         y_val = array.array(ARRAY_DOUBLE_TYPECODE,
 *                             (y_bound[0] + y_binstep * i for i in xrange(y_bins)))
 */
  __pyx_t_7 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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_9 = 1;
    }
  }
  __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __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_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
  __pyx_t_4 = 0;
  __pyx_t_7 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_x_val = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1058
 *         x_val = array.array(ARRAY_DOUBLE_TYPECODE,
 *                             (x_bound[0] + x_binstep * i for i in xrange(x_bins)))
 *         y_val = array.array(ARRAY_DOUBLE_TYPECODE,             # <<<<<<<<<<<<<<
 *                             (y_bound[0] + y_binstep * i for i in xrange(y_bins)))
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ARRAY_DOUBLE_TYPECODE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);

  /* "iminuit/_libiminuit.pyx":1059
 *                             (x_bound[0] + x_binstep * i for i in xrange(x_bins)))
 *         y_val = array.array(ARRAY_DOUBLE_TYPECODE,
 *                             (y_bound[0] + y_binstep * i for i in xrange(y_bins)))             # <<<<<<<<<<<<<<
 * 
 *         x_pos = self.var2pos[x]
 */
  __pyx_t_7 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_9 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_t_7);
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_y_val = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1061
 *                             (y_bound[0] + y_binstep * i for i in xrange(y_bins)))
 * 
 *         x_pos = self.var2pos[x]             # <<<<<<<<<<<<<<
 *         y_pos = self.var2pos[y]
 * 
 */
  __pyx_t_6 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_x); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_x_pos = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1062
 * 
 *         x_pos = self.var2pos[x]
 *         y_pos = self.var2pos[y]             # <<<<<<<<<<<<<<
 * 
 *         args = list(self.args) if args is None else args
 */
  __pyx_t_6 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_y); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_y_pos = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1064
 *         y_pos = self.var2pos[y]
 * 
 *         args = list(self.args) if args is None else args             # <<<<<<<<<<<<<<
 * 
 *         if subtract_min and self.cfmin is NULL:
 */
  __pyx_t_3 = (__pyx_v_args == Py_None);
  if ((__pyx_t_3 != 0)) {
    __pyx_t_10 = PySequence_List(__pyx_v_self->args); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = __pyx_t_10;
    __pyx_t_10 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_args);
    __pyx_t_6 = __pyx_v_args;
  }
  __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1066
 *         args = list(self.args) if args is None else args
 * 
 *         if subtract_min and self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Request for minimization "
 *                                "subtraction but no minimization has been done. "
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {
  } else {
    __pyx_t_3 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_v_self->cfmin == NULL) != 0);
  __pyx_t_3 = __pyx_t_1;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":1067
 * 
 *         if subtract_min and self.cfmin is NULL:
 *             raise RuntimeError("Request for minimization "             # <<<<<<<<<<<<<<
 *                                "subtraction but no minimization has been done. "
 *                                "Run migrad first.")
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":1066
 *         args = list(self.args) if args is None else args
 * 
 *         if subtract_min and self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Request for minimization "
 *                                "subtraction but no minimization has been done. "
 */
  }

  /* "iminuit/_libiminuit.pyx":1070
 *                                "subtraction but no minimization has been done. "
 *                                "Run migrad first.")
 *         minval = self.cfmin.Fval() if subtract_min else 0.             # <<<<<<<<<<<<<<
 * 
 *         ret = list()
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {
    __pyx_t_11 = __pyx_v_self->cfmin->Fval();
  } else {
    __pyx_t_11 = 0.;
  }
  __pyx_v_minval = __pyx_t_11;

  /* "iminuit/_libiminuit.pyx":1072
 *         minval = self.cfmin.Fval() if subtract_min else 0.
 * 
 *         ret = list()             # <<<<<<<<<<<<<<
 *         for yy in y_val:
 *             args[y_pos] = yy
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_ret = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1073
 * 
 *         ret = list()
 *         for yy in y_val:             # <<<<<<<<<<<<<<
 *             args[y_pos] = yy
 *             tmp = array.array(ARRAY_DOUBLE_TYPECODE)
 */
  if (likely(PyList_CheckExact(__pyx_v_y_val)) || PyTuple_CheckExact(__pyx_v_y_val)) {
    __pyx_t_6 = __pyx_v_y_val; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
    __pyx_t_12 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_y_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_12)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      }
    } else {
      __pyx_t_10 = __pyx_t_12(__pyx_t_6);
      if (unlikely(!__pyx_t_10)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_10);
    }
    __Pyx_XDECREF_SET(__pyx_v_yy, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "iminuit/_libiminuit.pyx":1074
 *         ret = list()
 *         for yy in y_val:
 *             args[y_pos] = yy             # <<<<<<<<<<<<<<
 *             tmp = array.array(ARRAY_DOUBLE_TYPECODE)
 *             for xx in x_val:
 */
    if (unlikely(PyObject_SetItem(__pyx_v_args, __pyx_v_y_pos, __pyx_v_yy) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":1075
 *         for yy in y_val:
 *             args[y_pos] = yy
 *             tmp = array.array(ARRAY_DOUBLE_TYPECODE)             # <<<<<<<<<<<<<<
 *             for xx in x_val:
 *                 args[x_pos] = xx
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_ARRAY_DOUBLE_TYPECODE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_10);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_tmp, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "iminuit/_libiminuit.pyx":1076
 *             args[y_pos] = yy
 *             tmp = array.array(ARRAY_DOUBLE_TYPECODE)
 *             for xx in x_val:             # <<<<<<<<<<<<<<
 *                 args[x_pos] = xx
 *                 tmp.append(self.fcn(*args) - minval)
 */
    if (likely(PyList_CheckExact(__pyx_v_x_val)) || PyTuple_CheckExact(__pyx_v_x_val)) {
      __pyx_t_10 = __pyx_v_x_val; __Pyx_INCREF(__pyx_t_10); __pyx_t_13 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_13 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_x_val); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_14 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_10))) {
          if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_13); __Pyx_INCREF(__pyx_t_7); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_10, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_13); __Pyx_INCREF(__pyx_t_7); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_10, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_14(__pyx_t_10);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_xx, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "iminuit/_libiminuit.pyx":1077
 *             tmp = array.array(ARRAY_DOUBLE_TYPECODE)
 *             for xx in x_val:
 *                 args[x_pos] = xx             # <<<<<<<<<<<<<<
 *                 tmp.append(self.fcn(*args) - minval)
 *             ret.append(tmp)
 */
      if (unlikely(PyObject_SetItem(__pyx_v_args, __pyx_v_x_pos, __pyx_v_xx) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "iminuit/_libiminuit.pyx":1078
 *             for xx in x_val:
 *                 args[x_pos] = xx
 *                 tmp.append(self.fcn(*args) - minval)             # <<<<<<<<<<<<<<
 *             ret.append(tmp)
 * 
 */
      __pyx_t_7 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_self->fcn, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyFloat_FromDouble(__pyx_v_minval); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyNumber_Subtract(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_tmp, __pyx_t_8); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "iminuit/_libiminuit.pyx":1076
 *             args[y_pos] = yy
 *             tmp = array.array(ARRAY_DOUBLE_TYPECODE)
 *             for xx in x_val:             # <<<<<<<<<<<<<<
 *                 args[x_pos] = xx
 *                 tmp.append(self.fcn(*args) - minval)
 */
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "iminuit/_libiminuit.pyx":1079
 *                 args[x_pos] = xx
 *                 tmp.append(self.fcn(*args) - minval)
 *             ret.append(tmp)             # <<<<<<<<<<<<<<
 * 
 *         return x_val, y_val, ret
 */
    __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_tmp); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":1073
 * 
 *         ret = list()
 *         for yy in y_val:             # <<<<<<<<<<<<<<
 *             args[y_pos] = yy
 *             tmp = array.array(ARRAY_DOUBLE_TYPECODE)
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1081
 *             ret.append(tmp)
 * 
 *         return x_val, y_val, ret             # <<<<<<<<<<<<<<
 * 
 *     def mncontour(self, x, y, int numpoints=20, sigma=1.0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_x_val);
  __Pyx_GIVEREF(__pyx_v_x_val);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_x_val);
  __Pyx_INCREF(__pyx_v_y_val);
  __Pyx_GIVEREF(__pyx_v_y_val);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_y_val);
  __Pyx_INCREF(__pyx_v_ret);
  __Pyx_GIVEREF(__pyx_v_ret);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_ret);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":994
 *         return x, y
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D contour scan.
 * 
 */

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.contour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x_start);
  __Pyx_XDECREF(__pyx_v_x_sigma);
  __Pyx_XDECREF(__pyx_v_y_start);
  __Pyx_XDECREF(__pyx_v_y_sigma);
  __Pyx_XDECREF(__pyx_v_x_blength);
  __Pyx_XDECREF(__pyx_v_y_blength);
  __Pyx_XDECREF(__pyx_v_x_val);
  __Pyx_XDECREF(__pyx_v_y_val);
  __Pyx_XDECREF(__pyx_v_x_pos);
  __Pyx_XDECREF(__pyx_v_y_pos);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_yy);
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XDECREF(__pyx_v_xx);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1083
 *         return x_val, y_val, ret
 * 
 *     def mncontour(self, x, y, int numpoints=20, sigma=1.0):             # <<<<<<<<<<<<<<
 *         """Minos contour scan.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_77mncontour(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_76mncontour[] = "Minuit.mncontour(self, x, y, int numpoints=20, sigma=1.0)\nMinos contour scan.\n\n        A proper n **sigma** contour scan. This is the line\n        where the minimum of fcn  with x,y is fixed at points on the line and\n        letting the rest of variable varied is change by **sigma** * errordef^2\n        . The calculation is very very expensive since it has to run migrad\n        at various points.\n\n        .. note::\n            See http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/node7.html\n\n        **Arguments:**\n\n            - **x** string variable name of the first parameter\n\n            - **y** string variable name of the second parameter\n\n            - **numpoints** number of points on the line to find. Default 20.\n\n            - **sigma** number of sigma for the contour line. Default 1.0.\n\n        **Returns:**\n\n            x minos error struct, y minos error struct, contour line\n\n            contour line is a list of the form\n            [[x1,y1]...[xn,yn]]\n\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_77mncontour(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  int __pyx_v_numpoints;
  PyObject *__pyx_v_sigma = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mncontour (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_numpoints,&__pyx_n_s_sigma,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)__pyx_float_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  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mncontour", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numpoints);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sigma);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mncontour") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_x = values[0];
    __pyx_v_y = values[1];
    if (values[2]) {
      __pyx_v_numpoints = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_numpoints == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_numpoints = ((int)20);
    }
    __pyx_v_sigma = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mncontour", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.mncontour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_76mncontour(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_numpoints, __pyx_v_sigma);

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_76mncontour(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_numpoints, PyObject *__pyx_v_sigma) {
  unsigned int __pyx_v_ix;
  unsigned int __pyx_v_iy;
  PyObject *__pyx_v_vary_param = NULL;
  double __pyx_v_oldup;
  std::auto_ptr<MnContours>  __pyx_v_mnc;
  ContoursError __pyx_v_cerr;
  PyObject *__pyx_v_xminos = NULL;
  PyObject *__pyx_v_yminos = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  double __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mncontour", 0);

  /* "iminuit/_libiminuit.pyx":1113
 * 
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('Run Migrad first')
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->pyfcn == NULL) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_self->cfmin == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":1114
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:
 *             raise ValueError('Run Migrad first')             # <<<<<<<<<<<<<<
 * 
 *         cdef unsigned int ix = self.var2pos[x]
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":1113
 * 
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('Run Migrad first')
 * 
 */
  }

  /* "iminuit/_libiminuit.pyx":1116
 *             raise ValueError('Run Migrad first')
 * 
 *         cdef unsigned int ix = self.var2pos[x]             # <<<<<<<<<<<<<<
 *         cdef unsigned int iy = self.var2pos[y]
 * 
 */
  __pyx_t_3 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_x); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ix = __pyx_t_4;

  /* "iminuit/_libiminuit.pyx":1117
 * 
 *         cdef unsigned int ix = self.var2pos[x]
 *         cdef unsigned int iy = self.var2pos[y]             # <<<<<<<<<<<<<<
 * 
 *         vary_param = self.list_of_vary_param()
 */
  __pyx_t_3 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_y); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_iy = __pyx_t_4;

  /* "iminuit/_libiminuit.pyx":1119
 *         cdef unsigned int iy = self.var2pos[y]
 * 
 *         vary_param = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 * 
 *         if x not in vary_param or y not in vary_param:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list_of_vary_param); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_vary_param = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":1121
 *         vary_param = self.list_of_vary_param()
 * 
 *         if x not in vary_param or y not in vary_param:             # <<<<<<<<<<<<<<
 *             raise ValueError('mncontour has to be run on vary parameters.')
 * 
 */
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_x, __pyx_v_vary_param, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = (__pyx_t_2 != 0);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_1 = __pyx_t_7;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_y, __pyx_v_vary_param, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_7 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":1122
 * 
 *         if x not in vary_param or y not in vary_param:
 *             raise ValueError('mncontour has to be run on vary parameters.')             # <<<<<<<<<<<<<<
 * 
 *         cdef double oldup = self.pyfcn.Up()
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":1121
 *         vary_param = self.list_of_vary_param()
 * 
 *         if x not in vary_param or y not in vary_param:             # <<<<<<<<<<<<<<
 *             raise ValueError('mncontour has to be run on vary parameters.')
 * 
 */
  }

  /* "iminuit/_libiminuit.pyx":1124
 *             raise ValueError('mncontour has to be run on vary parameters.')
 * 
 *         cdef double oldup = self.pyfcn.Up()             # <<<<<<<<<<<<<<
 *         self.pyfcn.set_up(oldup * sigma * sigma)
 * 
 */
  __pyx_v_oldup = __pyx_v_self->pyfcn->Up();

  /* "iminuit/_libiminuit.pyx":1125
 * 
 *         cdef double oldup = self.pyfcn.Up()
 *         self.pyfcn.set_up(oldup * sigma * sigma)             # <<<<<<<<<<<<<<
 * 
 *         cdef auto_ptr[MnContours] mnc = auto_ptr[MnContours](
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_oldup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_v_sigma); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_v_sigma); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->pyfcn->set_up(__pyx_t_8);

  /* "iminuit/_libiminuit.pyx":1127
 *         self.pyfcn.set_up(oldup * sigma * sigma)
 * 
 *         cdef auto_ptr[MnContours] mnc = auto_ptr[MnContours](             # <<<<<<<<<<<<<<
 *             new MnContours(deref(self.pyfcn),
 *                            deref(self.cfmin),
 */
  __pyx_v_mnc = std::auto_ptr<MnContours> (new MnContours((*__pyx_v_self->pyfcn), (*__pyx_v_self->cfmin), __pyx_v_self->strategy));

  /* "iminuit/_libiminuit.pyx":1132
 *                            self.strategy))
 * 
 *         cdef ContoursError cerr = mnc.get().Contour(ix, iy, numpoints)             # <<<<<<<<<<<<<<
 * 
 *         xminos = minoserror2struct(cerr.XMinosError())
 */
  __pyx_v_cerr = __pyx_v_mnc.get()->Contour(__pyx_v_ix, __pyx_v_iy, __pyx_v_numpoints);

  /* "iminuit/_libiminuit.pyx":1134
 *         cdef ContoursError cerr = mnc.get().Contour(ix, iy, numpoints)
 * 
 *         xminos = minoserror2struct(cerr.XMinosError())             # <<<<<<<<<<<<<<
 *         yminos = minoserror2struct(cerr.YMinosError())
 * 
 */
  __pyx_t_3 = __pyx_f_7iminuit_11_libiminuit_minoserror2struct(__pyx_v_cerr.XMinosError()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_xminos = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":1135
 * 
 *         xminos = minoserror2struct(cerr.XMinosError())
 *         yminos = minoserror2struct(cerr.YMinosError())             # <<<<<<<<<<<<<<
 * 
 *         self.pyfcn.set_up(oldup)
 */
  __pyx_t_3 = __pyx_f_7iminuit_11_libiminuit_minoserror2struct(__pyx_v_cerr.YMinosError()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_yminos = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":1137
 *         yminos = minoserror2struct(cerr.YMinosError())
 * 
 *         self.pyfcn.set_up(oldup)             # <<<<<<<<<<<<<<
 * 
 *         return xminos, yminos, cerr.Points()  #using type coersion here
 */
  __pyx_v_self->pyfcn->set_up(__pyx_v_oldup);

  /* "iminuit/_libiminuit.pyx":1139
 *         self.pyfcn.set_up(oldup)
 * 
 *         return xminos, yminos, cerr.Points()  #using type coersion here             # <<<<<<<<<<<<<<
 * 
 *     def mncontour_grid(self, x, y, bins=100, nsigma=2, numpoints=20,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___(__pyx_v_cerr.operator()()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_xminos);
  __Pyx_GIVEREF(__pyx_v_xminos);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_xminos);
  __Pyx_INCREF(__pyx_v_yminos);
  __Pyx_GIVEREF(__pyx_v_yminos);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_yminos);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":1083
 *         return x_val, y_val, ret
 * 
 *     def mncontour(self, x, y, int numpoints=20, sigma=1.0):             # <<<<<<<<<<<<<<
 *         """Minos contour scan.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.mncontour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vary_param);
  __Pyx_XDECREF(__pyx_v_xminos);
  __Pyx_XDECREF(__pyx_v_yminos);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1141
 *         return xminos, yminos, cerr.Points()  #using type coersion here
 * 
 *     def mncontour_grid(self, x, y, bins=100, nsigma=2, numpoints=20,             # <<<<<<<<<<<<<<
 *                        int sigma_res=4, edges=False):
 *         """Compute gridded minos contour.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_79mncontour_grid(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_78mncontour_grid[] = "Minuit.mncontour_grid(self, x, y, bins=100, nsigma=2, numpoints=20, int sigma_res=4, edges=False)\nCompute gridded minos contour.\n\n        **Arguments:**\n\n            - **x**, **y** parameter name\n\n            - **bins** number of bins in the grid. The boundary of the grid is\n              selected automatically by the minos error computed. Default 100.\n\n            - **nsigma** number of sigma to draw. Default 2\n\n            - **numpoints** number of points to calculate mncontour for each\n              sigma points(there are sigma_res*nsigma total)\n\n            - **sigma_res** number of sigma level to calculate MnContours\n\n            - **edges** Return bin edges instead of mid value(pass True if you\n              want to draw it using pcolormesh)\n\n        **Returns:**\n\n            xgrid, ygrid, sigma, rawdata\n\n            rawdata is tuple of (x,y,sigma_level)\n\n        .. seealso::\n\n            :meth:`draw_mncontour`\n\n        .. plot:: pyplots/draw_mncontour.py\n            :include-source:\n\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_79mncontour_grid(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_nsigma = 0;
  PyObject *__pyx_v_numpoints = 0;
  int __pyx_v_sigma_res;
  PyObject *__pyx_v_edges = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mncontour_grid (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_bins,&__pyx_n_s_nsigma,&__pyx_n_s_numpoints,&__pyx_n_s_sigma_res,&__pyx_n_s_edges,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_int_100);
    values[3] = ((PyObject *)__pyx_int_2);
    values[4] = ((PyObject *)__pyx_int_20);

    /* "iminuit/_libiminuit.pyx":1142
 * 
 *     def mncontour_grid(self, x, y, bins=100, nsigma=2, numpoints=20,
 *                        int sigma_res=4, edges=False):             # <<<<<<<<<<<<<<
 *         """Compute gridded minos contour.
 * 
 */
    values[6] = ((PyObject *)Py_False);
    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);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mncontour_grid", 0, 2, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nsigma);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numpoints);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sigma_res);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_edges);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mncontour_grid") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_x = values[0];
    __pyx_v_y = values[1];
    __pyx_v_bins = values[2];
    __pyx_v_nsigma = values[3];
    __pyx_v_numpoints = values[4];
    if (values[5]) {
      __pyx_v_sigma_res = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_sigma_res == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_sigma_res = ((int)4);
    }
    __pyx_v_edges = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mncontour_grid", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.mncontour_grid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_78mncontour_grid(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_bins, __pyx_v_nsigma, __pyx_v_numpoints, __pyx_v_sigma_res, __pyx_v_edges);

  /* "iminuit/_libiminuit.pyx":1141
 *         return xminos, yminos, cerr.Points()  #using type coersion here
 * 
 *     def mncontour_grid(self, x, y, bins=100, nsigma=2, numpoints=20,             # <<<<<<<<<<<<<<
 *                        int sigma_res=4, edges=False):
 *         """Compute gridded minos contour.
 */

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_78mncontour_grid(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_bins, PyObject *__pyx_v_nsigma, PyObject *__pyx_v_numpoints, int __pyx_v_sigma_res, PyObject *__pyx_v_edges) {
  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;
  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("mncontour_grid", 0);

  /* "iminuit/_libiminuit.pyx":1176
 * 
 *         """
 *         return _plotting.mncontour_grid(self, x, y, numpoints,             # <<<<<<<<<<<<<<
 *                                         nsigma, sigma_res, bins, edges)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_plotting); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mncontour_grid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":1177
 *         """
 *         return _plotting.mncontour_grid(self, x, y, numpoints,
 *                                         nsigma, sigma_res, bins, edges)             # <<<<<<<<<<<<<<
 * 
 *     def draw_mncontour(self, x, y, bins=100, nsigma=2,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_sigma_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_6 = PyTuple_New(8+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __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_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_y);
  __Pyx_INCREF(__pyx_v_numpoints);
  __Pyx_GIVEREF(__pyx_v_numpoints);
  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_numpoints);
  __Pyx_INCREF(__pyx_v_nsigma);
  __Pyx_GIVEREF(__pyx_v_nsigma);
  PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_nsigma);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_5, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_6, 6+__pyx_t_5, __pyx_v_bins);
  __Pyx_INCREF(__pyx_v_edges);
  __Pyx_GIVEREF(__pyx_v_edges);
  PyTuple_SET_ITEM(__pyx_t_6, 7+__pyx_t_5, __pyx_v_edges);
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":1141
 *         return xminos, yminos, cerr.Points()  #using type coersion here
 * 
 *     def mncontour_grid(self, x, y, bins=100, nsigma=2, numpoints=20,             # <<<<<<<<<<<<<<
 *                        int sigma_res=4, edges=False):
 *         """Compute gridded minos contour.
 */

  /* 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("iminuit._libiminuit.Minuit.mncontour_grid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1179
 *                                         nsigma, sigma_res, bins, edges)
 * 
 *     def draw_mncontour(self, x, y, bins=100, nsigma=2,             # <<<<<<<<<<<<<<
 *                        numpoints=20, sigma_res=4):
 *         """Draw minos contour.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_81draw_mncontour(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_80draw_mncontour[] = "Minuit.draw_mncontour(self, x, y, bins=100, nsigma=2, numpoints=20, sigma_res=4)\nDraw minos contour.\n\n        **Arguments:**\n\n            - **x**, **y** parameter name\n\n            - **bins** number of bin in contour grid.\n\n            - **nsigma** number of sigma contour to draw\n\n            - **numpoints** number of points to calculate for each contour\n\n            - **sigma_res** number of sigma level to calculate MnContours.\n              Default 4.\n\n        **Returns:**\n\n            x, y, gridvalue, contour\n\n            gridvalue is interorlated nsigma\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_81draw_mncontour(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_nsigma = 0;
  PyObject *__pyx_v_numpoints = 0;
  PyObject *__pyx_v_sigma_res = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_mncontour (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_bins,&__pyx_n_s_nsigma,&__pyx_n_s_numpoints,&__pyx_n_s_sigma_res,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_int_100);
    values[3] = ((PyObject *)__pyx_int_2);
    values[4] = ((PyObject *)__pyx_int_20);
    values[5] = ((PyObject *)__pyx_int_4);
    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);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_mncontour", 0, 2, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nsigma);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_numpoints);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sigma_res);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_mncontour") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_x = values[0];
    __pyx_v_y = values[1];
    __pyx_v_bins = values[2];
    __pyx_v_nsigma = values[3];
    __pyx_v_numpoints = values[4];
    __pyx_v_sigma_res = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_mncontour", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.draw_mncontour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_80draw_mncontour(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_bins, __pyx_v_nsigma, __pyx_v_numpoints, __pyx_v_sigma_res);

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_80draw_mncontour(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_bins, PyObject *__pyx_v_nsigma, PyObject *__pyx_v_numpoints, PyObject *__pyx_v_sigma_res) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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("draw_mncontour", 0);

  /* "iminuit/_libiminuit.pyx":1202
 *             gridvalue is interorlated nsigma
 *         """
 *         return _plotting.draw_mncontour(self, x, y, bins, nsigma,             # <<<<<<<<<<<<<<
 *                                         numpoints, sigma_res)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_plotting); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_draw_mncontour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":1203
 *         """
 *         return _plotting.draw_mncontour(self, x, y, bins, nsigma,
 *                                         numpoints, sigma_res)             # <<<<<<<<<<<<<<
 * 
 *     def draw_contour(self, x, y, bins=20, bound=2, args=None,
 */
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_5 = PyTuple_New(7+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __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_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_y);
  __Pyx_INCREF(__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_bins);
  __Pyx_INCREF(__pyx_v_nsigma);
  __Pyx_GIVEREF(__pyx_v_nsigma);
  PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_nsigma);
  __Pyx_INCREF(__pyx_v_numpoints);
  __Pyx_GIVEREF(__pyx_v_numpoints);
  PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_numpoints);
  __Pyx_INCREF(__pyx_v_sigma_res);
  __Pyx_GIVEREF(__pyx_v_sigma_res);
  PyTuple_SET_ITEM(__pyx_t_5, 6+__pyx_t_4, __pyx_v_sigma_res);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":1179
 *                                         nsigma, sigma_res, bins, edges)
 * 
 *     def draw_mncontour(self, x, y, bins=100, nsigma=2,             # <<<<<<<<<<<<<<
 *                        numpoints=20, sigma_res=4):
 *         """Draw minos contour.
 */

  /* 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("iminuit._libiminuit.Minuit.draw_mncontour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1205
 *                                         numpoints, sigma_res)
 * 
 *     def draw_contour(self, x, y, bins=20, bound=2, args=None,             # <<<<<<<<<<<<<<
 *                      show_sigma=False):
 *         """Convenience wrapper for drawing contours.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_83draw_contour(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_82draw_contour[] = "Minuit.draw_contour(self, x, y, bins=20, bound=2, args=None, show_sigma=False)\nConvenience wrapper for drawing contours.\n\n        The argument is the same as :meth:`contour`.\n        If `show_sigma=True`(Default), the label on the contour lines will show\n        how many :math:`\\sigma` away from the optimal value instead of raw value.\n\n        .. note::\n\n            Like :meth:`contour`, the error shown on the plot is not strictly the\n            1 :math:`\\sigma` contour since the other parameters are fixed.\n\n        .. seealso::\n\n            :meth:`contour`\n            :meth:`mncontour`\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_83draw_contour(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_bound = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_show_sigma = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_contour (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_bins,&__pyx_n_s_bound,&__pyx_n_s_args,&__pyx_n_s_show_sigma,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_int_20);
    values[3] = ((PyObject *)__pyx_int_2);
    values[4] = ((PyObject *)Py_None);

    /* "iminuit/_libiminuit.pyx":1206
 * 
 *     def draw_contour(self, x, y, bins=20, bound=2, args=None,
 *                      show_sigma=False):             # <<<<<<<<<<<<<<
 *         """Convenience wrapper for drawing contours.
 * 
 */
    values[5] = ((PyObject *)Py_False);
    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);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_contour", 0, 2, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bins);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bound);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_show_sigma);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_contour") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_x = values[0];
    __pyx_v_y = values[1];
    __pyx_v_bins = values[2];
    __pyx_v_bound = values[3];
    __pyx_v_args = values[4];
    __pyx_v_show_sigma = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_contour", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.draw_contour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_82draw_contour(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_bins, __pyx_v_bound, __pyx_v_args, __pyx_v_show_sigma);

  /* "iminuit/_libiminuit.pyx":1205
 *                                         numpoints, sigma_res)
 * 
 *     def draw_contour(self, x, y, bins=20, bound=2, args=None,             # <<<<<<<<<<<<<<
 *                      show_sigma=False):
 *         """Convenience wrapper for drawing contours.
 */

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_82draw_contour(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_bins, PyObject *__pyx_v_bound, PyObject *__pyx_v_args, PyObject *__pyx_v_show_sigma) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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("draw_contour", 0);

  /* "iminuit/_libiminuit.pyx":1223
 *             :meth:`mncontour`
 *         """
 *         return _plotting.draw_contour(self, x, y, bins,             # <<<<<<<<<<<<<<
 *                                       bound, args, show_sigma)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_plotting); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_draw_contour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":1224
 *         """
 *         return _plotting.draw_contour(self, x, y, bins,
 *                                       bound, args, show_sigma)             # <<<<<<<<<<<<<<
 * 
 *     cdef refreshInternalState(self):
 */
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_5 = PyTuple_New(7+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __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_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_y);
  __Pyx_INCREF(__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_bins);
  __Pyx_INCREF(__pyx_v_bound);
  __Pyx_GIVEREF(__pyx_v_bound);
  PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_bound);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_args);
  __Pyx_INCREF(__pyx_v_show_sigma);
  __Pyx_GIVEREF(__pyx_v_show_sigma);
  PyTuple_SET_ITEM(__pyx_t_5, 6+__pyx_t_4, __pyx_v_show_sigma);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __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;

  /* "iminuit/_libiminuit.pyx":1205
 *                                         numpoints, sigma_res)
 * 
 *     def draw_contour(self, x, y, bins=20, bound=2, args=None,             # <<<<<<<<<<<<<<
 *                      show_sigma=False):
 *         """Convenience wrapper for drawing contours.
 */

  /* 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("iminuit._libiminuit.Minuit.draw_contour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1226
 *                                       bound, args, show_sigma)
 * 
 *     cdef refreshInternalState(self):             # <<<<<<<<<<<<<<
 *         """Refresh internal state attributes.
 * 
 */

static PyObject *__pyx_f_7iminuit_11_libiminuit_6Minuit_refreshInternalState(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  std::vector<MinuitParameter>  __pyx_v_mpv;
  MnUserCovariance __pyx_v_cov;
  CYTHON_UNUSED double __pyx_v_tmp;
  size_t __pyx_v_i;
  PyObject *__pyx_v_vary_param = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  size_t __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;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  Py_ssize_t __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  unsigned int __pyx_t_18;
  unsigned int __pyx_t_19;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("refreshInternalState", 0);

  /* "iminuit/_libiminuit.pyx":1234
 *         cdef vector[MinuitParameter] mpv
 *         cdef MnUserCovariance cov
 *         cdef double tmp = 0             # <<<<<<<<<<<<<<
 *         if self.last_upst is not NULL:
 *             mpv = self.last_upst.MinuitParameters()
 */
  __pyx_v_tmp = 0.0;

  /* "iminuit/_libiminuit.pyx":1235
 *         cdef MnUserCovariance cov
 *         cdef double tmp = 0
 *         if self.last_upst is not NULL:             # <<<<<<<<<<<<<<
 *             mpv = self.last_upst.MinuitParameters()
 *             self.values = {}
 */
  __pyx_t_1 = ((__pyx_v_self->last_upst != NULL) != 0);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":1236
 *         cdef double tmp = 0
 *         if self.last_upst is not NULL:
 *             mpv = self.last_upst.MinuitParameters()             # <<<<<<<<<<<<<<
 *             self.values = {}
 *             self.errors = {}
 */
    __pyx_v_mpv = __pyx_v_self->last_upst->MinuitParameters();

    /* "iminuit/_libiminuit.pyx":1237
 *         if self.last_upst is not NULL:
 *             mpv = self.last_upst.MinuitParameters()
 *             self.values = {}             # <<<<<<<<<<<<<<
 *             self.errors = {}
 *             self.args = []
 */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->values);
    __Pyx_DECREF(__pyx_v_self->values);
    __pyx_v_self->values = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1238
 *             mpv = self.last_upst.MinuitParameters()
 *             self.values = {}
 *             self.errors = {}             # <<<<<<<<<<<<<<
 *             self.args = []
 *             for i in range(mpv.size()):
 */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->errors);
    __Pyx_DECREF(__pyx_v_self->errors);
    __pyx_v_self->errors = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1239
 *             self.values = {}
 *             self.errors = {}
 *             self.args = []             # <<<<<<<<<<<<<<
 *             for i in range(mpv.size()):
 *                 self.args.append(mpv[i].Value())
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->args);
    __Pyx_DECREF(__pyx_v_self->args);
    __pyx_v_self->args = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1240
 *             self.errors = {}
 *             self.args = []
 *             for i in range(mpv.size()):             # <<<<<<<<<<<<<<
 *                 self.args.append(mpv[i].Value())
 *                 self.values[mpv[i].Name()] = mpv[i].Value()
 */
    __pyx_t_3 = __pyx_v_mpv.size();
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "iminuit/_libiminuit.pyx":1241
 *             self.args = []
 *             for i in range(mpv.size()):
 *                 self.args.append(mpv[i].Value())             # <<<<<<<<<<<<<<
 *                 self.values[mpv[i].Name()] = mpv[i].Value()
 *                 self.errors[mpv[i].Name()] = mpv[i].Error()
 */
      __pyx_t_2 = PyFloat_FromDouble((__pyx_v_mpv[__pyx_v_i]).Value()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "iminuit/_libiminuit.pyx":1242
 *             for i in range(mpv.size()):
 *                 self.args.append(mpv[i].Value())
 *                 self.values[mpv[i].Name()] = mpv[i].Value()             # <<<<<<<<<<<<<<
 *                 self.errors[mpv[i].Name()] = mpv[i].Error()
 *             self.args = tuple(self.args)
 */
      __pyx_t_2 = PyFloat_FromDouble((__pyx_v_mpv[__pyx_v_i]).Value()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyStr_FromString((__pyx_v_mpv[__pyx_v_i]).Name()); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(PyObject_SetItem(__pyx_v_self->values, __pyx_t_6, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "iminuit/_libiminuit.pyx":1243
 *                 self.args.append(mpv[i].Value())
 *                 self.values[mpv[i].Name()] = mpv[i].Value()
 *                 self.errors[mpv[i].Name()] = mpv[i].Error()             # <<<<<<<<<<<<<<
 *             self.args = tuple(self.args)
 *             self.fitarg.update(self.values)
 */
      __pyx_t_2 = PyFloat_FromDouble((__pyx_v_mpv[__pyx_v_i]).Error()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyStr_FromString((__pyx_v_mpv[__pyx_v_i]).Name()); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(PyObject_SetItem(__pyx_v_self->errors, __pyx_t_6, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }

    /* "iminuit/_libiminuit.pyx":1244
 *                 self.values[mpv[i].Name()] = mpv[i].Value()
 *                 self.errors[mpv[i].Name()] = mpv[i].Error()
 *             self.args = tuple(self.args)             # <<<<<<<<<<<<<<
 *             self.fitarg.update(self.values)
 *             self.fitarg.update({'error_' + k: v for k, v in self.errors.items()})
 */
    __pyx_t_2 = PySequence_Tuple(__pyx_v_self->args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->args);
    __Pyx_DECREF(__pyx_v_self->args);
    __pyx_v_self->args = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1245
 *                 self.errors[mpv[i].Name()] = mpv[i].Error()
 *             self.args = tuple(self.args)
 *             self.fitarg.update(self.values)             # <<<<<<<<<<<<<<
 *             self.fitarg.update({'error_' + k: v for k, v in self.errors.items()})
 *             vary_param = self.list_of_vary_param()
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->fitarg, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_self->values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_self->values);
      __Pyx_GIVEREF(__pyx_v_self->values);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_self->values);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1246
 *             self.args = tuple(self.args)
 *             self.fitarg.update(self.values)
 *             self.fitarg.update({'error_' + k: v for k, v in self.errors.items()})             # <<<<<<<<<<<<<<
 *             vary_param = self.list_of_vary_param()
 *             if self.last_upst.HasCovariance():
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->fitarg, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    { /* enter inner scope */
      PyObject *__pyx_9genexpr21__pyx_v_k = NULL;
      PyObject *__pyx_9genexpr21__pyx_v_v = NULL;
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->errors, __pyx_n_s_items); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (__pyx_t_10) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else {
        __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      }
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_9 = __pyx_t_7; __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_12)) {
          if (likely(PyList_CheckExact(__pyx_t_9))) {
            if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_12(__pyx_t_9);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
          PyObject* sequence = __pyx_t_7;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_13);
          #else
          __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_13);
          #endif
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext;
          index = 0; __pyx_t_10 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_10)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_13);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __pyx_t_15 = NULL;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          goto __pyx_L12_unpacking_done;
          __pyx_L11_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_15 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __pyx_L12_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_k, __pyx_t_10);
        __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_v, __pyx_t_13);
        __pyx_t_13 = 0;
        __pyx_t_7 = PyNumber_Add(__pyx_n_u_error_2, __pyx_9genexpr21__pyx_v_k); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_7);
        if (unlikely(PyDict_SetItem(__pyx_t_8, (PyObject*)__pyx_t_7, (PyObject*)__pyx_9genexpr21__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_k);
      __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_v);
      goto __pyx_L13_exit_scope;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_k);
      __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_v);
      goto __pyx_L1_error;
      __pyx_L13_exit_scope:;
    } /* exit inner scope */
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1247
 *             self.fitarg.update(self.values)
 *             self.fitarg.update({'error_' + k: v for k, v in self.errors.items()})
 *             vary_param = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 *             if self.last_upst.HasCovariance():
 *                 cov = self.last_upst.Covariance()
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list_of_vary_param); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_vary_param = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1248
 *             self.fitarg.update({'error_' + k: v for k, v in self.errors.items()})
 *             vary_param = self.list_of_vary_param()
 *             if self.last_upst.HasCovariance():             # <<<<<<<<<<<<<<
 *                 cov = self.last_upst.Covariance()
 *                 self.covariance = \
 */
    __pyx_t_1 = (__pyx_v_self->last_upst->HasCovariance() != 0);
    if (__pyx_t_1) {

      /* "iminuit/_libiminuit.pyx":1249
 *             vary_param = self.list_of_vary_param()
 *             if self.last_upst.HasCovariance():
 *                 cov = self.last_upst.Covariance()             # <<<<<<<<<<<<<<
 *                 self.covariance = \
 *                     {(v1, v2): cov.get(i, j) \
 */
      __pyx_v_cov = __pyx_v_self->last_upst->Covariance();

      /* "iminuit/_libiminuit.pyx":1251
 *                 cov = self.last_upst.Covariance()
 *                 self.covariance = \
 *                     {(v1, v2): cov.get(i, j) \             # <<<<<<<<<<<<<<
 *                      for i, v1 in enumerate(vary_param) \
 *                      for j, v2 in enumerate(vary_param)}
 */
      { /* enter inner scope */
        PyObject *__pyx_9genexpr22__pyx_v_i = NULL;
        PyObject *__pyx_9genexpr22__pyx_v_v1 = NULL;
        PyObject *__pyx_9genexpr22__pyx_v_j = NULL;
        PyObject *__pyx_9genexpr22__pyx_v_v2 = NULL;
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_6 = __pyx_int_0;

        /* "iminuit/_libiminuit.pyx":1252
 *                 self.covariance = \
 *                     {(v1, v2): cov.get(i, j) \
 *                      for i, v1 in enumerate(vary_param) \             # <<<<<<<<<<<<<<
 *                      for j, v2 in enumerate(vary_param)}
 *             else:
 */
        if (likely(PyList_CheckExact(__pyx_v_vary_param)) || PyTuple_CheckExact(__pyx_v_vary_param)) {
          __pyx_t_7 = __pyx_v_vary_param; __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = 0;
          __pyx_t_12 = NULL;
        } else {
          __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_vary_param); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_12 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        }
        for (;;) {
          if (likely(!__pyx_t_12)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              #else
              __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            } else {
              if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              #else
              __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            }
          } else {
            __pyx_t_8 = __pyx_t_12(__pyx_t_7);
            if (unlikely(!__pyx_t_8)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_8);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_v1, __pyx_t_8);
          __pyx_t_8 = 0;
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_i, __pyx_t_6);
          __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6);
          __pyx_t_6 = __pyx_t_8;
          __pyx_t_8 = 0;

          /* "iminuit/_libiminuit.pyx":1253
 *                     {(v1, v2): cov.get(i, j) \
 *                      for i, v1 in enumerate(vary_param) \
 *                      for j, v2 in enumerate(vary_param)}             # <<<<<<<<<<<<<<
 *             else:
 *                 self.covariance = None
 */
          __Pyx_INCREF(__pyx_int_0);
          __pyx_t_8 = __pyx_int_0;
          if (likely(PyList_CheckExact(__pyx_v_vary_param)) || PyTuple_CheckExact(__pyx_v_vary_param)) {
            __pyx_t_9 = __pyx_v_vary_param; __Pyx_INCREF(__pyx_t_9); __pyx_t_16 = 0;
            __pyx_t_17 = NULL;
          } else {
            __pyx_t_16 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_vary_param); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_17 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          for (;;) {
            if (likely(!__pyx_t_17)) {
              if (likely(PyList_CheckExact(__pyx_t_9))) {
                if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_9)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_13 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_13); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                #else
                __pyx_t_13 = PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_13);
                #endif
              } else {
                if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_13); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                #else
                __pyx_t_13 = PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                __Pyx_GOTREF(__pyx_t_13);
                #endif
              }
            } else {
              __pyx_t_13 = __pyx_t_17(__pyx_t_9);
              if (unlikely(!__pyx_t_13)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_13);
            }
            __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_v2, __pyx_t_13);
            __pyx_t_13 = 0;
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_j, __pyx_t_8);
            __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_8);
            __pyx_t_8 = __pyx_t_13;
            __pyx_t_13 = 0;

            /* "iminuit/_libiminuit.pyx":1251
 *                 cov = self.last_upst.Covariance()
 *                 self.covariance = \
 *                     {(v1, v2): cov.get(i, j) \             # <<<<<<<<<<<<<<
 *                      for i, v1 in enumerate(vary_param) \
 *                      for j, v2 in enumerate(vary_param)}
 */
            __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_INCREF(__pyx_9genexpr22__pyx_v_v1);
            __Pyx_GIVEREF(__pyx_9genexpr22__pyx_v_v1);
            PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_9genexpr22__pyx_v_v1);
            __Pyx_INCREF(__pyx_9genexpr22__pyx_v_v2);
            __Pyx_GIVEREF(__pyx_9genexpr22__pyx_v_v2);
            PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_9genexpr22__pyx_v_v2);
            __pyx_t_18 = __Pyx_PyInt_As_unsigned_int(__pyx_9genexpr22__pyx_v_i); if (unlikely((__pyx_t_18 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __pyx_t_19 = __Pyx_PyInt_As_unsigned_int(__pyx_9genexpr22__pyx_v_j); if (unlikely((__pyx_t_19 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __pyx_t_10 = PyFloat_FromDouble(__pyx_v_cov.operator()(__pyx_t_18, __pyx_t_19)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_10);
            if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_13, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

            /* "iminuit/_libiminuit.pyx":1253
 *                     {(v1, v2): cov.get(i, j) \
 *                      for i, v1 in enumerate(vary_param) \
 *                      for j, v2 in enumerate(vary_param)}             # <<<<<<<<<<<<<<
 *             else:
 *                 self.covariance = None
 */
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "iminuit/_libiminuit.pyx":1252
 *                 self.covariance = \
 *                     {(v1, v2): cov.get(i, j) \
 *                      for i, v1 in enumerate(vary_param) \             # <<<<<<<<<<<<<<
 *                      for j, v2 in enumerate(vary_param)}
 *             else:
 */
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_i);
        __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_v1);
        __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_j);
        __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_v2);
        goto __pyx_L22_exit_scope;
        __pyx_L17_error:;
        __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_i);
        __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_v1);
        __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_j);
        __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_v2);
        goto __pyx_L1_error;
        __pyx_L22_exit_scope:;
      } /* exit inner scope */

      /* "iminuit/_libiminuit.pyx":1250
 *             if self.last_upst.HasCovariance():
 *                 cov = self.last_upst.Covariance()
 *                 self.covariance = \             # <<<<<<<<<<<<<<
 *                     {(v1, v2): cov.get(i, j) \
 *                      for i, v1 in enumerate(vary_param) \
 */
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->covariance);
      __Pyx_DECREF(__pyx_v_self->covariance);
      __pyx_v_self->covariance = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "iminuit/_libiminuit.pyx":1248
 *             self.fitarg.update({'error_' + k: v for k, v in self.errors.items()})
 *             vary_param = self.list_of_vary_param()
 *             if self.last_upst.HasCovariance():             # <<<<<<<<<<<<<<
 *                 cov = self.last_upst.Covariance()
 *                 self.covariance = \
 */
      goto __pyx_L14;
    }

    /* "iminuit/_libiminuit.pyx":1255
 *                      for j, v2 in enumerate(vary_param)}
 *             else:
 *                 self.covariance = None             # <<<<<<<<<<<<<<
 *             self.fval = self.last_upst.Fval()
 *             self.ncalls = self.last_upst.NFcn()
 */
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->covariance);
      __Pyx_DECREF(__pyx_v_self->covariance);
      __pyx_v_self->covariance = Py_None;
    }
    __pyx_L14:;

    /* "iminuit/_libiminuit.pyx":1256
 *             else:
 *                 self.covariance = None
 *             self.fval = self.last_upst.Fval()             # <<<<<<<<<<<<<<
 *             self.ncalls = self.last_upst.NFcn()
 *             self.edm = self.last_upst.Edm()
 */
    __pyx_v_self->fval = __pyx_v_self->last_upst->Fval();

    /* "iminuit/_libiminuit.pyx":1257
 *                 self.covariance = None
 *             self.fval = self.last_upst.Fval()
 *             self.ncalls = self.last_upst.NFcn()             # <<<<<<<<<<<<<<
 *             self.edm = self.last_upst.Edm()
 *             self.gcc = None
 */
    __pyx_v_self->ncalls = __pyx_v_self->last_upst->NFcn();

    /* "iminuit/_libiminuit.pyx":1258
 *             self.fval = self.last_upst.Fval()
 *             self.ncalls = self.last_upst.NFcn()
 *             self.edm = self.last_upst.Edm()             # <<<<<<<<<<<<<<
 *             self.gcc = None
 *             if self.last_upst.HasGlobalCC() and self.last_upst.GlobalCC().IsValid():
 */
    __pyx_v_self->edm = __pyx_v_self->last_upst->Edm();

    /* "iminuit/_libiminuit.pyx":1259
 *             self.ncalls = self.last_upst.NFcn()
 *             self.edm = self.last_upst.Edm()
 *             self.gcc = None             # <<<<<<<<<<<<<<
 *             if self.last_upst.HasGlobalCC() and self.last_upst.GlobalCC().IsValid():
 *                 self.gcc = {v: self.last_upst.GlobalCC().GlobalCC()[i] for \
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->gcc);
    __Pyx_DECREF(__pyx_v_self->gcc);
    __pyx_v_self->gcc = Py_None;

    /* "iminuit/_libiminuit.pyx":1260
 *             self.edm = self.last_upst.Edm()
 *             self.gcc = None
 *             if self.last_upst.HasGlobalCC() and self.last_upst.GlobalCC().IsValid():             # <<<<<<<<<<<<<<
 *                 self.gcc = {v: self.last_upst.GlobalCC().GlobalCC()[i] for \
 *                             i, v in enumerate(self.list_of_vary_param())}
 */
    __pyx_t_20 = (__pyx_v_self->last_upst->HasGlobalCC() != 0);
    if (__pyx_t_20) {
    } else {
      __pyx_t_1 = __pyx_t_20;
      goto __pyx_L24_bool_binop_done;
    }
    __pyx_t_20 = (__pyx_v_self->last_upst->GlobalCC().IsValid() != 0);
    __pyx_t_1 = __pyx_t_20;
    __pyx_L24_bool_binop_done:;
    if (__pyx_t_1) {

      /* "iminuit/_libiminuit.pyx":1261
 *             self.gcc = None
 *             if self.last_upst.HasGlobalCC() and self.last_upst.GlobalCC().IsValid():
 *                 self.gcc = {v: self.last_upst.GlobalCC().GlobalCC()[i] for \             # <<<<<<<<<<<<<<
 *                             i, v in enumerate(self.list_of_vary_param())}
 * 
 */
      { /* enter inner scope */
        PyObject *__pyx_9genexpr23__pyx_v_i = NULL;
        PyObject *__pyx_9genexpr23__pyx_v_v = NULL;
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_6 = __pyx_int_0;

        /* "iminuit/_libiminuit.pyx":1262
 *             if self.last_upst.HasGlobalCC() and self.last_upst.GlobalCC().IsValid():
 *                 self.gcc = {v: self.last_upst.GlobalCC().GlobalCC()[i] for \
 *                             i, v in enumerate(self.list_of_vary_param())}             # <<<<<<<<<<<<<<
 * 
 *         self.merrors = {(k, 1.0): v.upper
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list_of_vary_param); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
          }
        }
        if (__pyx_t_9) {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else {
          __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
        }
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
          __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = 0;
          __pyx_t_12 = NULL;
        } else {
          __pyx_t_11 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        for (;;) {
          if (likely(!__pyx_t_12)) {
            if (likely(PyList_CheckExact(__pyx_t_8))) {
              if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            } else {
              if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            }
          } else {
            __pyx_t_7 = __pyx_t_12(__pyx_t_8);
            if (unlikely(!__pyx_t_7)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_v, __pyx_t_7);
          __pyx_t_7 = 0;
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_i, __pyx_t_6);
          __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6);
          __pyx_t_6 = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "iminuit/_libiminuit.pyx":1261
 *             self.gcc = None
 *             if self.last_upst.HasGlobalCC() and self.last_upst.GlobalCC().IsValid():
 *                 self.gcc = {v: self.last_upst.GlobalCC().GlobalCC()[i] for \             # <<<<<<<<<<<<<<
 *                             i, v in enumerate(self.list_of_vary_param())}
 * 
 */
          __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_9genexpr23__pyx_v_i); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
          __pyx_t_7 = PyFloat_FromDouble((__pyx_v_self->last_upst->GlobalCC().GlobalCC()[__pyx_t_3])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
          __Pyx_GOTREF(__pyx_t_7);
          if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr23__pyx_v_v, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_i);
        __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_v);
        goto __pyx_L31_exit_scope;
        __pyx_L28_error:;
        __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_i);
        __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_v);
        goto __pyx_L1_error;
        __pyx_L31_exit_scope:;
      } /* exit inner scope */
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->gcc);
      __Pyx_DECREF(__pyx_v_self->gcc);
      __pyx_v_self->gcc = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "iminuit/_libiminuit.pyx":1260
 *             self.edm = self.last_upst.Edm()
 *             self.gcc = None
 *             if self.last_upst.HasGlobalCC() and self.last_upst.GlobalCC().IsValid():             # <<<<<<<<<<<<<<
 *                 self.gcc = {v: self.last_upst.GlobalCC().GlobalCC()[i] for \
 *                             i, v in enumerate(self.list_of_vary_param())}
 */
    }

    /* "iminuit/_libiminuit.pyx":1235
 *         cdef MnUserCovariance cov
 *         cdef double tmp = 0
 *         if self.last_upst is not NULL:             # <<<<<<<<<<<<<<
 *             mpv = self.last_upst.MinuitParameters()
 *             self.values = {}
 */
  }

  /* "iminuit/_libiminuit.pyx":1264
 *                             i, v in enumerate(self.list_of_vary_param())}
 * 
 *         self.merrors = {(k, 1.0): v.upper             # <<<<<<<<<<<<<<
 *                         for k, v in self.merrors_struct.items()}
 *         self.merrors.update({(k, -1.0): v.lower
 */
  { /* enter inner scope */
    PyObject *__pyx_9genexpr24__pyx_v_k = NULL;
    PyObject *__pyx_9genexpr24__pyx_v_v = NULL;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "iminuit/_libiminuit.pyx":1265
 * 
 *         self.merrors = {(k, 1.0): v.upper
 *                         for k, v in self.merrors_struct.items()}             # <<<<<<<<<<<<<<
 *         self.merrors.update({(k, -1.0): v.lower
 *                              for k, v in self.merrors_struct.items()})
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->merrors_struct, __pyx_n_s_items); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_8 = __pyx_t_6; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_12(__pyx_t_8);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
        PyObject* sequence = __pyx_t_6;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_15 = Py_TYPE(__pyx_t_10)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_15(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L37_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_9 = __pyx_t_15(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L37_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
        __pyx_t_15 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L38_unpacking_done;
        __pyx_L37_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_15 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
        __pyx_L38_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_k, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_v, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "iminuit/_libiminuit.pyx":1264
 *                             i, v in enumerate(self.list_of_vary_param())}
 * 
 *         self.merrors = {(k, 1.0): v.upper             # <<<<<<<<<<<<<<
 *                         for k, v in self.merrors_struct.items()}
 *         self.merrors.update({(k, -1.0): v.lower
 */
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_9genexpr24__pyx_v_k);
      __Pyx_GIVEREF(__pyx_9genexpr24__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr24__pyx_v_k);
      __Pyx_INCREF(__pyx_float_1_0);
      __Pyx_GIVEREF(__pyx_float_1_0);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_float_1_0);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr24__pyx_v_v, __pyx_n_s_upper); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_6, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "iminuit/_libiminuit.pyx":1265
 * 
 *         self.merrors = {(k, 1.0): v.upper
 *                         for k, v in self.merrors_struct.items()}             # <<<<<<<<<<<<<<
 *         self.merrors.update({(k, -1.0): v.lower
 *                              for k, v in self.merrors_struct.items()})
 */
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_v);
    goto __pyx_L39_exit_scope;
    __pyx_L34_error:;
    __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L39_exit_scope:;
  } /* exit inner scope */

  /* "iminuit/_libiminuit.pyx":1264
 *                             i, v in enumerate(self.list_of_vary_param())}
 * 
 *         self.merrors = {(k, 1.0): v.upper             # <<<<<<<<<<<<<<
 *                         for k, v in self.merrors_struct.items()}
 *         self.merrors.update({(k, -1.0): v.lower
 */
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->merrors);
  __Pyx_DECREF(__pyx_v_self->merrors);
  __pyx_v_self->merrors = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":1266
 *         self.merrors = {(k, 1.0): v.upper
 *                         for k, v in self.merrors_struct.items()}
 *         self.merrors.update({(k, -1.0): v.lower             # <<<<<<<<<<<<<<
 *                              for k, v in self.merrors_struct.items()})
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->merrors, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  { /* enter inner scope */
    PyObject *__pyx_9genexpr25__pyx_v_k = NULL;
    PyObject *__pyx_9genexpr25__pyx_v_v = NULL;
    __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
    __Pyx_GOTREF(__pyx_t_9);

    /* "iminuit/_libiminuit.pyx":1267
 *                         for k, v in self.merrors_struct.items()}
 *         self.merrors.update({(k, -1.0): v.lower
 *                              for k, v in self.merrors_struct.items()})             # <<<<<<<<<<<<<<
 * 
 *     cdef MnUserParameterState*initialParameterState(self) except *:
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->merrors_struct, __pyx_n_s_items); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (__pyx_t_10) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else {
      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_12(__pyx_t_7);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
        PyObject* sequence = __pyx_t_6;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_13);
        #else
        __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        __Pyx_GOTREF(__pyx_t_13);
        #endif
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext;
        index = 0; __pyx_t_10 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_10)) goto __pyx_L45_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L45_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_13);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        __pyx_t_15 = NULL;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L46_unpacking_done;
        __pyx_L45_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_15 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
        __pyx_L46_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_k, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_v, __pyx_t_13);
      __pyx_t_13 = 0;

      /* "iminuit/_libiminuit.pyx":1266
 *         self.merrors = {(k, 1.0): v.upper
 *                         for k, v in self.merrors_struct.items()}
 *         self.merrors.update({(k, -1.0): v.lower             # <<<<<<<<<<<<<<
 *                              for k, v in self.merrors_struct.items()})
 * 
 */
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_9genexpr25__pyx_v_k);
      __Pyx_GIVEREF(__pyx_9genexpr25__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr25__pyx_v_k);
      __Pyx_INCREF(__pyx_float_neg_1_0);
      __Pyx_GIVEREF(__pyx_float_neg_1_0);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_float_neg_1_0);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr25__pyx_v_v, __pyx_n_s_lower); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
      __Pyx_GOTREF(__pyx_t_13);
      if (unlikely(PyDict_SetItem(__pyx_t_9, (PyObject*)__pyx_t_6, (PyObject*)__pyx_t_13))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "iminuit/_libiminuit.pyx":1267
 *                         for k, v in self.merrors_struct.items()}
 *         self.merrors.update({(k, -1.0): v.lower
 *                              for k, v in self.merrors_struct.items()})             # <<<<<<<<<<<<<<
 * 
 *     cdef MnUserParameterState*initialParameterState(self) except *:
 */
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_v);
    goto __pyx_L47_exit_scope;
    __pyx_L42_error:;
    __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L47_exit_scope:;
  } /* exit inner scope */
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":1226
 *                                       bound, args, show_sigma)
 * 
 *     cdef refreshInternalState(self):             # <<<<<<<<<<<<<<
 *         """Refresh internal state attributes.
 * 
 */

  /* 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_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_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.refreshInternalState", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vary_param);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1269
 *                              for k, v in self.merrors_struct.items()})
 * 
 *     cdef MnUserParameterState*initialParameterState(self) except *:             # <<<<<<<<<<<<<<
 *         """Construct parameter state from initial array.
 * 
 */

static MnUserParameterState *__pyx_f_7iminuit_11_libiminuit_6Minuit_initialParameterState(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  MnUserParameterState *__pyx_v_ret;
  PyObject *__pyx_v_lb = 0;
  PyObject *__pyx_v_ub = 0;
  PyObject *__pyx_v_v = NULL;
  MnUserParameterState *__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;
  char *__pyx_t_5;
  double __pyx_t_6;
  double __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialParameterState", 0);

  /* "iminuit/_libiminuit.pyx":1274
 *         Caller is responsible for cleaning up the pointer.
 *         """
 *         cdef MnUserParameterState*ret = new MnUserParameterState()             # <<<<<<<<<<<<<<
 *         cdef object lb
 *         cdef object ub
 */
  __pyx_v_ret = new MnUserParameterState();

  /* "iminuit/_libiminuit.pyx":1277
 *         cdef object lb
 *         cdef object ub
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             ret.Add(v, self.initialvalue[v], self.initialerror[v])
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_self->parameters)) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_1 = __pyx_v_self->parameters; __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_self->parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1278
 *         cdef object ub
 *         for v in self.parameters:
 *             ret.Add(v, self.initialvalue[v], self.initialerror[v])             # <<<<<<<<<<<<<<
 * 
 *         for v in self.parameters:
 */
    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initialvalue, __pyx_v_v); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initialerror, __pyx_v_v); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_ret->Add(__pyx_t_5, __pyx_t_6, __pyx_t_7);

    /* "iminuit/_libiminuit.pyx":1277
 *         cdef object lb
 *         cdef object ub
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             ret.Add(v, self.initialvalue[v], self.initialerror[v])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1280
 *             ret.Add(v, self.initialvalue[v], self.initialerror[v])
 * 
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             if self.initiallimit[v] is not None:
 *                 lb, ub = self.initiallimit[v]
 */
  if (likely(PyList_CheckExact(__pyx_v_self->parameters)) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_1 = __pyx_v_self->parameters; __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_self->parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1281
 * 
 *         for v in self.parameters:
 *             if self.initiallimit[v] is not None:             # <<<<<<<<<<<<<<
 *                 lb, ub = self.initiallimit[v]
 *                 if lb is not None and ub is not None and lb >= ub:
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_v); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = (__pyx_t_4 != Py_None);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = (__pyx_t_8 != 0);
    if (__pyx_t_9) {

      /* "iminuit/_libiminuit.pyx":1282
 *         for v in self.parameters:
 *             if self.initiallimit[v] is not None:
 *                 lb, ub = self.initiallimit[v]             # <<<<<<<<<<<<<<
 *                 if lb is not None and ub is not None and lb >= ub:
 *                     raise ValueError(
 */
      __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_v); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_11);
        #else
        __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
        index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_lb, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_ub, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "iminuit/_libiminuit.pyx":1283
 *             if self.initiallimit[v] is not None:
 *                 lb, ub = self.initiallimit[v]
 *                 if lb is not None and ub is not None and lb >= ub:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'limit for parameter %s is invalid. %r' % (v, (lb, ub)))
 */
      __pyx_t_8 = (__pyx_v_lb != Py_None);
      __pyx_t_14 = (__pyx_t_8 != 0);
      if (__pyx_t_14) {
      } else {
        __pyx_t_9 = __pyx_t_14;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_14 = (__pyx_v_ub != Py_None);
      __pyx_t_8 = (__pyx_t_14 != 0);
      if (__pyx_t_8) {
      } else {
        __pyx_t_9 = __pyx_t_8;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_lb, __pyx_v_ub, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = __pyx_t_8;
      __pyx_L11_bool_binop_done:;
      if (__pyx_t_9) {

        /* "iminuit/_libiminuit.pyx":1285
 *                 if lb is not None and ub is not None and lb >= ub:
 *                     raise ValueError(
 *                         'limit for parameter %s is invalid. %r' % (v, (lb, ub)))             # <<<<<<<<<<<<<<
 *                 if lb is not None and ub is None: ret.SetLowerLimit(v, lb)
 *                 if ub is not None and lb is None: ret.SetUpperLimit(v, ub)
 */
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_lb);
        __Pyx_GIVEREF(__pyx_v_lb);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lb);
        __Pyx_INCREF(__pyx_v_ub);
        __Pyx_GIVEREF(__pyx_v_ub);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_ub);
        __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_v_v);
        __Pyx_GIVEREF(__pyx_v_v);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_v);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_limit_for_parameter_s_is_invalid, __pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "iminuit/_libiminuit.pyx":1284
 *                 lb, ub = self.initiallimit[v]
 *                 if lb is not None and ub is not None and lb >= ub:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         'limit for parameter %s is invalid. %r' % (v, (lb, ub)))
 *                 if lb is not None and ub is None: ret.SetLowerLimit(v, lb)
 */
        __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "iminuit/_libiminuit.pyx":1283
 *             if self.initiallimit[v] is not None:
 *                 lb, ub = self.initiallimit[v]
 *                 if lb is not None and ub is not None and lb >= ub:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'limit for parameter %s is invalid. %r' % (v, (lb, ub)))
 */
      }

      /* "iminuit/_libiminuit.pyx":1286
 *                     raise ValueError(
 *                         'limit for parameter %s is invalid. %r' % (v, (lb, ub)))
 *                 if lb is not None and ub is None: ret.SetLowerLimit(v, lb)             # <<<<<<<<<<<<<<
 *                 if ub is not None and lb is None: ret.SetUpperLimit(v, ub)
 *                 if lb is not None and ub is not None: ret.SetLimits(v, lb, ub)
 */
      __pyx_t_8 = (__pyx_v_lb != Py_None);
      __pyx_t_14 = (__pyx_t_8 != 0);
      if (__pyx_t_14) {
      } else {
        __pyx_t_9 = __pyx_t_14;
        goto __pyx_L15_bool_binop_done;
      }
      __pyx_t_14 = (__pyx_v_ub == Py_None);
      __pyx_t_8 = (__pyx_t_14 != 0);
      __pyx_t_9 = __pyx_t_8;
      __pyx_L15_bool_binop_done:;
      if (__pyx_t_9) {
        __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_lb); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_ret->SetLowerLimit(__pyx_t_5, __pyx_t_7);
      }

      /* "iminuit/_libiminuit.pyx":1287
 *                         'limit for parameter %s is invalid. %r' % (v, (lb, ub)))
 *                 if lb is not None and ub is None: ret.SetLowerLimit(v, lb)
 *                 if ub is not None and lb is None: ret.SetUpperLimit(v, ub)             # <<<<<<<<<<<<<<
 *                 if lb is not None and ub is not None: ret.SetLimits(v, lb, ub)
 *                 #need to set value again
 */
      __pyx_t_8 = (__pyx_v_ub != Py_None);
      __pyx_t_14 = (__pyx_t_8 != 0);
      if (__pyx_t_14) {
      } else {
        __pyx_t_9 = __pyx_t_14;
        goto __pyx_L18_bool_binop_done;
      }
      __pyx_t_14 = (__pyx_v_lb == Py_None);
      __pyx_t_8 = (__pyx_t_14 != 0);
      __pyx_t_9 = __pyx_t_8;
      __pyx_L18_bool_binop_done:;
      if (__pyx_t_9) {
        __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_ub); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_ret->SetUpperLimit(__pyx_t_5, __pyx_t_7);
      }

      /* "iminuit/_libiminuit.pyx":1288
 *                 if lb is not None and ub is None: ret.SetLowerLimit(v, lb)
 *                 if ub is not None and lb is None: ret.SetUpperLimit(v, ub)
 *                 if lb is not None and ub is not None: ret.SetLimits(v, lb, ub)             # <<<<<<<<<<<<<<
 *                 #need to set value again
 *                 #taking care of internal/external transformation
 */
      __pyx_t_8 = (__pyx_v_lb != Py_None);
      __pyx_t_14 = (__pyx_t_8 != 0);
      if (__pyx_t_14) {
      } else {
        __pyx_t_9 = __pyx_t_14;
        goto __pyx_L21_bool_binop_done;
      }
      __pyx_t_14 = (__pyx_v_ub != Py_None);
      __pyx_t_8 = (__pyx_t_14 != 0);
      __pyx_t_9 = __pyx_t_8;
      __pyx_L21_bool_binop_done:;
      if (__pyx_t_9) {
        __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_lb); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_ub); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_ret->SetLimits(__pyx_t_5, __pyx_t_7, __pyx_t_6);
      }

      /* "iminuit/_libiminuit.pyx":1291
 *                 #need to set value again
 *                 #taking care of internal/external transformation
 *                 ret.SetValue(v, self.initialvalue[v])             # <<<<<<<<<<<<<<
 *                 ret.SetError(v, self.initialerror[v])
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initialvalue, __pyx_v_v); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ret->SetValue(__pyx_t_5, __pyx_t_6);

      /* "iminuit/_libiminuit.pyx":1292
 *                 #taking care of internal/external transformation
 *                 ret.SetValue(v, self.initialvalue[v])
 *                 ret.SetError(v, self.initialerror[v])             # <<<<<<<<<<<<<<
 * 
 *         for v in self.parameters:
 */
      __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initialerror, __pyx_v_v); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ret->SetError(__pyx_t_5, __pyx_t_6);

      /* "iminuit/_libiminuit.pyx":1281
 * 
 *         for v in self.parameters:
 *             if self.initiallimit[v] is not None:             # <<<<<<<<<<<<<<
 *                 lb, ub = self.initiallimit[v]
 *                 if lb is not None and ub is not None and lb >= ub:
 */
    }

    /* "iminuit/_libiminuit.pyx":1280
 *             ret.Add(v, self.initialvalue[v], self.initialerror[v])
 * 
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             if self.initiallimit[v] is not None:
 *                 lb, ub = self.initiallimit[v]
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1294
 *                 ret.SetError(v, self.initialerror[v])
 * 
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             if self.initialfix[v]:
 *                 ret.Fix(v)
 */
  if (likely(PyList_CheckExact(__pyx_v_self->parameters)) || PyTuple_CheckExact(__pyx_v_self->parameters)) {
    __pyx_t_1 = __pyx_v_self->parameters; __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_self->parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1295
 * 
 *         for v in self.parameters:
 *             if self.initialfix[v]:             # <<<<<<<<<<<<<<
 *                 ret.Fix(v)
 *         return ret
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_v); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_9) {

      /* "iminuit/_libiminuit.pyx":1296
 *         for v in self.parameters:
 *             if self.initialfix[v]:
 *                 ret.Fix(v)             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_ret->Fix(__pyx_t_5);

      /* "iminuit/_libiminuit.pyx":1295
 * 
 *         for v in self.parameters:
 *             if self.initialfix[v]:             # <<<<<<<<<<<<<<
 *                 ret.Fix(v)
 *         return ret
 */
    }

    /* "iminuit/_libiminuit.pyx":1294
 *                 ret.SetError(v, self.initialerror[v])
 * 
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             if self.initialfix[v]:
 *                 ret.Fix(v)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1297
 *             if self.initialfix[v]:
 *                 ret.Fix(v)
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def _auto_frontend(self):
 */
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "iminuit/_libiminuit.pyx":1269
 *                              for k, v in self.merrors_struct.items()})
 * 
 *     cdef MnUserParameterState*initialParameterState(self) except *:             # <<<<<<<<<<<<<<
 *         """Construct parameter state from initial array.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.initialParameterState", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lb);
  __Pyx_XDECREF(__pyx_v_ub);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1299
 *         return ret
 * 
 *     def _auto_frontend(self):             # <<<<<<<<<<<<<<
 *         """Determine frontend automatically.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_85_auto_frontend(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_84_auto_frontend[] = "Minuit._auto_frontend(self)\nDetermine frontend automatically.\n\n        Use HTML frontend in IPython sessions and console frontend otherwise.\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_85_auto_frontend(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_auto_frontend (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_84_auto_frontend(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_84_auto_frontend(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_v_HtmlFrontend = NULL;
  PyObject *__pyx_v_ConsoleFrontend = 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;
  int __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("_auto_frontend", 0);

  /* "iminuit/_libiminuit.pyx":1304
 *         Use HTML frontend in IPython sessions and console frontend otherwise.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             __IPYTHON__
 *             from .frontends.html import HtmlFrontend
 */
  {
    __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:*/ {

      /* "iminuit/_libiminuit.pyx":1305
 *         """
 *         try:
 *             __IPYTHON__             # <<<<<<<<<<<<<<
 *             from .frontends.html import HtmlFrontend
 *             return HtmlFrontend()
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_IPYTHON); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "iminuit/_libiminuit.pyx":1306
 *         try:
 *             __IPYTHON__
 *             from .frontends.html import HtmlFrontend             # <<<<<<<<<<<<<<
 *             return HtmlFrontend()
 *         except NameError:
 */
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_n_s_HtmlFrontend);
      __Pyx_GIVEREF(__pyx_n_s_HtmlFrontend);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_HtmlFrontend);
      __pyx_t_5 = __Pyx_Import(__pyx_n_s_frontends_html, __pyx_t_4, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __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_HtmlFrontend); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_HtmlFrontend = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "iminuit/_libiminuit.pyx":1307
 *             __IPYTHON__
 *             from .frontends.html import HtmlFrontend
 *             return HtmlFrontend()             # <<<<<<<<<<<<<<
 *         except NameError:
 *             from .frontends.console import ConsoleFrontend
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_HtmlFrontend);
      __pyx_t_4 = __pyx_v_HtmlFrontend; __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && 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);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L7_try_return;

      /* "iminuit/_libiminuit.pyx":1304
 *         Use HTML frontend in IPython sessions and console frontend otherwise.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             __IPYTHON__
 *             from .frontends.html import HtmlFrontend
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":1308
 *             from .frontends.html import HtmlFrontend
 *             return HtmlFrontend()
 *         except NameError:             # <<<<<<<<<<<<<<
 *             from .frontends.console import ConsoleFrontend
 *             return ConsoleFrontend()
 */
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_NameError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("iminuit._libiminuit.Minuit._auto_frontend", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);

      /* "iminuit/_libiminuit.pyx":1309
 *             return HtmlFrontend()
 *         except NameError:
 *             from .frontends.console import ConsoleFrontend             # <<<<<<<<<<<<<<
 *             return ConsoleFrontend()
 * 
 */
      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_n_s_ConsoleFrontend);
      __Pyx_GIVEREF(__pyx_n_s_ConsoleFrontend);
      PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_ConsoleFrontend);
      __pyx_t_9 = __Pyx_Import(__pyx_n_s_frontends_console, __pyx_t_8, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_ConsoleFrontend); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_v_ConsoleFrontend = __pyx_t_8;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "iminuit/_libiminuit.pyx":1310
 *         except NameError:
 *             from .frontends.console import ConsoleFrontend
 *             return ConsoleFrontend()             # <<<<<<<<<<<<<<
 * 
 *     def _check_extra_args(self, parameters, kwd):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_ConsoleFrontend);
      __pyx_t_8 = __pyx_v_ConsoleFrontend; __pyx_t_10 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
        }
      }
      if (__pyx_t_10) {
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else {
        __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      }
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 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;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "iminuit/_libiminuit.pyx":1304
 *         Use HTML frontend in IPython sessions and console frontend otherwise.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             __IPYTHON__
 *             from .frontends.html import HtmlFrontend
 */
    __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;
  }

  /* "iminuit/_libiminuit.pyx":1299
 *         return ret
 * 
 *     def _auto_frontend(self):             # <<<<<<<<<<<<<<
 *         """Determine frontend automatically.
 * 
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._auto_frontend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_HtmlFrontend);
  __Pyx_XDECREF(__pyx_v_ConsoleFrontend);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1312
 *             return ConsoleFrontend()
 * 
 *     def _check_extra_args(self, parameters, kwd):             # <<<<<<<<<<<<<<
 *         """Check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_' + p for p in parameters)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_87_check_extra_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_86_check_extra_args[] = "Minuit._check_extra_args(self, parameters, kwd)\nCheck keyword arguments to find unwanted/typo keyword arguments";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_87_check_extra_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_parameters = 0;
  PyObject *__pyx_v_kwd = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_extra_args (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parameters,&__pyx_n_s_kwd,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parameters)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwd)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_extra_args", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_extra_args") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __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_parameters = values[0];
    __pyx_v_kwd = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_extra_args", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_86_check_extra_args(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_parameters, __pyx_v_kwd);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_2generator10(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":1314
 *     def _check_extra_args(self, parameters, kwd):
 *         """Check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_' + p for p in parameters)             # <<<<<<<<<<<<<<
 *         limit_param = set('limit_' + p for p in parameters)
 *         error_param = set('error_' + p for p in parameters)
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_2generator10, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_check_extra_args_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args.genexpr", __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_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_2generator10(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) { __Pyx_RaiseClosureNameError("parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_n_u_fix, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_5generator11(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":1315
 *         """Check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_' + p for p in parameters)
 *         limit_param = set('limit_' + p for p in parameters)             # <<<<<<<<<<<<<<
 *         error_param = set('error_' + p for p in parameters)
 *         for k in kwd.keys():
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_5generator11, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_check_extra_args_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args.genexpr", __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_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_5generator11(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) { __Pyx_RaiseClosureNameError("parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_n_u_limit, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_8generator12(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":1316
 *         fixed_param = set('fix_' + p for p in parameters)
 *         limit_param = set('limit_' + p for p in parameters)
 *         error_param = set('error_' + p for p in parameters)             # <<<<<<<<<<<<<<
 *         for k in kwd.keys():
 *             if k not in parameters and \
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_6genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_8generator12, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_check_extra_args_locals_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args.genexpr", __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_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_8generator12(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) { __Pyx_RaiseClosureNameError("parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_n_u_error_2, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1312
 *             return ConsoleFrontend()
 * 
 *     def _check_extra_args(self, parameters, kwd):             # <<<<<<<<<<<<<<
 *         """Check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_' + p for p in parameters)
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_86_check_extra_args(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_parameters, PyObject *__pyx_v_kwd) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *__pyx_cur_scope;
  PyObject *__pyx_v_fixed_param = NULL;
  PyObject *__pyx_v_limit_param = NULL;
  PyObject *__pyx_v_error_param = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __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("_check_extra_args", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *)__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args(__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_parameters = __pyx_v_parameters;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_parameters);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_parameters);

  /* "iminuit/_libiminuit.pyx":1314
 *     def _check_extra_args(self, parameters, kwd):
 *         """Check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_' + p for p in parameters)             # <<<<<<<<<<<<<<
 *         limit_param = set('limit_' + p for p in parameters)
 *         error_param = set('error_' + p for p in parameters)
 */
  __pyx_t_1 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fixed_param = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":1315
 *         """Check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_' + p for p in parameters)
 *         limit_param = set('limit_' + p for p in parameters)             # <<<<<<<<<<<<<<
 *         error_param = set('error_' + p for p in parameters)
 *         for k in kwd.keys():
 */
  __pyx_t_2 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_limit_param = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1316
 *         fixed_param = set('fix_' + p for p in parameters)
 *         limit_param = set('limit_' + p for p in parameters)
 *         error_param = set('error_' + p for p in parameters)             # <<<<<<<<<<<<<<
 *         for k in kwd.keys():
 *             if k not in parameters and \
 */
  __pyx_t_1 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_6genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_error_param = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":1317
 *         limit_param = set('limit_' + p for p in parameters)
 *         error_param = set('error_' + p for p in parameters)
 *         for k in kwd.keys():             # <<<<<<<<<<<<<<
 *             if k not in parameters and \
 *                             k not in fixed_param and \
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwd, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1318
 *         error_param = set('error_' + p for p in parameters)
 *         for k in kwd.keys():
 *             if k not in parameters and \             # <<<<<<<<<<<<<<
 *                             k not in fixed_param and \
 *                             k not in limit_param and \
 */
    __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_cur_scope->__pyx_v_parameters, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {
    } else {
      __pyx_t_6 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }

    /* "iminuit/_libiminuit.pyx":1319
 *         for k in kwd.keys():
 *             if k not in parameters and \
 *                             k not in fixed_param and \             # <<<<<<<<<<<<<<
 *                             k not in limit_param and \
 *                             k not in error_param:
 */
    __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_v_fixed_param, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = (__pyx_t_8 != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L6_bool_binop_done;
    }

    /* "iminuit/_libiminuit.pyx":1320
 *             if k not in parameters and \
 *                             k not in fixed_param and \
 *                             k not in limit_param and \             # <<<<<<<<<<<<<<
 *                             k not in error_param:
 *                 raise RuntimeError(
 */
    __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_v_limit_param, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {
    } else {
      __pyx_t_6 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }

    /* "iminuit/_libiminuit.pyx":1321
 *                             k not in fixed_param and \
 *                             k not in limit_param and \
 *                             k not in error_param:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     ('Cannot understand keyword %s. May be a typo?\n'
 */
    __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_v_error_param, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = (__pyx_t_8 != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L6_bool_binop_done:;

    /* "iminuit/_libiminuit.pyx":1318
 *         error_param = set('error_' + p for p in parameters)
 *         for k in kwd.keys():
 *             if k not in parameters and \             # <<<<<<<<<<<<<<
 *                             k not in fixed_param and \
 *                             k not in limit_param and \
 */
    if (__pyx_t_6) {

      /* "iminuit/_libiminuit.pyx":1324
 *                 raise RuntimeError(
 *                     ('Cannot understand keyword %s. May be a typo?\n'
 *                      'The parameters are %r') % (k, parameters))             # <<<<<<<<<<<<<<
 */
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_k);
      __Pyx_GIVEREF(__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_parameters);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_parameters);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_parameters);
      __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Cannot_understand_keyword_s_May, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "iminuit/_libiminuit.pyx":1322
 *                             k not in limit_param and \
 *                             k not in error_param:
 *                 raise RuntimeError(             # <<<<<<<<<<<<<<
 *                     ('Cannot understand keyword %s. May be a typo?\n'
 *                      'The parameters are %r') % (k, parameters))
 */
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "iminuit/_libiminuit.pyx":1318
 *         error_param = set('error_' + p for p in parameters)
 *         for k in kwd.keys():
 *             if k not in parameters and \             # <<<<<<<<<<<<<<
 *                             k not in fixed_param and \
 *                             k not in limit_param and \
 */
    }

    /* "iminuit/_libiminuit.pyx":1317
 *         limit_param = set('limit_' + p for p in parameters)
 *         error_param = set('error_' + p for p in parameters)
 *         for k in kwd.keys():             # <<<<<<<<<<<<<<
 *             if k not in parameters and \
 *                             k not in fixed_param and \
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1312
 *             return ConsoleFrontend()
 * 
 *     def _check_extra_args(self, parameters, kwd):             # <<<<<<<<<<<<<<
 *         """Check keyword arguments to find unwanted/typo keyword arguments"""
 *         fixed_param = set('fix_' + p for p in parameters)
 */

  /* 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("iminuit._libiminuit.Minuit._check_extra_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fixed_param);
  __Pyx_XDECREF(__pyx_v_limit_param);
  __Pyx_XDECREF(__pyx_v_error_param);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":47
 *     # Standard stuff
 * 
 *     cdef readonly object fcn             # <<<<<<<<<<<<<<
 *     """Cost function (usually a chi^2 or likelihood function)"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3fcn_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3fcn_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_3fcn___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3fcn___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->fcn);
  __pyx_r = __pyx_v_self->fcn;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":53
 *     # cdef readonly object varname #:variable names
 * 
 *     cdef readonly object pos2var             # <<<<<<<<<<<<<<
 *     """Map variable position to name"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7pos2var_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7pos2var_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7pos2var___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7pos2var___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->pos2var);
  __pyx_r = __pyx_v_self->pos2var;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":56
 *     """Map variable position to name"""
 * 
 *     cdef readonly object var2pos             # <<<<<<<<<<<<<<
 *     """Map variable name to position"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7var2pos_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7var2pos_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7var2pos___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7var2pos___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->var2pos);
  __pyx_r = __pyx_v_self->var2pos;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":74
 *     # PyMinuit compatible fields
 * 
 *     cdef public double errordef             # <<<<<<<<<<<<<<
 *     """Amount of change in FCN that defines 1 :math:`sigma` error.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_8errordef_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_8errordef_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8errordef___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8errordef___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->errordef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __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("iminuit._libiminuit.Minuit.errordef.__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_7iminuit_11_libiminuit_6Minuit_8errordef_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8errordef_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8errordef_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8errordef_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->errordef = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.errordef.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":83
 *     """
 * 
 *     cdef public double tol             # <<<<<<<<<<<<<<
 *     """Tolerance.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3tol_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3tol_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->tol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __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("iminuit._libiminuit.Minuit.tol.__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_7iminuit_11_libiminuit_6Minuit_3tol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_3tol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_3tol_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->tol = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.tol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":90
 *     """
 * 
 *     cdef public unsigned int strategy             # <<<<<<<<<<<<<<
 *     """Strategy integer code.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_8strategy_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_8strategy_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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_unsigned_int(__pyx_v_self->strategy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __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("iminuit._libiminuit.Minuit.strategy.__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_7iminuit_11_libiminuit_6Minuit_8strategy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8strategy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8strategy_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned 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_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->strategy = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.strategy.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":98
 *     """
 * 
 *     cdef public print_level             # <<<<<<<<<<<<<<
 *     """Print level.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->print_level);
  __pyx_r = __pyx_v_self->print_level;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->print_level);
  __Pyx_DECREF(__pyx_v_self->print_level);
  __pyx_v_self->print_level = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_4__del__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_11print_level_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->print_level);
  __Pyx_DECREF(__pyx_v_self->print_level);
  __pyx_v_self->print_level = Py_None;

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

/* "iminuit/_libiminuit.pyx":108
 *     """
 * 
 *     cdef readonly bint throw_nan             # <<<<<<<<<<<<<<
 *     """Raise runtime error if function evaluate to nan."""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_9throw_nan_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_9throw_nan_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_9throw_nan___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_9throw_nan___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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_PyBool_FromLong(__pyx_v_self->throw_nan); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __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("iminuit._libiminuit.Minuit.throw_nan.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":113
 *     # PyMinuit compatible interface
 * 
 *     cdef readonly object parameters             # <<<<<<<<<<<<<<
 *     """Parameter name tuple"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_10parameters_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_10parameters_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_10parameters___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_10parameters___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->parameters);
  __pyx_r = __pyx_v_self->parameters;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":116
 *     """Parameter name tuple"""
 * 
 *     cdef readonly object args             # <<<<<<<<<<<<<<
 *     """Parameter value tuple"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_4args___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4args___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->args);
  __pyx_r = __pyx_v_self->args;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":119
 *     """Parameter value tuple"""
 * 
 *     cdef readonly object values             # <<<<<<<<<<<<<<
 *     """Parameter values (dict: name -> value)"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6values___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6values___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->values);
  __pyx_r = __pyx_v_self->values;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":122
 *     """Parameter values (dict: name -> value)"""
 * 
 *     cdef readonly object errors             # <<<<<<<<<<<<<<
 *     """Parameter parabolic errors (dict: name -> error)"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6errors_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6errors_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6errors___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6errors___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->errors);
  __pyx_r = __pyx_v_self->errors;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":125
 *     """Parameter parabolic errors (dict: name -> error)"""
 * 
 *     cdef readonly object covariance             # <<<<<<<<<<<<<<
 *     """Covariance matrix (dict (name1, name2) -> covariance).
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_10covariance_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_10covariance_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_10covariance___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_10covariance___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->covariance);
  __pyx_r = __pyx_v_self->covariance;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":131
 *     """
 * 
 *     cdef readonly double fval             # <<<<<<<<<<<<<<
 *     """Last evaluated FCN value
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4fval_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4fval_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_4fval___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4fval___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->fval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __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("iminuit._libiminuit.Minuit.fval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":137
 *     """
 * 
 *     cdef readonly int ncalls             # <<<<<<<<<<<<<<
 *     """Number of FCN call of last migrad / minos / hesse run."""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6ncalls_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6ncalls_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6ncalls___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6ncalls___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->ncalls); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __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("iminuit._libiminuit.Minuit.ncalls.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":140
 *     """Number of FCN call of last migrad / minos / hesse run."""
 * 
 *     cdef readonly double edm             # <<<<<<<<<<<<<<
 *     """Estimated distance to minimum.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3edm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3edm_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_3edm___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3edm___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__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->edm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __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("iminuit._libiminuit.Minuit.edm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":146
 *     """
 * 
 *     cdef readonly object merrors             # <<<<<<<<<<<<<<
 *     """MINOS errors (dict).
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7merrors_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_7merrors_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7merrors___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_7merrors___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->merrors);
  __pyx_r = __pyx_v_self->merrors;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":160
 *     """
 * 
 *     cdef readonly object gcc             # <<<<<<<<<<<<<<
 *     """Global correlation coefficients (dict : name -> gcc)"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3gcc_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_3gcc_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_3gcc___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_3gcc___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->gcc);
  __pyx_r = __pyx_v_self->gcc;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":163
 *     """Global correlation coefficients (dict : name -> gcc)"""
 * 
 *     cdef public object fitarg             # <<<<<<<<<<<<<<
 *     """Current Minuit state in form of a dict.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->fitarg);
  __pyx_r = __pyx_v_self->fitarg;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->fitarg);
  __Pyx_DECREF(__pyx_v_self->fitarg);
  __pyx_v_self->fitarg = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_4__del__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_6fitarg_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->fitarg);
  __Pyx_DECREF(__pyx_v_self->fitarg);
  __pyx_v_self->fitarg = Py_None;

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

/* "iminuit/_libiminuit.pyx":181
 *     """
 * 
 *     cdef readonly object narg             # <<<<<<<<<<<<<<
 *     """Number of arguments"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4narg_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_4narg_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_4narg___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_4narg___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->narg);
  __pyx_r = __pyx_v_self->narg;
  goto __pyx_L0;

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

/* "iminuit/_libiminuit.pyx":184
 *     """Number of arguments"""
 * 
 *     cdef public object merrors_struct             # <<<<<<<<<<<<<<
 *     """MINOS error calculation information (dict name -> struct)"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->merrors_struct);
  __pyx_r = __pyx_v_self->merrors_struct;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->merrors_struct);
  __Pyx_DECREF(__pyx_v_self->merrors_struct);
  __pyx_v_self->merrors_struct = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_4__del__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_14merrors_struct_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->merrors_struct);
  __Pyx_DECREF(__pyx_v_self->merrors_struct);
  __pyx_v_self->merrors_struct = Py_None;

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

/* "iminuit/_libiminuit.pyx":187
 *     """MINOS error calculation information (dict name -> struct)"""
 * 
 *     cdef public object frontend             # <<<<<<<<<<<<<<
 *     """Minuit frontend.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend___get__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend___get__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->frontend);
  __pyx_r = __pyx_v_self->frontend;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_2__set__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_2__set__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->frontend);
  __Pyx_DECREF(__pyx_v_self->frontend);
  __pyx_v_self->frontend = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_4__del__(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self));

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

static int __pyx_pf_7iminuit_11_libiminuit_6Minuit_8frontend_4__del__(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->frontend);
  __Pyx_DECREF(__pyx_v_self->frontend);
  __pyx_v_self->frontend = Py_None;

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

/* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length
 *     cdef char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char *__pyx_v_data;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length
 *     cdef char* data = __Pyx_PyObject_AsStringAndSize(o, &length)             # <<<<<<<<<<<<<<
 *     return string(data, length)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length
 *     cdef char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  goto __pyx_L0;

  /* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length
 *     cdef char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.from_py":50
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *__pyx_v_o) {
  std::vector<std::string>  __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<std::string>  __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;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_string", 0);

  /* "vector.from_py":52
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(X_from_py(item))
 *     return v
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __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_o); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __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_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "vector.from_py":53
 *     cdef vector[X] v
 *     for item in o:
 *         v.push_back(X_from_py(item))             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
    __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_v.push_back(__pyx_t_5);

    /* "vector.from_py":52
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(X_from_py(item))
 *     return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":54
 *     for item in o:
 *         v.push_back(X_from_py(item))
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":50
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pair.to_py":180
 * 
 * @cname("__pyx_convert_pair_to_py_double____double")
 * cdef object __pyx_convert_pair_to_py_double____double(const pair[X,Y]& p):             # <<<<<<<<<<<<<<
 *     return X_to_py(p.first), Y_to_py(p.second)
 * 
 */

static PyObject *__pyx_convert_pair_to_py_double____double(std::pair<double,double>  const &__pyx_v_p) {
  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("__pyx_convert_pair_to_py_double____double", 0);

  /* "pair.to_py":181
 * @cname("__pyx_convert_pair_to_py_double____double")
 * cdef object __pyx_convert_pair_to_py_double____double(const pair[X,Y]& p):
 *     return X_to_py(p.first), Y_to_py(p.second)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __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;

  /* "pair.to_py":180
 * 
 * @cname("__pyx_convert_pair_to_py_double____double")
 * cdef object __pyx_convert_pair_to_py_double____double(const pair[X,Y]& p):             # <<<<<<<<<<<<<<
 *     return X_to_py(p.first), Y_to_py(p.second)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_double____double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.to_py":67
 * 
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [X_to_py(v[i]) for i in range(v.size())]
 * 
 */

static PyObject *__pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___(const std::vector<std::pair<double,double> >  &__pyx_v_v) {
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___", 0);

  /* "vector.to_py":68
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___(vector[X]& v):
 *     return [X_to_py(v[i]) for i in range(v.size())]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_v.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
    __pyx_t_4 = __pyx_convert_pair_to_py_double____double((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "vector.to_py":67
 * 
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [X_to_py(v[i]) for i in range(v.size())]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit __pyx_vtable_7iminuit_11_libiminuit_Minuit;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit_Minuit(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *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_7iminuit_11_libiminuit_Minuit *)o);
  p->__pyx_vtab = __pyx_vtabptr_7iminuit_11_libiminuit_Minuit;
  p->fcn = Py_None; Py_INCREF(Py_None);
  p->pos2var = Py_None; Py_INCREF(Py_None);
  p->var2pos = Py_None; Py_INCREF(Py_None);
  p->initialvalue = Py_None; Py_INCREF(Py_None);
  p->initialerror = Py_None; Py_INCREF(Py_None);
  p->initiallimit = Py_None; Py_INCREF(Py_None);
  p->initialfix = Py_None; Py_INCREF(Py_None);
  p->print_level = Py_None; Py_INCREF(Py_None);
  p->parameters = Py_None; Py_INCREF(Py_None);
  p->args = Py_None; Py_INCREF(Py_None);
  p->values = Py_None; Py_INCREF(Py_None);
  p->errors = Py_None; Py_INCREF(Py_None);
  p->covariance = Py_None; Py_INCREF(Py_None);
  p->merrors = Py_None; Py_INCREF(Py_None);
  p->gcc = Py_None; Py_INCREF(Py_None);
  p->fitarg = Py_None; Py_INCREF(Py_None);
  p->narg = Py_None; Py_INCREF(Py_None);
  p->merrors_struct = Py_None; Py_INCREF(Py_None);
  p->frontend = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit_Minuit(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *p = (struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(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);
    ++Py_REFCNT(o);
    __pyx_pw_7iminuit_11_libiminuit_6Minuit_63__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->fcn);
  Py_CLEAR(p->pos2var);
  Py_CLEAR(p->var2pos);
  Py_CLEAR(p->initialvalue);
  Py_CLEAR(p->initialerror);
  Py_CLEAR(p->initiallimit);
  Py_CLEAR(p->initialfix);
  Py_CLEAR(p->print_level);
  Py_CLEAR(p->parameters);
  Py_CLEAR(p->args);
  Py_CLEAR(p->values);
  Py_CLEAR(p->errors);
  Py_CLEAR(p->covariance);
  Py_CLEAR(p->merrors);
  Py_CLEAR(p->gcc);
  Py_CLEAR(p->fitarg);
  Py_CLEAR(p->narg);
  Py_CLEAR(p->merrors_struct);
  Py_CLEAR(p->frontend);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit_Minuit(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *p = (struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)o;
  if (p->fcn) {
    e = (*v)(p->fcn, a); if (e) return e;
  }
  if (p->pos2var) {
    e = (*v)(p->pos2var, a); if (e) return e;
  }
  if (p->var2pos) {
    e = (*v)(p->var2pos, a); if (e) return e;
  }
  if (p->initialvalue) {
    e = (*v)(p->initialvalue, a); if (e) return e;
  }
  if (p->initialerror) {
    e = (*v)(p->initialerror, a); if (e) return e;
  }
  if (p->initiallimit) {
    e = (*v)(p->initiallimit, a); if (e) return e;
  }
  if (p->initialfix) {
    e = (*v)(p->initialfix, a); if (e) return e;
  }
  if (p->print_level) {
    e = (*v)(p->print_level, a); if (e) return e;
  }
  if (p->parameters) {
    e = (*v)(p->parameters, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  if (p->values) {
    e = (*v)(p->values, a); if (e) return e;
  }
  if (p->errors) {
    e = (*v)(p->errors, a); if (e) return e;
  }
  if (p->covariance) {
    e = (*v)(p->covariance, a); if (e) return e;
  }
  if (p->merrors) {
    e = (*v)(p->merrors, a); if (e) return e;
  }
  if (p->gcc) {
    e = (*v)(p->gcc, a); if (e) return e;
  }
  if (p->fitarg) {
    e = (*v)(p->fitarg, a); if (e) return e;
  }
  if (p->narg) {
    e = (*v)(p->narg, a); if (e) return e;
  }
  if (p->merrors_struct) {
    e = (*v)(p->merrors_struct, a); if (e) return e;
  }
  if (p->frontend) {
    e = (*v)(p->frontend, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit_Minuit(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *p = (struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)o;
  tmp = ((PyObject*)p->fcn);
  p->fcn = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pos2var);
  p->pos2var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->var2pos);
  p->var2pos = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->initialvalue);
  p->initialvalue = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->initialerror);
  p->initialerror = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->initiallimit);
  p->initiallimit = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->initialfix);
  p->initialfix = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->print_level);
  p->print_level = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->parameters);
  p->parameters = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->values);
  p->values = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->errors);
  p->errors = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->covariance);
  p->covariance = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->merrors);
  p->merrors = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->gcc);
  p->gcc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->fitarg);
  p->fitarg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->narg);
  p->narg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->merrors_struct);
  p->merrors_struct = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->frontend);
  p->frontend = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_fcn(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_3fcn_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_pos2var(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_7pos2var_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_var2pos(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_7var2pos_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_errordef(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8errordef_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_errordef(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8errordef_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_tol(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_3tol_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_tol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_3tol_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_strategy(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8strategy_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_strategy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8strategy_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_print_level(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_print_level(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_3__set__(o, v);
  }
  else {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_level_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_throw_nan(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_9throw_nan_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_parameters(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_10parameters_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_4args_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6values_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_errors(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6errors_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_covariance(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_10covariance_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_fval(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_4fval_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_ncalls(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6ncalls_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_edm(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_3edm_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_merrors(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_7merrors_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_gcc(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_3gcc_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_fitarg(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_fitarg(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_3__set__(o, v);
  }
  else {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_6fitarg_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_narg(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_4narg_1__get__(o);
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_merrors_struct(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_merrors_struct(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_3__set__(o, v);
  }
  else {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_14merrors_struct_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7iminuit_11_libiminuit_6Minuit_frontend(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_1__get__(o);
}

static int __pyx_setprop_7iminuit_11_libiminuit_6Minuit_frontend(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_3__set__(o, v);
  }
  else {
    return __pyx_pw_7iminuit_11_libiminuit_6Minuit_8frontend_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit_Minuit[] = {
  {"migrad", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_3migrad, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_2migrad},
  {"hesse", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_5hesse, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_4hesse},
  {"minos", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_7minos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_6minos},
  {"matrix", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_9matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_8matrix},
  {"print_matrix", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_10print_matrix},
  {"latex_matrix", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_13latex_matrix, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_12latex_matrix},
  {"np_matrix", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_15np_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_14np_matrix},
  {"is_fixed", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_17is_fixed, METH_O, __pyx_doc_7iminuit_11_libiminuit_6Minuit_16is_fixed},
  {"_prepare_param", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_19_prepare_param, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_18_prepare_param},
  {"print_param", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_21print_param, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_20print_param},
  {"latex_param", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_23latex_param, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_22latex_param},
  {"_prepare_initial_param", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_25_prepare_initial_param, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_24_prepare_initial_param},
  {"print_initial_param", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_27print_initial_param, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_26print_initial_param},
  {"latex_initial_param", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_29latex_initial_param, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_28latex_initial_param},
  {"print_fmin", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_31print_fmin, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_30print_fmin},
  {"print_all_minos", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_33print_all_minos, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_32print_all_minos},
  {"set_up", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_35set_up, METH_O, __pyx_doc_7iminuit_11_libiminuit_6Minuit_34set_up},
  {"set_errordef", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_37set_errordef, METH_O, __pyx_doc_7iminuit_11_libiminuit_6Minuit_36set_errordef},
  {"set_strategy", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_39set_strategy, METH_O, __pyx_doc_7iminuit_11_libiminuit_6Minuit_38set_strategy},
  {"set_print_level", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_41set_print_level, METH_O, __pyx_doc_7iminuit_11_libiminuit_6Minuit_40set_print_level},
  {"get_fmin", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_43get_fmin, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_42get_fmin},
  {"get_param_states", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_45get_param_states, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_44get_param_states},
  {"get_merrors", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_47get_merrors, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_46get_merrors},
  {"get_initial_param_state", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_49get_initial_param_state, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_48get_initial_param_state},
  {"get_num_call_fcn", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_51get_num_call_fcn, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_50get_num_call_fcn},
  {"migrad_ok", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_53migrad_ok, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_52migrad_ok},
  {"matrix_accurate", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_55matrix_accurate, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_54matrix_accurate},
  {"list_of_fixed_param", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_57list_of_fixed_param, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_56list_of_fixed_param},
  {"list_of_vary_param", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_59list_of_vary_param, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_58list_of_vary_param},
  {"is_clean_state", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_61is_clean_state, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_60is_clean_state},
  {"pedantic", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_65pedantic, METH_O, __pyx_doc_7iminuit_11_libiminuit_6Minuit_64pedantic},
  {"mnprofile", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_67mnprofile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_66mnprofile},
  {"draw_mnprofile", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_69draw_mnprofile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_68draw_mnprofile},
  {"profile", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_71profile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_70profile},
  {"draw_profile", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_73draw_profile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_72draw_profile},
  {"contour", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_75contour, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_74contour},
  {"mncontour", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_77mncontour, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_76mncontour},
  {"mncontour_grid", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_79mncontour_grid, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_78mncontour_grid},
  {"draw_mncontour", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_81draw_mncontour, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_80draw_mncontour},
  {"draw_contour", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_83draw_contour, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_82draw_contour},
  {"_auto_frontend", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_85_auto_frontend, METH_NOARGS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_84_auto_frontend},
  {"_check_extra_args", (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_87_check_extra_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7iminuit_11_libiminuit_6Minuit_86_check_extra_args},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7iminuit_11_libiminuit_Minuit[] = {
  {(char *)"fcn", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_fcn, 0, __pyx_k_Cost_function_usually_a_chi_2_or, 0},
  {(char *)"pos2var", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_pos2var, 0, __pyx_k_Map_variable_position_to_name, 0},
  {(char *)"var2pos", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_var2pos, 0, __pyx_k_Map_variable_name_to_position, 0},
  {(char *)"errordef", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_errordef, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_errordef, __pyx_k_errordef_double_Amount_of_change, 0},
  {(char *)"tol", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_tol, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_tol, __pyx_k_tol_double_Tolerance_One_of_the, 0},
  {(char *)"strategy", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_strategy, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_strategy, __pyx_k_strategy_unsigned_int_Strategy_i, 0},
  {(char *)"print_level", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_print_level, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_print_level, __pyx_k_print_level_object_Print_level_0, 0},
  {(char *)"throw_nan", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_throw_nan, 0, __pyx_k_Raise_runtime_error_if_function, 0},
  {(char *)"parameters", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_parameters, 0, __pyx_k_Parameter_name_tuple, 0},
  {(char *)"args", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_args, 0, __pyx_k_Parameter_value_tuple, 0},
  {(char *)"values", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_values, 0, __pyx_k_Parameter_values_dict_name_value, 0},
  {(char *)"errors", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_errors, 0, __pyx_k_Parameter_parabolic_errors_dict, 0},
  {(char *)"covariance", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_covariance, 0, __pyx_k_Covariance_matrix_dict_name1_nam, 0},
  {(char *)"fval", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_fval, 0, __pyx_k_Last_evaluated_FCN_value_seealso, 0},
  {(char *)"ncalls", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_ncalls, 0, __pyx_k_Number_of_FCN_call_of_last_migra, 0},
  {(char *)"edm", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_edm, 0, __pyx_k_Estimated_distance_to_minimum_se, 0},
  {(char *)"merrors", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_merrors, 0, __pyx_k_MINOS_errors_dict_Using_this_met, 0},
  {(char *)"gcc", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_gcc, 0, __pyx_k_Global_correlation_coefficients, 0},
  {(char *)"fitarg", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_fitarg, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_fitarg, __pyx_k_fitarg_object_Current_Minuit_sta, 0},
  {(char *)"narg", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_narg, 0, __pyx_k_Number_of_arguments, 0},
  {(char *)"merrors_struct", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_merrors_struct, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_merrors_struct, __pyx_k_merrors_struct_object_MINOS_erro, 0},
  {(char *)"frontend", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_frontend, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_frontend, __pyx_k_frontend_object_Minuit_frontend, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit_Minuit = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.Minuit", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit_Minuit), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit_Minuit, /*tp_dealloc*/
  0, /*tp_print*/
  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_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Minuit(fcn, throw_nan=False, pedantic=True, frontend=None, forced_parameters=None, print_level=1, errordef=None, **kwds)", /*tp_doc*/
  __pyx_tp_traverse_7iminuit_11_libiminuit_Minuit, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit_Minuit, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7iminuit_11_libiminuit_Minuit, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7iminuit_11_libiminuit_Minuit, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7iminuit_11_libiminuit_6Minuit_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7iminuit_11_libiminuit_Minuit, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct____init__[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct____init__ = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct____init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct____init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct____init__[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct____init__];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__));
    (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_7iminuit_11_libiminuit___pyx_scope_struct____init__(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct____init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct____init__[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct____init__++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct____init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, 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 int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct____init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *)o;
  tmp = ((PyObject*)p->__pyx_v_args);
  p->__pyx_v_args = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct____init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct____init__", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct____init__, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct____init__, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct____init__, /*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_7iminuit_11_libiminuit___pyx_scope_struct____init__, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *)o);
  new((void*)&(p->__pyx_v_cov)) MnUserCovariance();
  return o;
}

static void __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_v_cov);
  Py_CLEAR(p->__pyx_v_params);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *)o;
  if (p->__pyx_v_params) {
    e = (*v)(p->__pyx_v_params, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *)o;
  tmp = ((PyObject*)p->__pyx_v_params);
  p->__pyx_v_params = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_2_matrix", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix, /*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_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_iv2);
  Py_CLEAR(p->__pyx_v_v2);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_iv2) {
    e = (*v)(p->__pyx_v_iv2, a); if (e) return e;
  }
  if (p->__pyx_v_v2) {
    e = (*v)(p->__pyx_v_v2, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_genexpr);
  p->__pyx_v_genexpr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_iv2);
  p->__pyx_v_iv2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v2);
  p->__pyx_v_v2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_1);
  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_iv1);
  Py_CLEAR(p->__pyx_v_v1);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_iv1) {
    e = (*v)(p->__pyx_v_iv1, a); if (e) return e;
  }
  if (p->__pyx_v_v1) {
    e = (*v)(p->__pyx_v_v1, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_iv1);
  p->__pyx_v_iv1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v1);
  p->__pyx_v_v1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_1);
  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_4_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_iv2);
  Py_CLEAR(p->__pyx_v_v2);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_iv2) {
    e = (*v)(p->__pyx_v_iv2, a); if (e) return e;
  }
  if (p->__pyx_v_v2) {
    e = (*v)(p->__pyx_v_v2, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_genexpr);
  p->__pyx_v_genexpr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_iv2);
  p->__pyx_v_iv2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v2);
  p->__pyx_v_v2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_1);
  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_iv1);
  Py_CLEAR(p->__pyx_v_v1);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_iv1) {
    e = (*v)(p->__pyx_v_iv1, a); if (e) return e;
  }
  if (p->__pyx_v_v1) {
    e = (*v)(p->__pyx_v_v1, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_iv1);
  p->__pyx_v_iv1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_v1);
  p->__pyx_v_v1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_1);
  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_6_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_bins);
  Py_CLEAR(p->__pyx_v_binstep);
  Py_CLEAR(p->__pyx_v_bound);
  Py_CLEAR(p->__pyx_v_results);
  Py_CLEAR(p->__pyx_v_themin);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *)o;
  if (p->__pyx_v_bins) {
    e = (*v)(p->__pyx_v_bins, a); if (e) return e;
  }
  if (p->__pyx_v_binstep) {
    e = (*v)(p->__pyx_v_binstep, a); if (e) return e;
  }
  if (p->__pyx_v_bound) {
    e = (*v)(p->__pyx_v_bound, a); if (e) return e;
  }
  if (p->__pyx_v_results) {
    e = (*v)(p->__pyx_v_results, a); if (e) return e;
  }
  if (p->__pyx_v_themin) {
    e = (*v)(p->__pyx_v_themin, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *)o;
  tmp = ((PyObject*)p->__pyx_v_bins);
  p->__pyx_v_bins = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_binstep);
  p->__pyx_v_binstep = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_bound);
  p->__pyx_v_bound = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_results);
  p->__pyx_v_results = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_themin);
  p->__pyx_v_themin = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_7_mnprofile", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile, /*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_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_8_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_x);
  p->__pyx_v_x = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_9_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_10_profile[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_10_profile = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_10_profile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_10_profile > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_10_profile[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_10_profile];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_10_profile(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_bins);
  Py_CLEAR(p->__pyx_v_binstep);
  Py_CLEAR(p->__pyx_v_bound);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_10_profile < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_10_profile[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_10_profile++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_10_profile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *)o;
  if (p->__pyx_v_bins) {
    e = (*v)(p->__pyx_v_bins, a); if (e) return e;
  }
  if (p->__pyx_v_binstep) {
    e = (*v)(p->__pyx_v_binstep, a); if (e) return e;
  }
  if (p->__pyx_v_bound) {
    e = (*v)(p->__pyx_v_bound, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_10_profile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *)o;
  tmp = ((PyObject*)p->__pyx_v_bins);
  p->__pyx_v_bins = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_binstep);
  p->__pyx_v_binstep = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_bound);
  p->__pyx_v_bound = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_10_profile = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_10_profile", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_10_profile, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_10_profile, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_10_profile, /*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_7iminuit_11_libiminuit___pyx_scope_struct_10_profile, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_11_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_12_contour[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_12_contour = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_12_contour(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_12_contour > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_12_contour[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_12_contour];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_12_contour(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_x_bins);
  Py_CLEAR(p->__pyx_v_x_binstep);
  Py_CLEAR(p->__pyx_v_x_bound);
  Py_CLEAR(p->__pyx_v_y_bins);
  Py_CLEAR(p->__pyx_v_y_binstep);
  Py_CLEAR(p->__pyx_v_y_bound);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_12_contour < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_12_contour[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_12_contour++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_12_contour(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *)o;
  if (p->__pyx_v_x_bins) {
    e = (*v)(p->__pyx_v_x_bins, a); if (e) return e;
  }
  if (p->__pyx_v_x_binstep) {
    e = (*v)(p->__pyx_v_x_binstep, a); if (e) return e;
  }
  if (p->__pyx_v_x_bound) {
    e = (*v)(p->__pyx_v_x_bound, a); if (e) return e;
  }
  if (p->__pyx_v_y_bins) {
    e = (*v)(p->__pyx_v_y_bins, a); if (e) return e;
  }
  if (p->__pyx_v_y_binstep) {
    e = (*v)(p->__pyx_v_y_binstep, a); if (e) return e;
  }
  if (p->__pyx_v_y_bound) {
    e = (*v)(p->__pyx_v_y_bound, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_12_contour(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *)o;
  tmp = ((PyObject*)p->__pyx_v_x_bins);
  p->__pyx_v_x_bins = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_x_binstep);
  p->__pyx_v_x_binstep = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_x_bound);
  p->__pyx_v_x_bound = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_y_bins);
  p->__pyx_v_y_bins = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_y_binstep);
  p->__pyx_v_y_binstep = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_y_bound);
  p->__pyx_v_y_bound = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_12_contour = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_12_contour", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_12_contour, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_12_contour, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_12_contour, /*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_7iminuit_11_libiminuit___pyx_scope_struct_12_contour, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_13_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_14_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_parameters);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *)o;
  if (p->__pyx_v_parameters) {
    e = (*v)(p->__pyx_v_parameters, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *)o;
  tmp = ((PyObject*)p->__pyx_v_parameters);
  p->__pyx_v_parameters = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_15__check_extra_args", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args, /*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_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_p);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_p);
  p->__pyx_v_p = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_16_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_p);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_p);
  p->__pyx_v_p = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_17_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr, /*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
};

static struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr[8];
static int __pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr = 0;

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr[--__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr));
    (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_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr(PyObject *o) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_p);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr)))) {
    __pyx_freelist_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr[__pyx_freecount_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr++] = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_p);
  p->__pyx_v_p = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "iminuit._libiminuit.__pyx_scope_struct_18_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr, /*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_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr, /*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
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
  static const char* internal_type_names[] = {
    "ContoursError",
    "FCNBase",
    "FunctionMinimum",
    "MinosError",
    "Minuit",
    "MinuitParameter",
    "MnApplication",
    "MnContours",
    "MnGlobalCorrelationCoeff",
    "MnHesse",
    "MnMigrad",
    "MnMinos",
    "MnStrategy",
    "MnUserCovariance",
    "MnUserParameterState",
    "PythonFCN",
    "X",
    "Y",
    "__pyx_ctuple_double",
    "__pyx_ctuple_double_struct",
    "__pyx_ctuple_size_t",
    "__pyx_ctuple_size_t_struct",
    "__pyx_opt_args_7MnHesse_call",
    "__pyx_scope_struct_10_profile",
    "__pyx_scope_struct_11_genexpr",
    "__pyx_scope_struct_12_contour",
    "__pyx_scope_struct_13_genexpr",
    "__pyx_scope_struct_14_genexpr",
    "__pyx_scope_struct_15__check_extra_args",
    "__pyx_scope_struct_16_genexpr",
    "__pyx_scope_struct_17_genexpr",
    "__pyx_scope_struct_18_genexpr",
    "__pyx_scope_struct_1_genexpr",
    "__pyx_scope_struct_2_matrix",
    "__pyx_scope_struct_3_genexpr",
    "__pyx_scope_struct_4_genexpr",
    "__pyx_scope_struct_5_genexpr",
    "__pyx_scope_struct_6_genexpr",
    "__pyx_scope_struct_7_mnprofile",
    "__pyx_scope_struct_8_genexpr",
    "__pyx_scope_struct_9_genexpr",
    "__pyx_scope_struct____init__",
    "auto_ptr",
    "pair",
    "string",
    "vector",
    0
  };
  const char** type_name = internal_type_names;
  while (*type_name) {
    if (__Pyx_StrEq(name, *type_name)) {
      PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);
      goto bad;
    }
    type_name++;
  }
  if (0);
  else {
    if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad;
  }
  return 0;
  bad:
  return -1;
}

























































































































static int
__Pyx_import_all_from(PyObject *locals, PyObject *v)
{
    PyObject *all = PyObject_GetAttrString(v, "__all__");
    PyObject *dict, *name, *value;
    int skip_leading_underscores = 0;
    int pos, err;

    if (all == NULL) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            return -1;
        PyErr_Clear();
        dict = PyObject_GetAttrString(v, "__dict__");
        if (dict == NULL) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError))
                return -1;
            PyErr_SetString(PyExc_ImportError,
            "from-import-* object has no __dict__ and no __all__");
            return -1;
        }
#if PY_MAJOR_VERSION < 3
        all = PyObject_CallMethod(dict, (char *)"keys", NULL);
#else
        all = PyMapping_Keys(dict);
#endif
        Py_DECREF(dict);
        if (all == NULL)
            return -1;
        skip_leading_underscores = 1;
    }

    for (pos = 0, err = 0; ; pos++) {
        name = PySequence_GetItem(all, pos);
        if (name == NULL) {
            if (!PyErr_ExceptionMatches(PyExc_IndexError))
                err = -1;
            else
                PyErr_Clear();
            break;
        }
        if (skip_leading_underscores &&
#if PY_MAJOR_VERSION < 3
            PyString_Check(name) &&
            PyString_AS_STRING(name)[0] == '_')
#else
            PyUnicode_Check(name) &&
            PyUnicode_AS_UNICODE(name)[0] == '_')
#endif
        {
            Py_DECREF(name);
            continue;
        }
        value = PyObject_GetAttr(v, name);
        if (value == NULL)
            err = -1;
        else if (PyDict_CheckExact(locals))
            err = PyDict_SetItem(locals, name, value);
        else
            err = PyObject_SetItem(locals, name, value);
        Py_DECREF(name);
        Py_XDECREF(value);
        if (err != 0)
            break;
    }
    Py_DECREF(all);
    return err;
}


static int __pyx_import_star(PyObject* m) {

    int i;
    int ret = -1;
    char* s;
    PyObject *locals = 0;
    PyObject *list = 0;
#if PY_MAJOR_VERSION >= 3
    PyObject *utf8_name = 0;
#endif
    PyObject *name;
    PyObject *item;

    locals = PyDict_New();              if (!locals) goto bad;
    if (__Pyx_import_all_from(locals, m) < 0) goto bad;
    list = PyDict_Items(locals);        if (!list) goto bad;

    for(i=0; i<PyList_GET_SIZE(list); i++) {
        name = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 0);
        item = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 1);
#if PY_MAJOR_VERSION >= 3
        utf8_name = PyUnicode_AsUTF8String(name);
        if (!utf8_name) goto bad;
        s = PyBytes_AS_STRING(utf8_name);
        if (__pyx_import_star_set(item, name, s) < 0) goto bad;
        Py_DECREF(utf8_name); utf8_name = 0;
#else
        s = PyString_AsString(name);
        if (!s) goto bad;
        if (__pyx_import_star_set(item, name, s) < 0) goto bad;
#endif
    }
    ret = 0;

bad:
    Py_XDECREF(locals);
    Py_XDECREF(list);
#if PY_MAJOR_VERSION >= 3
    Py_XDECREF(utf8_name);
#endif
    return ret;
}



#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "_libiminuit",
    __pyx_k_IPython_Minuit_class_definition, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_ARRAY_DOUBLE_TYPECODE, __pyx_k_ARRAY_DOUBLE_TYPECODE, sizeof(__pyx_k_ARRAY_DOUBLE_TYPECODE), 0, 0, 1, 1},
  {&__pyx_kp_u_Cannot_find_s_in_list_of_variabl, __pyx_k_Cannot_find_s_in_list_of_variabl, sizeof(__pyx_k_Cannot_find_s_in_list_of_variabl), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_understand_keyword_s_May, __pyx_k_Cannot_understand_keyword_s_May, sizeof(__pyx_k_Cannot_understand_keyword_s_May), 0, 1, 0, 0},
  {&__pyx_n_s_ConsoleFrontend, __pyx_k_ConsoleFrontend, sizeof(__pyx_k_ConsoleFrontend), 0, 0, 1, 1},
  {&__pyx_kp_u_Covariance_is_not_valid_May_be_t, __pyx_k_Covariance_is_not_valid_May_be_t, sizeof(__pyx_k_Covariance_is_not_valid_May_be_t), 0, 1, 0, 0},
  {&__pyx_kp_u_Function_mimimum_is_not_valid_Ma, __pyx_k_Function_mimimum_is_not_valid_Ma, sizeof(__pyx_k_Function_mimimum_is_not_valid_Ma), 0, 1, 0, 0},
  {&__pyx_kp_u_Function_minimum_has_not_been_ca, __pyx_k_Function_minimum_has_not_been_ca, sizeof(__pyx_k_Function_minimum_has_not_been_ca), 0, 1, 0, 0},
  {&__pyx_n_u_HESSE, __pyx_k_HESSE, sizeof(__pyx_k_HESSE), 0, 1, 0, 1},
  {&__pyx_kp_u_HESSE_Failed_Covariance_and_Glob, __pyx_k_HESSE_Failed_Covariance_and_Glob, sizeof(__pyx_k_HESSE_Failed_Covariance_and_Glob), 0, 1, 0, 0},
  {&__pyx_n_s_HesseFailedWarning, __pyx_k_HesseFailedWarning, sizeof(__pyx_k_HesseFailedWarning), 0, 0, 1, 1},
  {&__pyx_n_s_HtmlFrontend, __pyx_k_HtmlFrontend, sizeof(__pyx_k_HtmlFrontend), 0, 0, 1, 1},
  {&__pyx_n_s_IPYTHON, __pyx_k_IPYTHON, sizeof(__pyx_k_IPYTHON), 0, 0, 1, 1},
  {&__pyx_n_s_InitialParamWarning, __pyx_k_InitialParamWarning, sizeof(__pyx_k_InitialParamWarning), 0, 0, 1, 1},
  {&__pyx_n_s_LatexFactory, __pyx_k_LatexFactory, sizeof(__pyx_k_LatexFactory), 0, 0, 1, 1},
  {&__pyx_n_u_MIGRAD, __pyx_k_MIGRAD, sizeof(__pyx_k_MIGRAD), 0, 1, 0, 1},
  {&__pyx_n_u_MINOS, __pyx_k_MINOS, sizeof(__pyx_k_MINOS), 0, 1, 0, 1},
  {&__pyx_kp_u_Migrad_fails_to_converge_for_s_f, __pyx_k_Migrad_fails_to_converge_for_s_f, sizeof(__pyx_k_Migrad_fails_to_converge_for_s_f), 0, 1, 0, 0},
  {&__pyx_kp_u_Minos_require_function_to_be_at, __pyx_k_Minos_require_function_to_be_at, sizeof(__pyx_k_Minos_require_function_to_be_at), 0, 1, 0, 0},
  {&__pyx_n_u_Minuit, __pyx_k_Minuit, sizeof(__pyx_k_Minuit), 0, 1, 0, 1},
  {&__pyx_n_s_NameError, __pyx_k_NameError, sizeof(__pyx_k_NameError), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_kp_u_Parameter_s_does_not_have_initia, __pyx_k_Parameter_s_does_not_have_initia, sizeof(__pyx_k_Parameter_s_does_not_have_initia), 0, 1, 0, 0},
  {&__pyx_kp_u_Parameter_s_is_floating_but_does, __pyx_k_Parameter_s_is_floating_but_does, sizeof(__pyx_k_Parameter_s_is_floating_but_does), 0, 1, 0, 0},
  {&__pyx_kp_u_Request_for_minimization_subtrac, __pyx_k_Request_for_minimization_subtrac, sizeof(__pyx_k_Request_for_minimization_subtrac), 0, 1, 0, 0},
  {&__pyx_kp_u_Run_Migrad_first, __pyx_k_Run_Migrad_first, sizeof(__pyx_k_Run_Migrad_first), 0, 1, 0, 0},
  {&__pyx_kp_u_Run_migrad_first, __pyx_k_Run_migrad_first, sizeof(__pyx_k_Run_migrad_first), 0, 1, 0, 0},
  {&__pyx_kp_u_Run_migrad_hesse_first, __pyx_k_Run_migrad_hesse_first, sizeof(__pyx_k_Run_migrad_hesse_first), 0, 1, 0, 0},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeWarning, __pyx_k_RuntimeWarning, sizeof(__pyx_k_RuntimeWarning), 0, 0, 1, 1},
  {&__pyx_kp_u_Specified_parameters_r_cannot_be, __pyx_k_Specified_parameters_r_cannot_be, sizeof(__pyx_k_Specified_parameters_r_cannot_be), 0, 1, 0, 0},
  {&__pyx_kp_u_Specified_variable_name_for_mino, __pyx_k_Specified_variable_name_for_mino, sizeof(__pyx_k_Specified_variable_name_for_mino), 0, 1, 0, 0},
  {&__pyx_kp_u_Specify_nsigma_bound_but_error_b, __pyx_k_Specify_nsigma_bound_but_error_b, sizeof(__pyx_k_Specify_nsigma_bound_but_error_b), 0, 1, 0, 0},
  {&__pyx_n_s_Struct, __pyx_k_Struct, sizeof(__pyx_k_Struct), 0, 0, 1, 1},
  {&__pyx_kp_u_Unknown_parameter_s, __pyx_k_Unknown_parameter_s, sizeof(__pyx_k_Unknown_parameter_s), 0, 1, 0, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 1, 1},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 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_at_lower_limit, __pyx_k_at_lower_limit, sizeof(__pyx_k_at_lower_limit), 0, 0, 1, 1},
  {&__pyx_n_s_at_lower_max_fcn, __pyx_k_at_lower_max_fcn, sizeof(__pyx_k_at_lower_max_fcn), 0, 0, 1, 1},
  {&__pyx_n_s_at_upper_limit, __pyx_k_at_upper_limit, sizeof(__pyx_k_at_upper_limit), 0, 0, 1, 1},
  {&__pyx_n_s_at_upper_max_fcn, __pyx_k_at_upper_max_fcn, sizeof(__pyx_k_at_upper_max_fcn), 0, 0, 1, 1},
  {&__pyx_n_s_auto_frontend, __pyx_k_auto_frontend, sizeof(__pyx_k_auto_frontend), 0, 0, 1, 1},
  {&__pyx_n_s_band, __pyx_k_band, sizeof(__pyx_k_band), 0, 0, 1, 1},
  {&__pyx_n_s_bins, __pyx_k_bins, sizeof(__pyx_k_bins), 0, 0, 1, 1},
  {&__pyx_n_s_bound, __pyx_k_bound, sizeof(__pyx_k_bound), 0, 0, 1, 1},
  {&__pyx_n_s_build_matrix, __pyx_k_build_matrix, sizeof(__pyx_k_build_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_build_param_table, __pyx_k_build_param_table, sizeof(__pyx_k_build_param_table), 0, 0, 1, 1},
  {&__pyx_n_s_check_extra_args, __pyx_k_check_extra_args, sizeof(__pyx_k_check_extra_args), 0, 0, 1, 1},
  {&__pyx_n_s_check_extra_args_locals_genexpr, __pyx_k_check_extra_args_locals_genexpr, sizeof(__pyx_k_check_extra_args_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_contour_locals_genexpr, __pyx_k_contour_locals_genexpr, sizeof(__pyx_k_contour_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_correlation, __pyx_k_correlation, sizeof(__pyx_k_correlation), 0, 0, 1, 1},
  {&__pyx_n_u_default_errordef, __pyx_k_default_errordef, sizeof(__pyx_k_default_errordef), 0, 1, 0, 1},
  {&__pyx_n_s_describe, __pyx_k_describe, sizeof(__pyx_k_describe), 0, 0, 1, 1},
  {&__pyx_n_s_draw_contour, __pyx_k_draw_contour, sizeof(__pyx_k_draw_contour), 0, 0, 1, 1},
  {&__pyx_n_s_draw_mncontour, __pyx_k_draw_mncontour, sizeof(__pyx_k_draw_mncontour), 0, 0, 1, 1},
  {&__pyx_n_s_draw_profile, __pyx_k_draw_profile, sizeof(__pyx_k_draw_profile), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1},
  {&__pyx_n_s_edm, __pyx_k_edm, sizeof(__pyx_k_edm), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_n_u_error_2, __pyx_k_error_2, sizeof(__pyx_k_error_2), 0, 1, 0, 1},
  {&__pyx_n_s_errordef, __pyx_k_errordef, sizeof(__pyx_k_errordef), 0, 0, 1, 1},
  {&__pyx_kp_u_errordef_is_not_given_Default_to, __pyx_k_errordef_is_not_given_Default_to, sizeof(__pyx_k_errordef_is_not_given_Default_to), 0, 1, 0, 0},
  {&__pyx_n_s_extract_error, __pyx_k_extract_error, sizeof(__pyx_k_extract_error), 0, 0, 1, 1},
  {&__pyx_n_s_extract_fix, __pyx_k_extract_fix, sizeof(__pyx_k_extract_fix), 0, 0, 1, 1},
  {&__pyx_n_s_extract_limit, __pyx_k_extract_limit, sizeof(__pyx_k_extract_limit), 0, 0, 1, 1},
  {&__pyx_n_s_fcn, __pyx_k_fcn, sizeof(__pyx_k_fcn), 0, 0, 1, 1},
  {&__pyx_n_u_fix, __pyx_k_fix, sizeof(__pyx_k_fix), 0, 1, 0, 1},
  {&__pyx_kp_u_fix__s, __pyx_k_fix__s, sizeof(__pyx_k_fix__s), 0, 1, 0, 0},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_n_s_forced_parameters, __pyx_k_forced_parameters, sizeof(__pyx_k_forced_parameters), 0, 0, 1, 1},
  {&__pyx_n_s_frontend, __pyx_k_frontend, sizeof(__pyx_k_frontend), 0, 0, 1, 1},
  {&__pyx_n_s_frontends_console, __pyx_k_frontends_console, sizeof(__pyx_k_frontends_console), 0, 0, 1, 1},
  {&__pyx_n_s_frontends_html, __pyx_k_frontends_html, sizeof(__pyx_k_frontends_html), 0, 0, 1, 1},
  {&__pyx_n_s_fval, __pyx_k_fval, sizeof(__pyx_k_fval), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get_fmin, __pyx_k_get_fmin, sizeof(__pyx_k_get_fmin), 0, 0, 1, 1},
  {&__pyx_n_s_get_initial_param_state, __pyx_k_get_initial_param_state, sizeof(__pyx_k_get_initial_param_state), 0, 0, 1, 1},
  {&__pyx_n_s_get_param_states, __pyx_k_get_param_states, sizeof(__pyx_k_get_param_states), 0, 0, 1, 1},
  {&__pyx_n_s_has_accurate_covar, __pyx_k_has_accurate_covar, sizeof(__pyx_k_has_accurate_covar), 0, 0, 1, 1},
  {&__pyx_n_s_has_covariance, __pyx_k_has_covariance, sizeof(__pyx_k_has_covariance), 0, 0, 1, 1},
  {&__pyx_n_s_has_limits, __pyx_k_has_limits, sizeof(__pyx_k_has_limits), 0, 0, 1, 1},
  {&__pyx_n_s_has_lower_limit, __pyx_k_has_lower_limit, sizeof(__pyx_k_has_lower_limit), 0, 0, 1, 1},
  {&__pyx_n_s_has_made_posdef_covar, __pyx_k_has_made_posdef_covar, sizeof(__pyx_k_has_made_posdef_covar), 0, 0, 1, 1},
  {&__pyx_n_s_has_posdef_covar, __pyx_k_has_posdef_covar, sizeof(__pyx_k_has_posdef_covar), 0, 0, 1, 1},
  {&__pyx_n_s_has_reached_call_limit, __pyx_k_has_reached_call_limit, sizeof(__pyx_k_has_reached_call_limit), 0, 0, 1, 1},
  {&__pyx_n_s_has_upper_limit, __pyx_k_has_upper_limit, sizeof(__pyx_k_has_upper_limit), 0, 0, 1, 1},
  {&__pyx_n_s_has_valid_parameters, __pyx_k_has_valid_parameters, sizeof(__pyx_k_has_valid_parameters), 0, 0, 1, 1},
  {&__pyx_n_s_hesse_failed, __pyx_k_hesse_failed, sizeof(__pyx_k_hesse_failed), 0, 0, 1, 1},
  {&__pyx_n_s_iminuit, __pyx_k_iminuit, sizeof(__pyx_k_iminuit), 0, 0, 1, 1},
  {&__pyx_n_s_iminuit_iminuit_warnings, __pyx_k_iminuit_iminuit_warnings, sizeof(__pyx_k_iminuit_iminuit_warnings), 0, 0, 1, 1},
  {&__pyx_n_s_iminuit_latex, __pyx_k_iminuit_latex, sizeof(__pyx_k_iminuit_latex), 0, 0, 1, 1},
  {&__pyx_n_s_iminuit_py23_compat, __pyx_k_iminuit_py23_compat, sizeof(__pyx_k_iminuit_py23_compat), 0, 0, 1, 1},
  {&__pyx_n_s_iminuit_util, __pyx_k_iminuit_util, sizeof(__pyx_k_iminuit_util), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_init___locals_genexpr, __pyx_k_init___locals_genexpr, sizeof(__pyx_k_init___locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_is_above_max_edm, __pyx_k_is_above_max_edm, sizeof(__pyx_k_is_above_max_edm), 0, 0, 1, 1},
  {&__pyx_n_s_is_clean_state, __pyx_k_is_clean_state, sizeof(__pyx_k_is_clean_state), 0, 0, 1, 1},
  {&__pyx_n_s_is_const, __pyx_k_is_const, sizeof(__pyx_k_is_const), 0, 0, 1, 1},
  {&__pyx_n_s_is_fixed, __pyx_k_is_fixed, sizeof(__pyx_k_is_fixed), 0, 0, 1, 1},
  {&__pyx_n_s_is_valid, __pyx_k_is_valid, sizeof(__pyx_k_is_valid), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kwd, __pyx_k_kwd, sizeof(__pyx_k_kwd), 0, 0, 1, 1},
  {&__pyx_n_u_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 1, 0, 1},
  {&__pyx_kp_u_limit_for_parameter_s_is_invalid, __pyx_k_limit_for_parameter_s_is_invalid, sizeof(__pyx_k_limit_for_parameter_s_is_invalid), 0, 1, 0, 0},
  {&__pyx_n_s_list_of_fixed_param, __pyx_k_list_of_fixed_param, sizeof(__pyx_k_list_of_fixed_param), 0, 0, 1, 1},
  {&__pyx_n_s_list_of_vary_param, __pyx_k_list_of_vary_param, sizeof(__pyx_k_list_of_vary_param), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_s_lower_limit, __pyx_k_lower_limit, sizeof(__pyx_k_lower_limit), 0, 0, 1, 1},
  {&__pyx_n_s_lower_new_min, __pyx_k_lower_new_min, sizeof(__pyx_k_lower_new_min), 0, 0, 1, 1},
  {&__pyx_n_s_lower_valid, __pyx_k_lower_valid, sizeof(__pyx_k_lower_valid), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_matrix, __pyx_k_matrix, sizeof(__pyx_k_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_matrix_accurate, __pyx_k_matrix_accurate, sizeof(__pyx_k_matrix_accurate), 0, 0, 1, 1},
  {&__pyx_n_s_matrix_locals_genexpr, __pyx_k_matrix_locals_genexpr, sizeof(__pyx_k_matrix_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_matrix_locals_genexpr_locals_gen, __pyx_k_matrix_locals_genexpr_locals_gen, sizeof(__pyx_k_matrix_locals_genexpr_locals_gen), 0, 0, 1, 1},
  {&__pyx_n_s_maxcall, __pyx_k_maxcall, sizeof(__pyx_k_maxcall), 0, 0, 1, 1},
  {&__pyx_n_s_migrad, __pyx_k_migrad, sizeof(__pyx_k_migrad), 0, 0, 1, 1},
  {&__pyx_n_s_migrad_ok, __pyx_k_migrad_ok, sizeof(__pyx_k_migrad_ok), 0, 0, 1, 1},
  {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
  {&__pyx_n_s_mncontour_grid, __pyx_k_mncontour_grid, sizeof(__pyx_k_mncontour_grid), 0, 0, 1, 1},
  {&__pyx_kp_u_mncontour_has_to_be_run_on_vary, __pyx_k_mncontour_has_to_be_run_on_vary, sizeof(__pyx_k_mncontour_has_to_be_run_on_vary), 0, 1, 0, 0},
  {&__pyx_n_s_mnprofile, __pyx_k_mnprofile, sizeof(__pyx_k_mnprofile), 0, 0, 1, 1},
  {&__pyx_n_s_mnprofile_locals_genexpr, __pyx_k_mnprofile_locals_genexpr, sizeof(__pyx_k_mnprofile_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_ncall, __pyx_k_ncall, sizeof(__pyx_k_ncall), 0, 0, 1, 1},
  {&__pyx_n_s_nfcn, __pyx_k_nfcn, sizeof(__pyx_k_nfcn), 0, 0, 1, 1},
  {&__pyx_n_s_nsigma, __pyx_k_nsigma, sizeof(__pyx_k_nsigma), 0, 0, 1, 1},
  {&__pyx_n_s_nsplit, __pyx_k_nsplit, sizeof(__pyx_k_nsplit), 0, 0, 1, 1},
  {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1},
  {&__pyx_n_s_numpoints, __pyx_k_numpoints, sizeof(__pyx_k_numpoints), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_param_name, __pyx_k_param_name, sizeof(__pyx_k_param_name), 0, 0, 1, 1},
  {&__pyx_n_s_parameters, __pyx_k_parameters, sizeof(__pyx_k_parameters), 0, 0, 1, 1},
  {&__pyx_n_s_pedantic, __pyx_k_pedantic, sizeof(__pyx_k_pedantic), 0, 0, 1, 1},
  {&__pyx_n_s_plotting, __pyx_k_plotting, sizeof(__pyx_k_plotting), 0, 0, 1, 1},
  {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1},
  {&__pyx_n_s_prepare_initial_param, __pyx_k_prepare_initial_param, sizeof(__pyx_k_prepare_initial_param), 0, 0, 1, 1},
  {&__pyx_n_s_prepare_param, __pyx_k_prepare_param, sizeof(__pyx_k_prepare_param), 0, 0, 1, 1},
  {&__pyx_n_s_print_banner, __pyx_k_print_banner, sizeof(__pyx_k_print_banner), 0, 0, 1, 1},
  {&__pyx_n_s_print_fmin, __pyx_k_print_fmin, sizeof(__pyx_k_print_fmin), 0, 0, 1, 1},
  {&__pyx_n_s_print_hline, __pyx_k_print_hline, sizeof(__pyx_k_print_hline), 0, 0, 1, 1},
  {&__pyx_n_s_print_initial_param, __pyx_k_print_initial_param, sizeof(__pyx_k_print_initial_param), 0, 0, 1, 1},
  {&__pyx_n_s_print_level, __pyx_k_print_level, sizeof(__pyx_k_print_level), 0, 0, 1, 1},
  {&__pyx_n_s_print_matrix, __pyx_k_print_matrix, sizeof(__pyx_k_print_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_print_merror, __pyx_k_print_merror, sizeof(__pyx_k_print_merror), 0, 0, 1, 1},
  {&__pyx_n_s_print_param, __pyx_k_print_param, sizeof(__pyx_k_print_param), 0, 0, 1, 1},
  {&__pyx_n_s_profile, __pyx_k_profile, sizeof(__pyx_k_profile), 0, 0, 1, 1},
  {&__pyx_n_s_profile_locals_genexpr, __pyx_k_profile_locals_genexpr, sizeof(__pyx_k_profile_locals_genexpr), 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_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_resume, __pyx_k_resume, sizeof(__pyx_k_resume), 0, 0, 1, 1},
  {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
  {&__pyx_kp_u_s_float_But_there_is_no_paramet, __pyx_k_s_float_But_there_is_no_paramet, sizeof(__pyx_k_s_float_But_there_is_no_paramet), 0, 1, 0, 0},
  {&__pyx_kp_u_s_is_given_But_there_is_no_para, __pyx_k_s_is_given_But_there_is_no_para, sizeof(__pyx_k_s_is_given_But_there_is_no_para), 0, 1, 0, 0},
  {&__pyx_kp_u_s_is_given_But_there_is_no_para_2, __pyx_k_s_is_given_But_there_is_no_para_2, sizeof(__pyx_k_s_is_given_But_there_is_no_para_2), 0, 1, 0, 0},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_set_errordef, __pyx_k_set_errordef, sizeof(__pyx_k_set_errordef), 0, 0, 1, 1},
  {&__pyx_n_s_show_sigma, __pyx_k_show_sigma, sizeof(__pyx_k_show_sigma), 0, 0, 1, 1},
  {&__pyx_n_s_sigma, __pyx_k_sigma, sizeof(__pyx_k_sigma), 0, 0, 1, 1},
  {&__pyx_n_s_sigma_res, __pyx_k_sigma_res, sizeof(__pyx_k_sigma_res), 0, 0, 1, 1},
  {&__pyx_n_s_skip_fixed, __pyx_k_skip_fixed, sizeof(__pyx_k_skip_fixed), 0, 0, 1, 1},
  {&__pyx_kp_u_skip_fixed_False_is_not_supporte, __pyx_k_skip_fixed_False_is_not_supporte, sizeof(__pyx_k_skip_fixed_False_is_not_supporte), 0, 1, 0, 0},
  {&__pyx_n_s_subtract_min, __pyx_k_subtract_min, sizeof(__pyx_k_subtract_min), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_throw_nan, __pyx_k_throw_nan, sizeof(__pyx_k_throw_nan), 0, 0, 1, 1},
  {&__pyx_n_s_up, __pyx_k_up, sizeof(__pyx_k_up), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
  {&__pyx_n_s_upper_limit, __pyx_k_upper_limit, sizeof(__pyx_k_upper_limit), 0, 0, 1, 1},
  {&__pyx_n_s_upper_new_min, __pyx_k_upper_new_min, sizeof(__pyx_k_upper_new_min), 0, 0, 1, 1},
  {&__pyx_n_s_upper_valid, __pyx_k_upper_valid, sizeof(__pyx_k_upper_valid), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_var, __pyx_k_var, sizeof(__pyx_k_var), 0, 0, 1, 1},
  {&__pyx_n_s_vname, __pyx_k_vname, sizeof(__pyx_k_vname), 0, 0, 1, 1},
  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "iminuit/_libiminuit.pyx":319
 *             if not callable(default_errordef):
 *                 if pedantic:
 *                     warn(InitialParamWarning(             # <<<<<<<<<<<<<<
 *                         'errordef is not given. Default to 1.'))
 *                 self.errordef = 1.0
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_errordef_is_not_given_Default_to); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "iminuit/_libiminuit.pyx":392
 * 
 *         if self.print_level > 0:
 *             self.frontend.print_banner('MIGRAD')             # <<<<<<<<<<<<<<
 * 
 *         if not resume or self.is_clean_state():
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_u_MIGRAD); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "iminuit/_libiminuit.pyx":459
 *         cdef MnHesse*hesse = NULL
 *         cdef MnUserParameterState upst
 *         if self.print_level > 0: self.frontend.print_banner('HESSE')             # <<<<<<<<<<<<<<
 *         if self.cfmin is NULL:
 *             raise RuntimeError('Run migrad first')
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_u_HESSE); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "iminuit/_libiminuit.pyx":461
 *         if self.print_level > 0: self.frontend.print_banner('HESSE')
 *         if self.cfmin is NULL:
 *             raise RuntimeError('Run migrad first')             # <<<<<<<<<<<<<<
 *         hesse = new MnHesse(self.strategy)
 *         upst = hesse.call(deref(self.pyfcn), self.cfmin.UserState())
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Run_migrad_first); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "iminuit/_libiminuit.pyx":496
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:
 *             raise RuntimeError('Minos require function to be at the minimum.'             # <<<<<<<<<<<<<<
 *                                ' Run migrad first.')
 *         cdef unsigned int index = 0
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Minos_require_function_to_be_at); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "iminuit/_libiminuit.pyx":504
 *         cdef double oldup = self.pyfcn.Up()
 *         self.pyfcn.set_up(oldup * sigma * sigma)
 *         if self.print_level > 0: self.frontend.print_banner('MINOS')             # <<<<<<<<<<<<<<
 *         if not self.cfmin.IsValid():
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_u_MINOS); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "iminuit/_libiminuit.pyx":506
 *         if self.print_level > 0: self.frontend.print_banner('MINOS')
 *         if not self.cfmin.IsValid():
 *             raise RuntimeError(('Function mimimum is not valid. Make sure'             # <<<<<<<<<<<<<<
 *                                 ' migrad converge first'))
 *         if var is not None and var not in self.parameters:
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Function_mimimum_is_not_valid_Ma); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "iminuit/_libiminuit.pyx":520
 *             if vname in fixed_param:
 *                 if var is not None:  #specifying vname but it's fixed
 *                     warn(RuntimeWarning(             # <<<<<<<<<<<<<<
 *                         'Specified variable name for minos is set to fixed'))
 *                     return None
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Specified_variable_name_for_mino); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "iminuit/_libiminuit.pyx":539
 *         """Error or correlation matrix in tuple or tuples format."""
 *         if self.last_upst is NULL:
 *             raise RuntimeError("Run migrad/hesse first")             # <<<<<<<<<<<<<<
 *         if not skip_fixed:
 *             raise RuntimeError('skip_fixed=False is not supported')
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Run_migrad_hesse_first); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "iminuit/_libiminuit.pyx":541
 *             raise RuntimeError("Run migrad/hesse first")
 *         if not skip_fixed:
 *             raise RuntimeError('skip_fixed=False is not supported')             # <<<<<<<<<<<<<<
 *         if not self.last_upst.HasCovariance():
 *             raise RuntimeError(
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_skip_fixed_False_is_not_supporte); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "iminuit/_libiminuit.pyx":543
 *             raise RuntimeError('skip_fixed=False is not supported')
 *         if not self.last_upst.HasCovariance():
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 "Covariance is not valid. May be the last Hesse call failed?")
 * 
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Covariance_is_not_valid_May_be_t); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "iminuit/_libiminuit.pyx":590
 *         """Check if variable *vname* is (initially) fixed"""
 *         if vname not in self.parameters:
 *             raise RuntimeError('Cannot find %s in list of variables.')             # <<<<<<<<<<<<<<
 *         cdef unsigned int index = self.var2pos[vname]
 *         if self.last_upst is NULL:
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Cannot_find_s_in_list_of_variabl); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "iminuit/_libiminuit.pyx":660
 *         #                               self.cfmin.UserState())
 *         if self.cfmin is NULL:
 *             raise RuntimeError("Function minimum has not been calculated.")             # <<<<<<<<<<<<<<
 *         sfmin = cfmin2struct(self.cfmin)
 *         ncalls = 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Function_minimum_has_not_been_ca); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "iminuit/_libiminuit.pyx":840
 *         if isinstance(bound, (int, long, float)):
 *             if not self.matrix_accurate():
 *                 warn('Specify nsigma bound but error '             # <<<<<<<<<<<<<<
 *                      'but error matrix is not accurate.')
 *             start = self.values[vname]
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Specify_nsigma_bound_but_error_b); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "iminuit/_libiminuit.pyx":952
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:
 *             raise RuntimeError("Request for minimization "             # <<<<<<<<<<<<<<
 *                                "subtraction but no minimization has been done. "
 *                                "Run migrad first.")
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Request_for_minimization_subtrac); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "iminuit/_libiminuit.pyx":1067
 * 
 *         if subtract_min and self.cfmin is NULL:
 *             raise RuntimeError("Request for minimization "             # <<<<<<<<<<<<<<
 *                                "subtraction but no minimization has been done. "
 *                                "Run migrad first.")
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Request_for_minimization_subtrac); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "iminuit/_libiminuit.pyx":1114
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:
 *             raise ValueError('Run Migrad first')             # <<<<<<<<<<<<<<
 * 
 *         cdef unsigned int ix = self.var2pos[x]
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Run_Migrad_first); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "iminuit/_libiminuit.pyx":1122
 * 
 *         if x not in vary_param or y not in vary_param:
 *             raise ValueError('mncontour has to be run on vary parameters.')             # <<<<<<<<<<<<<<
 * 
 *         cdef double oldup = self.pyfcn.Up()
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_mncontour_has_to_be_run_on_vary); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_neg_1_0 = PyFloat_FromDouble(-1.0); if (unlikely(!__pyx_float_neg_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_libiminuit(void); /*proto*/
PyMODINIT_FUNC init_libiminuit(void)
#else
PyMODINIT_FUNC PyInit__libiminuit(void); /*proto*/
PyMODINIT_FUNC PyInit__libiminuit(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #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("PyMODINIT_FUNC PyInit__libiminuit(void)", 0);
  if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("_libiminuit", __pyx_methods, __pyx_k_IPython_Minuit_class_definition, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_iminuit___libiminuit) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "iminuit._libiminuit")) {
      if (unlikely(PyDict_SetItemString(modules, "iminuit._libiminuit", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_7iminuit_11_libiminuit_Minuit = &__pyx_vtable_7iminuit_11_libiminuit_Minuit;
  __pyx_vtable_7iminuit_11_libiminuit_Minuit.construct_FCN = (PyObject *(*)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *))__pyx_f_7iminuit_11_libiminuit_6Minuit_construct_FCN;
  __pyx_vtable_7iminuit_11_libiminuit_Minuit.clear_cobj = (void (*)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *))__pyx_f_7iminuit_11_libiminuit_6Minuit_clear_cobj;
  __pyx_vtable_7iminuit_11_libiminuit_Minuit.refreshInternalState = (PyObject *(*)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *))__pyx_f_7iminuit_11_libiminuit_6Minuit_refreshInternalState;
  __pyx_vtable_7iminuit_11_libiminuit_Minuit.initialParameterState = (MnUserParameterState *(*)(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *))__pyx_f_7iminuit_11_libiminuit_6Minuit_initialParameterState;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit_Minuit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit_Minuit.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7iminuit_11_libiminuit_Minuit, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7iminuit_11_libiminuit_6Minuit___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7iminuit_11_libiminuit_6Minuit___init__.doc = __pyx_doc_7iminuit_11_libiminuit_6Minuit___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7iminuit_11_libiminuit_6Minuit___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7iminuit_11_libiminuit_Minuit.tp_dict, __pyx_vtabptr_7iminuit_11_libiminuit_Minuit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "Minuit", (PyObject *)&__pyx_type_7iminuit_11_libiminuit_Minuit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit_Minuit = &__pyx_type_7iminuit_11_libiminuit_Minuit;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct____init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct____init__.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct____init__ = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct____init__;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_10_profile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_10_profile.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_10_profile = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_10_profile;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_12_contour) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_12_contour.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_12_contour = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_12_contour;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr;
  if (PyType_Ready(&__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr.tp_print = 0;
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif

  /* "iminuit/_libiminuit.pyx":7
 * from __future__ import (absolute_import, division, print_function,
 *                         unicode_literals)
 * import array             # <<<<<<<<<<<<<<
 * from warnings import warn
 * from libc.math cimport sqrt
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_array, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":8
 *                         unicode_literals)
 * import array
 * from warnings import warn             # <<<<<<<<<<<<<<
 * from libc.math cimport sqrt
 * from libcpp.string cimport string
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_warn);
  __Pyx_GIVEREF(__pyx_n_s_warn);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_warn);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warn, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":12
 * from libcpp.string cimport string
 * from cython.operator cimport dereference as deref
 * from iminuit.py23_compat import ARRAY_DOUBLE_TYPECODE             # <<<<<<<<<<<<<<
 * from iminuit.util import *
 * from iminuit.iminuit_warnings import (InitialParamWarning,
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_ARRAY_DOUBLE_TYPECODE);
  __Pyx_GIVEREF(__pyx_n_s_ARRAY_DOUBLE_TYPECODE);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ARRAY_DOUBLE_TYPECODE);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_iminuit_py23_compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __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_ARRAY_DOUBLE_TYPECODE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARRAY_DOUBLE_TYPECODE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":13
 * from cython.operator cimport dereference as deref
 * from iminuit.py23_compat import ARRAY_DOUBLE_TYPECODE
 * from iminuit.util import *             # <<<<<<<<<<<<<<
 * from iminuit.iminuit_warnings import (InitialParamWarning,
 *                                       HesseFailedWarning)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s__19);
  __Pyx_GIVEREF(__pyx_n_s__19);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__19);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_iminuit_util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_import_star(__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":14
 * from iminuit.py23_compat import ARRAY_DOUBLE_TYPECODE
 * from iminuit.util import *
 * from iminuit.iminuit_warnings import (InitialParamWarning,             # <<<<<<<<<<<<<<
 *                                       HesseFailedWarning)
 * from iminuit.latex import LatexFactory
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_InitialParamWarning);
  __Pyx_GIVEREF(__pyx_n_s_InitialParamWarning);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InitialParamWarning);
  __Pyx_INCREF(__pyx_n_s_HesseFailedWarning);
  __Pyx_GIVEREF(__pyx_n_s_HesseFailedWarning);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_HesseFailedWarning);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_iminuit_iminuit_warnings, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __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_InitialParamWarning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InitialParamWarning, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_HesseFailedWarning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HesseFailedWarning, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":16
 * from iminuit.iminuit_warnings import (InitialParamWarning,
 *                                       HesseFailedWarning)
 * from iminuit.latex import LatexFactory             # <<<<<<<<<<<<<<
 * from iminuit import _plotting
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_LatexFactory);
  __Pyx_GIVEREF(__pyx_n_s_LatexFactory);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_LatexFactory);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_iminuit_latex, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_LatexFactory); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LatexFactory, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":17
 *                                       HesseFailedWarning)
 * from iminuit.latex import LatexFactory
 * from iminuit import _plotting             # <<<<<<<<<<<<<<
 * 
 * include "Minuit2.pxi"
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_plotting);
  __Pyx_GIVEREF(__pyx_n_s_plotting);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_plotting);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_iminuit, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __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_plotting); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_plotting, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":22
 * include "Minuit2Struct.pxi"
 * 
 * __all__ = ['Minuit']             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_u_Minuit);
  __Pyx_GIVEREF(__pyx_n_u_Minuit);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_Minuit);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1
 * # cython: embedsignature=True, c_string_type=str, c_string_encoding=ascii             # <<<<<<<<<<<<<<
 * # distutils: language = c++
 * """IPython Minuit class definition.
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.to_py":67
 * 
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e___(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [X_to_py(v[i]) for i in range(v.size())]
 * 
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init iminuit._libiminuit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init iminuit._libiminuit");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

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;
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->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

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
}

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_CheckExact(key)) || 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
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(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
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(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;
}

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);
}

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

#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

#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) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#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

#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #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 && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        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;
                    } 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;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } 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;
                    }
                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;
                    } 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;
                    }
                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;
                    } 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;
                    }
                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;
                    } 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;
                    }
                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;
                    } 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;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #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

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#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);
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

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);
}

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");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || 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
}

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;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    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_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 PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        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 = PyThreadState_GET();
        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

static CYTHON_INLINE 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_CheckExact(key)) && 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;
}

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_VERSION_HEX < 0x03030000
    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 (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE 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_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, 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_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, 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_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (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((n >= 0) & (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))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            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));
}

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #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 && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        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;
                    } 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;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } 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;
                    }
                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;
                    } 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;
                    }
                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;
                    } 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;
                    }
                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;
                    } 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;
                    }
                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;
                    } 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;
                    }
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
    }
    #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

static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

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);
    }
}

static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                             int is_tuple, int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
        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);
    } else {
        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
            __Pyx_UnpackTupleError(tuple, 2);
            goto bad;
        }
#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);
        value2 = PyTuple_GET_ITEM(tuple, 1);
        Py_INCREF(value1);
        Py_INCREF(value2);
#endif
        if (decref_tuple) { Py_DECREF(tuple); }
    }
    *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;
}

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 !CYTHON_COMPILING_IN_PYPY
    if (is_dict) {
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#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;
}

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;
}

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyFloat_SubtractObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
    const double b = floatval;
    double a, result;
    if (likely(PyFloat_CheckExact(op1))) {
        a = PyFloat_AS_DOUBLE(op1);
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0; break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            case -2:
            case 2:
                if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                    a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
                        if (size == -2)
                            a = -a;
                        break;
                    }
                }
            case -3:
            case 3:
                if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
                        if (size == -3)
                            a = -a;
                        break;
                    }
                }
            case -4:
            case 4:
                if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
                        if (size == -4)
                            a = -a;
                        break;
                    }
                }
            default:
        #else
        {
        #endif
            a = PyLong_AsDouble(op1);
            if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
        }
    } else {
        return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
    }
        PyFPE_START_PROTECT("subtract", return NULL)
        result = a - b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

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;
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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_COMPILING_IN_CPYTHON
    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_COMPILING_IN_CPYTHON
    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;
    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;
}

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;
}

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);
}

#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;
    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(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

#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;\
    }

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    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))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } 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) 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))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#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_Int(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_Int(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;
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
    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))
            } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } 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) 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))
            } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#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_Int(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_Int(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;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    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);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    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);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
    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))
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } 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) 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))
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#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_Int(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_Int(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;
}

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    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))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } 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) 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))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#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_Int(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_Int(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;
}

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;
}

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    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;
#else
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
#endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}

#include <structmember.h>
#include <frameobject.h>
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);
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(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 PY_VERSION_HEX >= 0x030300A0
        if (ev && Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
#endif
        if (!ev || !PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            } else if (PyTuple_Check(ev)) {
                if (PyTuple_GET_SIZE(ev) >= 1) {
                    PyObject *value;
#if CYTHON_COMPILING_IN_CPYTHON
                    value = PySequence_ITEM(ev, 0);
#else
                    value = PyTuple_GET_ITEM(ev, 0);
                    Py_INCREF(value);
#endif
                    Py_DECREF(ev);
                    ev = value;
                } else {
                    Py_INCREF(Py_None);
                    Py_DECREF(ev);
                    ev = Py_None;
                }
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            return 0;
        }
    } else if (!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;
}
#endif
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    if (value) {
#if CYTHON_COMPILING_IN_PYPY
#else
        if (self->exc_traceback) {
            PyThreadState *tstate = PyThreadState_GET();
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;
    if (retval) {
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
#if CYTHON_COMPILING_IN_PYPY
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
    if (unlikely(!retval && !PyErr_Occurred())) {
        PyErr_SetNone(PyExc_StopIteration);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Coroutine_SendEx(gen, val);
    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(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    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_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = PyIter_Next(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);
    }
    return __Pyx_Coroutine_MethodReturn(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_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } 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(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        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);
}
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(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    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);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (!raised_exception
        || raised_exception == PyExc_StopIteration
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;
    PyObject *yf = gen->yieldfrom;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
            goto throw_here;
        }
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        {
            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;
            }
            ret = PyObject_CallObject(meth, args);
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
}
static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
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);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    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
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    if (gen->resume_label <= 0)
        return ;
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Coroutine_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _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)
{
    Py_INCREF(self->gi_name);
    return self->gi_name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
{
    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)
{
    Py_INCREF(self->gi_qualname);
    return self->gi_qualname;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
{
    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 __pyx_CoroutineObject *__Pyx__Coroutine_New(PyTypeObject* type, __pyx_coroutine_body_t body,
                                                   PyObject *closure, PyObject *name, PyObject *qualname) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (gen == NULL)
        return NULL;
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    PyObject_GC_Track(gen);
    return gen;
}

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;
}

#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 (!abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_VERSION_HEX >= 0x03030000) ?
                        "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;
}

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, 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")},
    {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},
    {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 PY_VERSION_HEX >= 0x030400a1
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Coroutine_del,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

static CYTHON_INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    return *s1 == *s2;
}

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;
}

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;
        ++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 char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__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)) {
#if PY_VERSION_HEX < 0x03030000
        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
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (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
    } 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 PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  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(x);
  }
#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_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
