/* Generated by Cython 0.18 on Tue May 21 04:17:00 2013 */

#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 < 0x02040000
    #error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#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 PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
                                  !PyComplex_Check(o))
  #define PyIndex_Check __Pyx_PyIndex_Check
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
  #define __Pyx_PyIndex_Check PyIndex_Check
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)
  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;
  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#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, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#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)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_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_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_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#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_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#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
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
  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) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#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_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__iminuit___libiminuit
#define __PYX_HAVE_API__iminuit___libiminuit
#include <vector>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include "string.h"
#include <string>
#include "stdio.h"
#include "pythread.h"
#include "math.h"
#include <utility>
#include <memory>
#include "Minuit/FCNBase.h"
#include "Minuit/MnApplication.h"
#include "Minuit/MinuitParameter.h"
#include "Minuit/MnUserCovariance.h"
#include "Minuit/MnGlobalCorrelationCoeff.h"
#include "Minuit/MnUserParameterState.h"
#include "Minuit/MnStrategy.h"
#include "Minuit/MnMigrad.h"
#include "Minuit/MnHesse.h"
#include "Minuit/MnMinos.h"
#include "Minuit/MinosError.h"
#include "Minuit/FunctionMinimum.h"
#include "Minuit/VariableMetricBuilder.h"
#include "Minuit/MnContours.h"
#include "Minuit/ContoursError.h"
#include "PythonFCN.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif
#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
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), 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);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#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))


#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
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[] = {
  "_libiminuit.pyx",
  "Minuit2Struct.pxi",
  "stringsource",
  "stringsource",
  "stringsource",
  "stringsource",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};

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

/* "iminuit/_libiminuit.pyx":465
 *         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 *);
};


/* "iminuit/_libiminuit.pyx":459
 *         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 *);
};


/* "iminuit/_libiminuit.pyx":1228
 *     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;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":247
 * 
 *         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":975
 *         y_binstep = y_blength/(y_bins-1.)
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))             # <<<<<<<<<<<<<<
 *         y_val = array.array('d',(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":784
 *         if subtract_min:
 *             themin = min(results)
 *             results = array.array('d',(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":102
 *     cdef public object frontend
 * 
 *     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":445
 * 
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """return error/correlation matrix in tuple or tuple 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":766
 *         binstep = blength/(bins-1)
 * 
 *         values = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         results = array.array('d')
 *         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":976
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))
 *         y_val = array.array('d',(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":865
 *         args = list(self.args) if args is None else args
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         ret = array.array('d')
 *         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":459
 *         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_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":1229
 *         """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;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":829
 * 
 * 
 *     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":1230
 *         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;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "iminuit/_libiminuit.pyx":1226
 * 
 * 
 *     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":729
 * 
 * 
 *     def mnprofile(self, vname, bins=30, bound=2,             # <<<<<<<<<<<<<<
 *             subtract_min=False):
 *         """calculate minos profile around specify range ie. Migrad results
 */
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":913
 *         return x, y
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D countour 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":39
 * 
 * 
 * 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":465
 *         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_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":39
 * 
 * 
 * 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;
#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); /*proto*/
  #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 /* CYTHON_REFNANNY */
#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)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static CYTHON_INLINE int __Pyx_PySequence_Contains(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); /*proto*/

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

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

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

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

#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); /*proto*/

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

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

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

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

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;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (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 = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {  /* inlined PySequence_GetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return NULL;
                i += l;
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#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)) {
        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

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(PyList_Append(L, x) < 0)) return NULL;
        Py_INCREF(Py_None);
        return Py_None; /* this is just to have an accurate signature */
    } else {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

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

#if PY_VERSION_HEX < 0x02050000
#ifndef PyAnySet_CheckExact
#define PyAnySet_CheckExact(ob) \
    ((ob)->ob_type == &PySet_Type || \
     (ob)->ob_type == &PyFrozenSet_Type)
#define PySet_New(iterable) \
    PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL)
#define Pyx_PyFrozenSet_New(iterable) \
    PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL)
#define PySet_Size(anyset) \
    PyObject_Size((anyset))
#define PySet_Contains(anyset, key) \
    PySequence_Contains((anyset), (key))
#define PySet_Pop(set) \
    PyObject_CallMethod(set, (char *)"pop", NULL)
static CYTHON_INLINE int PySet_Clear(PyObject *set) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}
static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}
static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) {
    PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key);
    if (!ret) return -1;
    Py_DECREF(ret); return 0;
}
#endif /* PyAnySet_CheckExact (<= Py2.4) */
#endif /* < Py2.5  */

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

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

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

#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

#include <new>

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

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

#define __Pyx_Generator_USED
#include <structmember.h>
#include <frameobject.h>
typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_generator_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    int resume_label;
    char is_running;  // using T_BOOL for property below requires char value
} __pyx_GeneratorObject;
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure);
static int __pyx_Generator_init(void);
static int __Pyx_Generator_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 CYTHON_INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/

static int __Pyx_check_binary_version(void);

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

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/

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); /*proto*/

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from '__builtin__' */

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

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

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

/* Module declarations from '__builtin__' */

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

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

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

/* Module declarations from '__builtin__' */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from 'cpython' */

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

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

/* Module declarations from 'libcpp' */

/* 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_(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(const std::pair<double,double> &); /*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 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); /* 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(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_correlation); /* 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_stra); /* 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 char __pyx_k_1[] = "has_valid_parameters";
static char __pyx_k_2[] = "has_made_posdef_covar";
static char __pyx_k_3[] = "has_reached_call_limit";
static char __pyx_k_6[] = "errordef is not given. Default to 1.";
static char __pyx_k_11[] = "Run migrad first";
static char __pyx_k_13[] = "HESSE Failed. Covariance and GlobalCC will not be available";
static char __pyx_k_15[] = "Minos require function to be at the minimum. Run migrad first.";
static char __pyx_k_18[] = "Function mimimum is not valid. Make sure migrad converge first";
static char __pyx_k_20[] = "Specified parameters(%r) cannot be found in parameter list :";
static char __pyx_k_21[] = "Specified variable name for minos is set to fixed";
static char __pyx_k_25[] = "Run migrad/hesse first";
static char __pyx_k_27[] = "skip_fixed=False is not supported";
static char __pyx_k_29[] = "Covariance is not valid. May be the last Hesse call failed?";
static char __pyx_k_32[] = "Cannot find %s in list of variables.";
static char __pyx_k_34[] = "_prepare_initial_param";
static char __pyx_k_35[] = "Function minimum has not been calculated.";
static char __pyx_k_37[] = "get_initial_param_state";
static char __pyx_k_38[] = "Parameter %s does not have initial value. Assume 0.";
static char __pyx_k_39[] = "Parameter %s is floating but does not have initial step size. Assume 1.";
static char __pyx_k_40[] = "%s is given. But there is no parameter %s. Ignore.";
static char __pyx_k_41[] = "%s is given. But there is no parameter %s.                     Ignore.";
static char __pyx_k_42[] = "%s float. But there is no parameter %s.                     Ignore.";
static char __pyx_k_44[] = "Unknown parameter %s";
static char __pyx_k_45[] = "Specify nsigma bound but error but error matrix is not accurate.";
static char __pyx_k_48[] = "fix_%s";
static char __pyx_k_49[] = "Migrad fails to converge for %s=%f";
static char __pyx_k_55[] = "Request for minimization subtraction but no minimization has been done. Run migrad first.";
static char __pyx_k_64[] = "Run Migrad first";
static char __pyx_k_66[] = "mncontour has to be run on vary parameters.";
static char __pyx_k_70[] = "limit for parameter %s is invalid. %r";
static char __pyx_k_71[] = "Cannot understand keyword %s. May be a typo?\nThe parameters are %r";
static char __pyx_k_72[] = "fcn: object";
static char __pyx_k_73[] = "pos2var: object";
static char __pyx_k_74[] = "var2pos: object";
static char __pyx_k_75[] = "errordef: 'double'";
static char __pyx_k_76[] = "tol: 'double'";
static char __pyx_k_77[] = "strategy: 'unsigned int'";
static char __pyx_k_78[] = "print_level: object";
static char __pyx_k_79[] = "throw_nan: 'int'";
static char __pyx_k_80[] = "parameters: object";
static char __pyx_k_81[] = "args: object";
static char __pyx_k_82[] = "values: object";
static char __pyx_k_83[] = "errors: object";
static char __pyx_k_84[] = "covariance: object";
static char __pyx_k_85[] = "fval: 'double'";
static char __pyx_k_86[] = "ncalls: 'int'";
static char __pyx_k_87[] = "edm: 'double'";
static char __pyx_k_88[] = "merrors: object";
static char __pyx_k_89[] = "gcc: object";
static char __pyx_k_90[] = "fitarg: object";
static char __pyx_k_91[] = "narg: object";
static char __pyx_k_92[] = "merrors_struct: object";
static char __pyx_k_93[] = "frontend: object";
static char __pyx_k_94[] = "*";
static char __pyx_k__d[] = "d";
static char __pyx_k__x[] = "x";
static char __pyx_k__y[] = "y";
static char __pyx_k__up[] = "up";
static char __pyx_k__edm[] = "edm";
static char __pyx_k__fcn[] = "fcn";
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__fix_[] = "fix_";
static char __pyx_k__fval[] = "fval";
static char __pyx_k__keys[] = "keys";
static char __pyx_k__name[] = "name";
static char __pyx_k__nfcn[] = "nfcn";
static char __pyx_k__text[] = "text";
static char __pyx_k__util[] = "util";
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__edges[] = "edges";
static char __pyx_k__error[] = "error";
static char __pyx_k__items[] = "items";
static char __pyx_k__latex[] = "latex";
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__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__error_[] = "error_";
static char __pyx_k__limit_[] = "limit_";
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__pprint[] = "pprint";
static char __pyx_k__resume[] = "resume";
static char __pyx_k__update[] = "update";
static char __pyx_k__xrange[] = "xrange";
static char __pyx_k____all__[] = "__all__";
static char __pyx_k__maxcall[] = "maxcall";
static char __pyx_k__profile[] = "profile";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
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__warnings[] = "warnings";
static char __pyx_k__NameError[] = "NameError";
static char __pyx_k___plotting[] = "_plotting";
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__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__show_sigma[] = "show_sigma";
static char __pyx_k__skip_fixed[] = "skip_fixed";
static char __pyx_k____IPYTHON__[] = "__IPYTHON__";
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__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__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__extract_error[] = "extract_error";
static char __pyx_k__extract_limit[] = "extract_limit";
static char __pyx_k__lower_new_min[] = "lower_new_min";
static char __pyx_k__upper_new_min[] = "upper_new_min";
static char __pyx_k__RuntimeWarning[] = "RuntimeWarning";
static char __pyx_k___auto_frontend[] = "_auto_frontend";
static char __pyx_k___prepare_param[] = "_prepare_param";
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__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__at_lower_max_fcn[] = "at_lower_max_fcn";
static char __pyx_k__at_upper_max_fcn[] = "at_upper_max_fcn";
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__iminuit_warnings[] = "iminuit_warnings";
static char __pyx_k__is_above_max_edm[] = "is_above_max_edm";
static char __pyx_k___check_extra_args[] = "_check_extra_args";
static char __pyx_k__build_param_table[] = "build_param_table";
static char __pyx_k__forced_parameters[] = "forced_parameters";
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__list_of_fixed_param[] = "list_of_fixed_param";
static char __pyx_k__print_initial_param[] = "print_initial_param";
static PyObject *__pyx_n_s_1;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_n_s_2;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_n_s_3;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_n_s_34;
static PyObject *__pyx_kp_s_35;
static PyObject *__pyx_n_s_37;
static PyObject *__pyx_kp_s_38;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_kp_s_41;
static PyObject *__pyx_kp_s_42;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_s_49;
static PyObject *__pyx_kp_s_55;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_64;
static PyObject *__pyx_kp_s_66;
static PyObject *__pyx_kp_s_70;
static PyObject *__pyx_kp_s_71;
static PyObject *__pyx_n_s_94;
static PyObject *__pyx_n_s__ConsoleFrontend;
static PyObject *__pyx_n_s__HESSE;
static PyObject *__pyx_n_s__HesseFailedWarning;
static PyObject *__pyx_n_s__HtmlFrontend;
static PyObject *__pyx_n_s__InitialParamWarning;
static PyObject *__pyx_n_s__LatexFactory;
static PyObject *__pyx_n_s__MIGRAD;
static PyObject *__pyx_n_s__MINOS;
static PyObject *__pyx_n_s__Minuit;
static PyObject *__pyx_n_s__NameError;
static PyObject *__pyx_n_s__NotImplementedError;
static PyObject *__pyx_n_s__RunTimeError;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__RuntimeWarning;
static PyObject *__pyx_n_s__Struct;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____IPYTHON__;
static PyObject *__pyx_n_s____all__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___auto_frontend;
static PyObject *__pyx_n_s___check_extra_args;
static PyObject *__pyx_n_s___plotting;
static PyObject *__pyx_n_s___prepare_param;
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__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__copy;
static PyObject *__pyx_n_s__correlation;
static PyObject *__pyx_n_s__d;
static PyObject *__pyx_n_s__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__edges;
static PyObject *__pyx_n_s__edm;
static PyObject *__pyx_n_s__enumerate;
static PyObject *__pyx_n_s__error;
static PyObject *__pyx_n_s__error_;
static PyObject *__pyx_n_s__errordef;
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_s__fix_;
static PyObject *__pyx_n_s__forced_parameters;
static PyObject *__pyx_n_s__frontend;
static PyObject *__pyx_n_s__fval;
static PyObject *__pyx_n_s__get_fmin;
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_posdef_covar;
static PyObject *__pyx_n_s__has_upper_limit;
static PyObject *__pyx_n_s__hesse_failed;
static PyObject *__pyx_n_s__iminuit_warnings;
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_s__latex;
static PyObject *__pyx_n_s__limit_;
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__matrix;
static PyObject *__pyx_n_s__matrix_accurate;
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_n_s__mnprofile;
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__pprint;
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__range;
static PyObject *__pyx_n_s__resume;
static PyObject *__pyx_n_s__round;
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_n_s__subtract_min;
static PyObject *__pyx_n_s__text;
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__util;
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_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_int_999;
static PyObject *__pyx_int_neg_999;
static PyObject *__pyx_k_4;
static PyObject *__pyx_k_5;
static PyObject *__pyx_k_8;
static PyObject *__pyx_k_14;
static PyObject *__pyx_k_23;
static PyObject *__pyx_k_24;
static PyObject *__pyx_k_31;
static PyObject *__pyx_k_43;
static PyObject *__pyx_k_50;
static PyObject *__pyx_k_51;
static PyObject *__pyx_k_52;
static PyObject *__pyx_k_53;
static PyObject *__pyx_k_57;
static PyObject *__pyx_k_58;
static PyObject *__pyx_k_59;
static PyObject *__pyx_k_60;
static PyObject *__pyx_k_63;
static PyObject *__pyx_k_68;
static PyObject *__pyx_k_69;
static PyObject *__pyx_k_tuple_7;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_10;
static PyObject *__pyx_k_tuple_12;
static PyObject *__pyx_k_tuple_16;
static PyObject *__pyx_k_tuple_17;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_22;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_28;
static PyObject *__pyx_k_tuple_30;
static PyObject *__pyx_k_tuple_33;
static PyObject *__pyx_k_tuple_36;
static PyObject *__pyx_k_tuple_46;
static PyObject *__pyx_k_tuple_47;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_56;
static PyObject *__pyx_k_tuple_61;
static PyObject *__pyx_k_tuple_62;
static PyObject *__pyx_k_tuple_65;
static PyObject *__pyx_k_tuple_67;

/* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":1
 * 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);

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":2
 * cdef cfmin2struct(FunctionMinimum* cfmin):
 *     cfmin_struct = Struct(             # <<<<<<<<<<<<<<
 *             fval = cfmin.fval(),
 *             edm = cfmin.edm(),
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __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[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":3
 * cdef cfmin2struct(FunctionMinimum* cfmin):
 *     cfmin_struct = Struct(
 *             fval = cfmin.fval(),             # <<<<<<<<<<<<<<
 *             edm = cfmin.edm(),
 *             nfcn = cfmin.nfcn(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cfmin->fval()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__fval), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":4
 *     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 = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__edm), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":5
 *             fval = cfmin.fval(),
 *             edm = cfmin.edm(),
 *             nfcn = cfmin.nfcn(),             # <<<<<<<<<<<<<<
 *             up = cfmin.up(),
 *             is_valid = cfmin.isValid(),
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_cfmin->nfcn()); 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);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__nfcn), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":6
 *             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 = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__up), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":7
 *             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 = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__is_valid), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":8
 *             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 = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s_1), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":9
 *             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 = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_accurate_covar), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":10
 *             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 = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_posdef_covar), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":12
 *             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 = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s_2), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":13
 *             #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 = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__hesse_failed), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":14
 *             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 = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_covariance), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":15
 *             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 = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__is_above_max_edm), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":16
 *             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 = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s_3), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_cfmin_struct = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":18
 *             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;

  __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.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;
}

/* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":21
 * 
 * 
 * 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);

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":22
 * 
 * cdef minuitparam2struct(MinuitParameter mp):
 *     ret = Struct(             # <<<<<<<<<<<<<<
 *             number = mp.number(),
 *             name = mp.name(),
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __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[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":23
 * cdef minuitparam2struct(MinuitParameter mp):
 *     ret = Struct(
 *             number = mp.number(),             # <<<<<<<<<<<<<<
 *             name = mp.name(),
 *             value = mp.value(),
 */
  __pyx_t_3 = PyLong_FromUnsignedLong(__pyx_v_mp.number()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__number), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":24
 *     ret = Struct(
 *             number = mp.number(),
 *             name = mp.name(),             # <<<<<<<<<<<<<<
 *             value = mp.value(),
 *             error = mp.error(),
 */
  __pyx_t_3 = PyBytes_FromString(__pyx_v_mp.name()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__name), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":25
 *             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 = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__value), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":26
 *             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 = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__error), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":27
 *             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 = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__is_const), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":28
 *             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 = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__is_fixed), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":29
 *             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 = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_limits), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":30
 *             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 = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_lower_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":31
 *             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 = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__has_upper_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":32
 *             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 = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__lower_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":33
 *             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 = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__upper_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":35
 *             upper_limit = mp.upperLimit(),
 *         )
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __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.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;
}

/* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":38
 * 
 * 
 * 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);

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":39
 * 
 * cdef minoserror2struct(MinosError m):
 *     ret = Struct(             # <<<<<<<<<<<<<<
 *         lower = m.lower(),
 *         upper = m.upper(),
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __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[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":40
 * cdef minoserror2struct(MinosError m):
 *     ret = Struct(
 *         lower = m.lower(),             # <<<<<<<<<<<<<<
 *         upper = m.upper(),
 *         is_valid = m.isValid(),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_m.lower()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__lower), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":41
 *     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 = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__upper), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":42
 *         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 = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__is_valid), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":43
 *         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 = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__lower_valid), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":44
 *         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 = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__upper_valid), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":45
 *         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 = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__at_lower_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":46
 *         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 = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__at_upper_limit), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":47
 *         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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__at_lower_max_fcn), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":48
 *         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 = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__at_upper_max_fcn), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":49
 *         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 = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__lower_new_min), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":50
 *         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 = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__upper_new_min), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":51
 *         lower_new_min = m.lowerNewMin(),
 *         upper_new_min = m.upperNewMin(),
 *         nfcn = m.nfcn(),             # <<<<<<<<<<<<<<
 *         min = m.min()
 *         )
 */
  __pyx_t_3 = PyLong_FromUnsignedLong(__pyx_v_m.nfcn()); 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, ((PyObject *)__pyx_n_s__nfcn), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/piti/test/iminuit/iminuit/Minuit2Struct.pxi":52
 *         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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__min), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

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

  __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.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":35
 * 
 * #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":36
 * #look up map with default
 * cdef maplookup(m,k,d):
 *     return m[k] if k in m else d             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_k, __pyx_v_m, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_3 = PyObject_GetItem(__pyx_v_m, __pyx_v_k); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("iminuit._libiminuit.maplookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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**: function to optimized. Minuit automagically find how to\n              call the function and each parameters. 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**: fcn can be set 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. The reason it\n              has this cAmEl case is to keep it compatible with PyMinuit.\n\n            - **errordef**: Optionals. 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 PyMinu""it. 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 fitting argument.\n\n                ::\n\n                    kwdarg = dict(x=1., error_x=0.5)\n                    m = Minuit(f, **kwdarg)\n\n                You can obtain also obtain fit arguments from Minuit object\n                to reuse it later too. Note that fitarg will be automatically\n                updated to minimum value and corresponding error when you ran\n                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_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};
    values[1] = __pyx_k_4;
    values[2] = __pyx_k_5;

    /* "iminuit/_libiminuit.pyx":104
 *     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":105
 *             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 = 102; __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 = 102; __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);
  __Pyx_XDECREF(__pyx_v_kwds);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_8__init___2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":247
 * 
 *         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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_8__init___2generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.__init__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 247; __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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && 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 = 247; __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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 247; __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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_k = __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 = 247; __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 (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "iminuit/_libiminuit.pyx":102
 *     cdef public object frontend
 * 
 *     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 PyObject *__pyx_v_narg = NULL;
  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;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  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)(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_ptype_7iminuit_11_libiminuit___pyx_scope_struct____init__->tp_new(__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":200
 *         """
 * 
 *         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) {
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__describe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __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 = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_fcn);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fcn);
    __Pyx_GIVEREF(__pyx_v_fcn);
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {

    /* "iminuit/_libiminuit.pyx":201
 * 
 *         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":202
 *         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_1 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s___check_extra_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_INCREF(((PyObject *)__pyx_v_kwds));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_kwds));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_kwds));
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

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

  /* "iminuit/_libiminuit.pyx":204
 *         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":206
 *         self.fcn = fcn
 * 
 *         self.frontend = self._auto_frontend() if frontend is None else frontend             # <<<<<<<<<<<<<<
 * 
 *         #maintain 2 dictionary 1 is position to varname
 */
  __pyx_t_2 = (__pyx_v_frontend == Py_None);
  if (__pyx_t_2) {
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s___auto_frontend); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __pyx_t_1;
    __pyx_t_1 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_frontend);
    __pyx_t_4 = __pyx_v_frontend;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  __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_4;
  __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":211
 *         #and varname to position
 *         #self.varname = args
 *         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_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_1 = __pyx_int_0;
    if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_args) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k);
      __pyx_7genexpr__pyx_v_k = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
      __pyx_7genexpr__pyx_v_i = __pyx_t_1;
      __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_7genexpr__pyx_v_i, (PyObject*)__pyx_7genexpr__pyx_v_k))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_t_1 = ((PyObject *)__pyx_t_4);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __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":212
 *         #self.varname = args
 *         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 = 212; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_4 = __pyx_int_0;
    if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_args) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k);
      __pyx_8genexpr1__pyx_v_k = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_i);
      __pyx_8genexpr1__pyx_v_i = __pyx_t_4;
      __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4);
      __pyx_t_4 = __pyx_t_3;
      __pyx_t_3 = 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 = 212; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_t_4 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __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_4;
  __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":214
 *         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_4 = Py_None;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = Py_None;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = Py_None;
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  __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_4;
  __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __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_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __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_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":216
 *         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}
 */
  { /* enter inner scope */
    PyObject *__pyx_8genexpr2__pyx_v_x = NULL;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_args) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        #endif
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_x);
      __pyx_8genexpr2__pyx_v_x = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyFloat_FromDouble(0.); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_f_7iminuit_11_libiminuit_maplookup(((PyObject *)__pyx_v_kwds), __pyx_8genexpr2__pyx_v_x, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr2__pyx_v_x, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_t_1 = ((PyObject *)__pyx_t_5);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __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_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":218
 *         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_8genexpr3__pyx_v_x = NULL;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_args) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_x);
      __pyx_8genexpr3__pyx_v_x = __pyx_t_3;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_n_s__error_), __pyx_8genexpr3__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __pyx_f_7iminuit_11_libiminuit_maplookup(((PyObject *)__pyx_v_kwds), __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr3__pyx_v_x, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_t_5 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":217
 * 
 *         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 = \
 */
  __Pyx_GIVEREF(__pyx_t_5);
  __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_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":220
 *             {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_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_args) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
        #endif
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_8)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_x);
      __pyx_8genexpr4__pyx_v_x = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_n_s__limit_), __pyx_8genexpr4__pyx_v_x); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = __pyx_f_7iminuit_11_libiminuit_maplookup(((PyObject *)__pyx_v_kwds), __pyx_t_8, Py_None); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr4__pyx_v_x, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_t_1 = ((PyObject *)__pyx_t_5);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":219
 *         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 = \
 */
  __Pyx_GIVEREF(__pyx_t_1);
  __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_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":222
 *             {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_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_args) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
        #endif
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x);
      __pyx_8genexpr5__pyx_v_x = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_n_s__fix_), __pyx_8genexpr5__pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __pyx_f_7iminuit_11_libiminuit_maplookup(((PyObject *)__pyx_v_kwds), __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr5__pyx_v_x, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_t_5 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":221
 *         self.initiallimit = \
 *             {x:maplookup(kwds,'limit_'+x,None) for x in args}
 *         self.initialfix = \             # <<<<<<<<<<<<<<
 *             {x:maplookup(kwds,'fix_'+x,False) for x in args}
 * 
 */
  __Pyx_GIVEREF(__pyx_t_5);
  __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_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":224
 *             {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":225
 * 
 *         self.pyfcn = NULL
 *         self.minimizer = NULL             # <<<<<<<<<<<<<<
 *         self.cfmin = NULL
 *         self.last_upst = NULL
 */
  __pyx_cur_scope->__pyx_v_self->minimizer = NULL;

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

  /* "iminuit/_libiminuit.pyx":227
 *         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":229
 *         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);
  if (__pyx_t_2) {

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

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

      /* "iminuit/_libiminuit.pyx":232
 *             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_9 = __Pyx_PyObject_IsTrue(__pyx_v_pedantic); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_9) {

        /* "iminuit/_libiminuit.pyx":233
 *             if not callable(default_errordef):
 *                 if pedantic:
 *                     warn(InitialParamWarning(             # <<<<<<<<<<<<<<
 *                         'errordef is not given. Default to 1.'))
 *                 self.errordef = 1.0
 */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L41;
      }
      __pyx_L41:;

      /* "iminuit/_libiminuit.pyx":235
 *                     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;
      goto __pyx_L40;
    }
    /*else*/ {

      /* "iminuit/_libiminuit.pyx":237
 *                 self.errordef = 1.0
 *             else:
 *                 self.errordef = default_errordef()             # <<<<<<<<<<<<<<
 *         else:
 *             self.errordef = errordef
 */
      __pyx_t_3 = PyObject_Call(__pyx_v_default_errordef, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_cur_scope->__pyx_v_self->errordef = __pyx_t_10;
    }
    __pyx_L40:;
    goto __pyx_L39;
  }
  /*else*/ {

    /* "iminuit/_libiminuit.pyx":239
 *                 self.errordef = default_errordef()
 *         else:
 *             self.errordef = errordef             # <<<<<<<<<<<<<<
 *         self.tol = 0.1
 *         self.strategy = 1
 */
    __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 = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_cur_scope->__pyx_v_self->errordef = __pyx_t_10;
  }
  __pyx_L39:;

  /* "iminuit/_libiminuit.pyx":240
 *         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":241
 *             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":242
 *         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":243
 *         self.strategy = 1
 *         self.print_level = print_level
 *         set_migrad_print_level(print_level)             # <<<<<<<<<<<<<<
 *         self.throw_nan = throw_nan
 * 
 */
  __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_print_level); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  VariableMetricBuilder::setPrintLevel(__pyx_t_11);

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

  /* "iminuit/_libiminuit.pyx":246
 *         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":247
 * 
 *         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_3 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 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":248
 *         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_8genexpr6__pyx_v_k = NULL;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_args) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_args)) {
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
        #endif
      } else {
        __pyx_t_5 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_k);
      __pyx_8genexpr6__pyx_v_k = __pyx_t_5;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->initialvalue, __pyx_8genexpr6__pyx_v_k); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr6__pyx_v_k, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L44_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_k);
    goto __pyx_L47_exit_scope;
    __pyx_L44_error:;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_k);
    goto __pyx_L1_error;
    __pyx_L47_exit_scope:;
  } /* exit inner scope */
  __pyx_t_1 = ((PyObject *)__pyx_t_3);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __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_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":249
 *         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_8genexpr7__pyx_v_k = NULL;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    if (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_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
        #endif
      } else {
        __pyx_t_5 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_5)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k);
      __pyx_8genexpr7__pyx_v_k = __pyx_t_5;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->initialerror, __pyx_8genexpr7__pyx_v_k); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr7__pyx_v_k, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L50_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k);
    goto __pyx_L53_exit_scope;
    __pyx_L50_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k);
    goto __pyx_L1_error;
    __pyx_L53_exit_scope:;
  } /* exit inner scope */
  __pyx_t_3 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __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":250
 *         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":251
 *         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":252
 *         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":253
 *         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":254
 *         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 = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__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 = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":255
 *         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":256
 *         self.merrors = {}
 *         self.gcc = None
 *         if pedantic: self.pedantic(kwds)             # <<<<<<<<<<<<<<
 * 
 *         self.fitarg = {}
 */
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_pedantic); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_9) {
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__pedantic); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __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 = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_kwds));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_kwds));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_kwds));
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L54;
  }
  __pyx_L54:;

  /* "iminuit/_libiminuit.pyx":258
 *         if pedantic: self.pedantic(kwds)
 * 
 *         self.fitarg = {}             # <<<<<<<<<<<<<<
 *         self.fitarg.update(self.initialvalue)
 *         self.fitarg.update(
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __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 = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":259
 * 
 *         self.fitarg = {}
 *         self.fitarg.update(self.initialvalue)             # <<<<<<<<<<<<<<
 *         self.fitarg.update(
 *             {'error_'+k:v for k,v in self.initialerror.items()})
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->initialvalue);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_self->initialvalue);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->initialvalue);
  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":260
 *         self.fitarg = {}
 *         self.fitarg.update(self.initialvalue)
 *         self.fitarg.update(             # <<<<<<<<<<<<<<
 *             {'error_'+k:v for k,v in self.initialerror.items()})
 *         self.fitarg.update(
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  { /* enter inner scope */
    PyObject *__pyx_8genexpr8__pyx_v_k = NULL;
    PyObject *__pyx_8genexpr8__pyx_v_v = NULL;

    /* "iminuit/_libiminuit.pyx":261
 *         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_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_5 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->initialerror, __pyx_n_s__items); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_5 = __pyx_t_8; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        #endif
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_8)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
        PyObject* sequence = __pyx_t_8;
        #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 = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_12);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        __Pyx_GOTREF(__pyx_t_12);
        #endif
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_4)) goto __pyx_L60_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L60_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        __pyx_t_14 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L61_unpacking_done;
        __pyx_L60_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
        __pyx_L61_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k);
      __pyx_8genexpr8__pyx_v_k = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_v);
      __pyx_8genexpr8__pyx_v_v = __pyx_t_12;
      __pyx_t_12 = 0;
      __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_n_s__error_), __pyx_8genexpr8__pyx_v_k); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_8, (PyObject*)__pyx_8genexpr8__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L57_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_v);
    goto __pyx_L62_exit_scope;
    __pyx_L57_error:;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L62_exit_scope:;
  } /* exit inner scope */
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":262
 *         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(
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  { /* enter inner scope */
    PyObject *__pyx_8genexpr9__pyx_v_k = NULL;
    PyObject *__pyx_8genexpr9__pyx_v_v = NULL;

    /* "iminuit/_libiminuit.pyx":263
 *             {'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_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->initiallimit, __pyx_n_s__items); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_3 = __pyx_t_8; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        #endif
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_8)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
        PyObject* sequence = __pyx_t_8;
        #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 = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_12 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_4);
        #else
        __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
        index = 0; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L68_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_4)) goto __pyx_L68_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        __pyx_t_14 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L69_unpacking_done;
        __pyx_L68_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
        __pyx_L69_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_k);
      __pyx_8genexpr9__pyx_v_k = __pyx_t_12;
      __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v);
      __pyx_8genexpr9__pyx_v_v = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_n_s__limit_), __pyx_8genexpr9__pyx_v_k); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_t_8, (PyObject*)__pyx_8genexpr9__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L65_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v);
    goto __pyx_L70_exit_scope;
    __pyx_L65_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L70_exit_scope:;
  } /* exit inner scope */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":264
 *         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_5 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  { /* enter inner scope */
    PyObject *__pyx_9genexpr10__pyx_v_k = NULL;
    PyObject *__pyx_9genexpr10__pyx_v_v = NULL;

    /* "iminuit/_libiminuit.pyx":265
 *             {'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_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->initialfix, __pyx_n_s__items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        #endif
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_8)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
        PyObject* sequence = __pyx_t_8;
        #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 = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_12);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        __Pyx_GOTREF(__pyx_t_12);
        #endif
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_4)) goto __pyx_L76_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L76_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        __pyx_t_14 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L77_unpacking_done;
        __pyx_L76_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
        __pyx_L77_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_k);
      __pyx_9genexpr10__pyx_v_k = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v);
      __pyx_9genexpr10__pyx_v_v = __pyx_t_12;
      __pyx_t_12 = 0;
      __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_n_s__fix_), __pyx_9genexpr10__pyx_v_k); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_t_8, (PyObject*)__pyx_9genexpr10__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L73_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v);
    goto __pyx_L78_exit_scope;
    __pyx_L73_error:;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L78_exit_scope:;
  } /* exit inner scope */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":267
 *             {'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_6 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __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":269
 *         self.narg = len(self.parameters)
 * 
 *         self.merrors_struct = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__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 = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;

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

/* 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)\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              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        **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_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,0};
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_k_8;
    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__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--; }
        }
      }
      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 = 272; __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;
      }
    }
    if (values[0]) {
      __pyx_v_ncall = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_ncall == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ncall = ((int)10000);
    }
    __pyx_v_resume = values[1];
    if (values[2]) {
      __pyx_v_nsplit = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_nsplit == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_nsplit = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("migrad", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":272
 * 
 * 
 *     def migrad(self, int ncall=10000, resume=True, int nsplit=1):             # <<<<<<<<<<<<<<
 *         """Run migrad.
 * 
 */

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) {
  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;
  MnUserParameterState *__pyx_t_6;
  MnMigrad *__pyx_t_7;
  double __pyx_t_8;
  int __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":304
 *         #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":305
 *         #it's a clean state or resume=False
 *         cdef MnUserParameterState* ups = NULL
 *         cdef MnStrategy* strat = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self.print_level>0: self.frontend.print_banner('MIGRAD')
 */
  __pyx_v_strat = NULL;

  /* "iminuit/_libiminuit.pyx":307
 *         cdef MnStrategy* strat = NULL
 * 
 *         if self.print_level>0: self.frontend.print_banner('MIGRAD')             # <<<<<<<<<<<<<<
 * 
 *         if not resume or self.is_clean_state():
 */
  __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 = 307; __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 = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_banner); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __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;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":309
 *         if self.print_level>0: 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_2 = __Pyx_PyObject_IsTrue(__pyx_v_resume); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (!__pyx_t_2);
  if (!__pyx_t_4) {
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_clean_state); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __pyx_t_2;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  if (__pyx_t_5) {

    /* "iminuit/_libiminuit.pyx":310
 * 
 *         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_1 = ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->construct_FCN(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":311
 *         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_5 = (__pyx_v_self->minimizer != NULL);
    if (__pyx_t_5) {
      delete __pyx_v_self->minimizer;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "iminuit/_libiminuit.pyx":312
 *             self.construct_FCN()
 *             if self.minimizer is not NULL: del self.minimizer
 *             ups = self.initialParameterState()             # <<<<<<<<<<<<<<
 *             strat = new MnStrategy(self.strategy)
 *             self.minimizer = \
 */
    __pyx_t_6 = ((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 = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ups = __pyx_t_6;

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

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

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

    /* "iminuit/_libiminuit.pyx":317
 *                     new MnMigrad(deref(self.pyfcn),deref(ups),deref(strat))
 *             del ups; ups=NULL
 *             del strat; strat=NULL             # <<<<<<<<<<<<<<
 * 
 *         if not resume: self.pyfcn.resetNumCall()
 */
    delete __pyx_v_strat;
    __pyx_v_strat = NULL;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":319
 *             del strat; strat=NULL
 * 
 *         if not resume: self.pyfcn.resetNumCall()             # <<<<<<<<<<<<<<
 * 
 *         del self.cfmin #remove the old one
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_resume); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (!__pyx_t_5);
  if (__pyx_t_4) {
    __pyx_v_self->pyfcn->resetNumCall();
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "iminuit/_libiminuit.pyx":321
 *         if not resume: 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":324
 * 
 *         #this returns a real object need to copy
 *         ncall_round = round(1.0*(ncall)/nsplit)             # <<<<<<<<<<<<<<
 *         assert(ncall_round>0)
 *         totalcalls = 0
 */
  __pyx_t_8 = (1.0 * __pyx_v_ncall);
  if (unlikely(__pyx_v_nsplit == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "float division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyFloat_FromDouble((__pyx_t_8 / __pyx_v_nsplit)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_ncall_round = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":325
 *         #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
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_ncall_round, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_4)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

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

  /* "iminuit/_libiminuit.pyx":327
 *         assert(ncall_round>0)
 *         totalcalls = 0
 *         first = True             # <<<<<<<<<<<<<<
 *         while (first) or \
 *                 (not self.cfmin.isValid() and totalcalls < ncall):
 */
  __pyx_v_first = 1;

  /* "iminuit/_libiminuit.pyx":328
 *         totalcalls = 0
 *         first = True
 *         while (first) or \             # <<<<<<<<<<<<<<
 *                 (not self.cfmin.isValid() and totalcalls < ncall):
 *             first=False
 */
  while (1) {
    __pyx_t_4 = __pyx_v_first;
    if (!__pyx_t_4) {

      /* "iminuit/_libiminuit.pyx":329
 *         first = True
 *         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());
      if (__pyx_t_5) {
        __pyx_t_1 = PyInt_FromLong(__pyx_v_ncall); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyObject_RichCompare(__pyx_v_totalcalls, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9 = __pyx_t_2;
      } else {
        __pyx_t_9 = __pyx_t_5;
      }
      __pyx_t_5 = __pyx_t_9;
    } else {
      __pyx_t_5 = __pyx_t_4;
    }
    if (!__pyx_t_5) break;

    /* "iminuit/_libiminuit.pyx":330
 *         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":332
 *             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_AsUnsignedInt(__pyx_v_ncall_round); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    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 = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "iminuit/_libiminuit.pyx":331
 *                 (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
 */
    __pyx_v_self->cfmin = __pyx_t_11;

    /* "iminuit/_libiminuit.pyx":333
 *             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":334
 *                     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":335
 *             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_3 = PyNumber_InPlaceAdd(__pyx_v_totalcalls, __pyx_v_ncall_round); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_totalcalls);
    __pyx_v_totalcalls = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":336
 *             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_3 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __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 = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
      __pyx_t_4 = (__pyx_v_nsplit != 1);
      __pyx_t_9 = __pyx_t_4;
    } else {
      __pyx_t_9 = __pyx_t_5;
    }
    if (__pyx_t_9) {
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_fmin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __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;
      goto __pyx_L9;
    }
    __pyx_L9:;
  }

  /* "iminuit/_libiminuit.pyx":338
 *             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":339
 * 
 *         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":340
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(self.cfmin.userState())
 *         self.refreshInternalState()             # <<<<<<<<<<<<<<
 * 
 *         if self.print_level>0: self.print_fmin()
 */
  __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 = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":342
 *         self.refreshInternalState()
 * 
 *         if self.print_level>0: self.print_fmin()             # <<<<<<<<<<<<<<
 * 
 *         return self.get_fmin(), self.get_param_states()
 */
  __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 = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_9) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_fmin); 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_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), 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_3); __pyx_t_3 = 0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "iminuit/_libiminuit.pyx":344
 *         if self.print_level>0: self.print_fmin()
 * 
 *         return self.get_fmin(), self.get_param_states()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_fmin); 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_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_param_states); 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_t_12 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); 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);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_1 = 0;
  __pyx_t_12 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_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;
}

/* 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 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            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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":347
 * 
 * 
 *     def hesse(self):             # <<<<<<<<<<<<<<
 *         """Run HESSE.
 * 
 */

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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hesse", 0);

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

  /* "iminuit/_libiminuit.pyx":366
 *         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 = 366; __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 = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_banner); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __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;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":367
 *         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);
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":368
 *         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 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __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 = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":369
 *         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":370
 *             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 = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_upst = __pyx_t_4;

  /* "iminuit/_libiminuit.pyx":371
 *         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());
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":372
 *         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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);

    /* "iminuit/_libiminuit.pyx":373
 *         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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__HesseFailedWarning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_13));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_13));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13));
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "iminuit/_libiminuit.pyx":374
 *             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":375
 *                 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":376
 *         del self.last_upst
 *         self.last_upst = new MnUserParameterState(upst)
 *         self.refreshInternalState()             # <<<<<<<<<<<<<<
 *         del hesse
 * 
 */
  __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 = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

  /* "iminuit/_libiminuit.pyx":379
 *         del hesse
 * 
 *         if self.print_level>0:             # <<<<<<<<<<<<<<
 *             self.print_param()
 *             self.print_matrix()
 */
  __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 = 379; __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 = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":380
 * 
 *         if self.print_level>0:
 *             self.print_param()             # <<<<<<<<<<<<<<
 *             self.print_matrix()
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_param); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":381
 *         if self.print_level>0:
 *             self.print_param()
 *             self.print_matrix()             # <<<<<<<<<<<<<<
 * 
 *         return self.get_param_states()
 */
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_matrix); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __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_1); __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "iminuit/_libiminuit.pyx":383
 *             self.print_matrix()
 * 
 *         return self.get_param_states()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_param_states); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __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;
}

/* 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;
  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};

    /* "iminuit/_libiminuit.pyx":386
 * 
 * 
 *     def minos(self, var = None, sigma = 1., unsigned int maxcall=1000):             # <<<<<<<<<<<<<<
 *         """Run minos for parameter *var*
 * 
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = __pyx_k_14;
    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 = 386; __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_AsUnsignedInt(values[2]); if (unlikely((__pyx_v_maxcall == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_maxcall = ((unsigned int)1000);
    }
  }
  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 = 386; __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);
  __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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  double __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;
  MinosError __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("minos", 0);

  /* "iminuit/_libiminuit.pyx":403
 * 
 *         """
 *         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_1 = (__pyx_v_self->pyfcn == NULL);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_self->cfmin == NULL);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":404
 *         """
 *         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_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __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 = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":406
 *             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":407
 *                                ' 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":409
 *         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":410
 *         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":411
 *         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_4 = PyFloat_FromDouble(__pyx_v_oldup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_v_sigma); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __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_t_5, __pyx_v_sigma); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __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 = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->pyfcn->set_up(__pyx_t_6);

  /* "iminuit/_libiminuit.pyx":412
 *         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_4 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_banner); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":413
 *         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_3 = (!__pyx_v_self->cfmin->isValid());
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":414
 *         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_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "iminuit/_libiminuit.pyx":416
 *             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_3 = (__pyx_v_var != Py_None);
  if (__pyx_t_3) {
    __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_var, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":418
 *         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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), __pyx_v_var); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_self->parameters);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->parameters);
    __Pyx_GIVEREF(__pyx_v_self->parameters);
    __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_5), __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 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 = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "iminuit/_libiminuit.pyx":420
 *                     ' 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_2 = (__pyx_v_var != Py_None);
  if (__pyx_t_2) {
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_var);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_var);
    __Pyx_GIVEREF(__pyx_v_var);
    __pyx_t_4 = ((PyObject *)__pyx_t_7);
    __pyx_t_7 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_self->parameters);
    __pyx_t_4 = __pyx_v_self->parameters;
  }
  __pyx_v_varlist = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":422
 *         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_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_fixed_param); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_fixed_param = __pyx_t_7;
  __pyx_t_7 = 0;

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

    /* "iminuit/_libiminuit.pyx":424
 *         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 = PyBytes_AsString(__pyx_v_vname); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_index = __pyx_v_self->cfmin->userState().index(__pyx_t_10);

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

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

        /* "iminuit/_libiminuit.pyx":428
 *             if vname in fixed_param:
 *                 if var is not None:#specifying vname but it's fixed
 *                     warnings.warn(RuntimeWarning(             # <<<<<<<<<<<<<<
 *                         'Specified variable name for minos is set to fixed'))
 *                     return None
 */
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeWarning, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "iminuit/_libiminuit.pyx":430
 *                     warnings.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_7); __pyx_t_7 = 0;
        goto __pyx_L0;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "iminuit/_libiminuit.pyx":431
 *                         '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_L7_continue;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "iminuit/_libiminuit.pyx":433
 *                 continue
 *             minos = new MnMinos(deref(
 *                 self.pyfcn), deref(self.cfmin), self.strategy)             # <<<<<<<<<<<<<<
 *             mnerror = minos.minos(index,maxcall)
 *             self.merrors_struct[vname]=minoserror2struct(mnerror)
 */
    __pyx_v_minos = new MnMinos((*__pyx_v_self->pyfcn), (*__pyx_v_self->cfmin), __pyx_v_self->strategy);

    /* "iminuit/_libiminuit.pyx":434
 *             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_12 = __pyx_v_minos->minos(__pyx_v_index, __pyx_v_maxcall);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_mnerror = __pyx_t_12;

    /* "iminuit/_libiminuit.pyx":435
 *                 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_4 = __pyx_f_7iminuit_11_libiminuit_minoserror2struct(__pyx_v_mnerror); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyObject_SetItem(__pyx_v_self->merrors_struct, __pyx_v_vname, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":436
 *             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_4 = PyObject_RichCompare(__pyx_v_self->print_level, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "iminuit/_libiminuit.pyx":437
 *             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 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_merror); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "iminuit/_libiminuit.pyx":438
 *             if self.print_level>0:
 *                 self.frontend.print_merror(
 *                     vname, self.merrors_struct[vname])             # <<<<<<<<<<<<<<
 *         self.refreshInternalState()
 *         del minos
 */
      __pyx_t_11 = PyObject_GetItem(__pyx_v_self->merrors_struct, __pyx_v_vname); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_vname);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_vname);
      __Pyx_GIVEREF(__pyx_v_vname);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L11;
    }
    __pyx_L11:;
    __pyx_L7_continue:;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

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

  /* "iminuit/_libiminuit.pyx":440
 *                     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":441
 *         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":442
 *         del minos
 *         self.pyfcn.set_up(oldup)
 *         return self.merrors_struct             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->merrors_struct);
  __pyx_r = __pyx_v_self->merrors_struct;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __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;
}

/* 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)\nreturn error/correlation matrix in tuple or tuple 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;
  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] = __pyx_k_23;
    values[1] = __pyx_k_24;
    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 = 445; __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 = 445; __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);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_2generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_2generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":459
 *         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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_2generator2, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":460
 *             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 = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (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 = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && 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 = 460; __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 = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      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 = 460; __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 = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v1);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_v1);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_v1 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv1);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_iv1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_iv1 = __pyx_t_1;
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __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":459
 *         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_AsUnsignedInt(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__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 = 459; __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_AsUnsignedInt(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyInt_AsUnsignedInt(__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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = __Pyx_PyInt_AsUnsignedInt(__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 = 459; __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_Format(PyExc_ZeroDivisionError, "float division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __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 = 459; __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 = 459; __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;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_2generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":461
 *                 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 = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (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 = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && 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 = 461; __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 = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      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 = 461; __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 = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v2);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_v2);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_v2 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv2);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_iv2);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_iv2 = __pyx_t_1;
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __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":459
 *         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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __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 = 459; __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;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_5generator3(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_5generator4(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":465
 *         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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_7genexpr_5generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":466
 *             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 = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (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 = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && 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 = 466; __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 = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      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 = 466; __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 = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v1);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_v1);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_v1 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv1);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_iv1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_iv1 = __pyx_t_1;
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); 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_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":465
 *         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_AsUnsignedInt(__pyx_cur_scope->__pyx_v_iv1); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __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 = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__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 = 465; __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 = 465; __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 = 465; __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;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_6matrix_5generator3, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.matrix.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;

  /* "iminuit/_libiminuit.pyx":467
 *                 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 = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (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 = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && 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 = 467; __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 = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      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 = 467; __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 = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v2);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_v2);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_v2 = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_iv2);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_iv2);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_iv2 = __pyx_t_1;
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __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":465
 *         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 = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __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 = 465; __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;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "iminuit/_libiminuit.pyx":445
 * 
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """return error/correlation matrix in tuple or tuple 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;
  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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix->tp_new(__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":447
 *     def matrix(self, correlation=False, skip_fixed=True):
 *         """return error/correlation matrix in tuple or tuple 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);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":448
 *         """return error/correlation matrix in tuple or tuple 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 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __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 = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":449
 *         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 = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (!__pyx_t_1);
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":450
 *             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_GetName(__pyx_m, __pyx_n_s__RunTimeError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":451
 *         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());
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":452
 *             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_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_30), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __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 = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "iminuit/_libiminuit.pyx":455
 *                 "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":456
 * 
 *         cdef MnUserCovariance cov = self.last_upst.covariance()
 *         params = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 *         if correlation:
 *             ret = tuple(
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_vary_param); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __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":457
 *         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 = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":459
 *         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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v_ret = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "iminuit/_libiminuit.pyx":465
 *         else:
 *             ret = tuple(
 *                 tuple(cov.get(iv1,iv2)             # <<<<<<<<<<<<<<
 *                     for iv1,v1 in enumerate(params))\
 *                     for iv2,v2 in enumerate(params)
 */
    __pyx_t_2 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_6matrix_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v_ret = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L6:;

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

  __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_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;
}

/* 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;
  __pyx_v_kwds = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwds)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwds);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_10print_matrix(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_kwds);
  __Pyx_XDECREF(__pyx_v_kwds);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":472
 * 
 * 
 *     def print_matrix(self, **kwds):             # <<<<<<<<<<<<<<
 *         """show error_matrix"""
 *         matrix = self.matrix(correlation=True)
 */

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;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_matrix", 0);

  /* "iminuit/_libiminuit.pyx":474
 *     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 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__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_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = __Pyx_PyBool_FromLong(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);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__correlation), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); 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(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_matrix = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":475
 *         """show error_matrix"""
 *         matrix = self.matrix(correlation=True)
 *         vnames = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 *         self.frontend.print_matrix(vnames, matrix, **kwds)
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_vary_param); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_vnames = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":476
 *         matrix = self.matrix(correlation=True)
 *         vnames = self.list_of_vary_param()
 *         self.frontend.print_matrix(vnames, matrix, **kwds)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_matrix); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __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 = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_vnames);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vnames);
  __Pyx_GIVEREF(__pyx_v_vnames);
  __Pyx_INCREF(__pyx_v_matrix);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_matrix);
  __Pyx_GIVEREF(__pyx_v_matrix);
  __pyx_t_1 = ((PyObject *)__pyx_v_kwds);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("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;
}

/* 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 that contains correlation \n        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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":479
 * 
 * 
 *     def latex_matrix(self):             # <<<<<<<<<<<<<<
 *         """Build :class:`LatexFactory` object that contains correlation
 *         matrix
 */

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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("latex_matrix", 0);

  /* "iminuit/_libiminuit.pyx":483
 *         matrix
 *         """
 *         matrix = self.matrix(correlation=True)             # <<<<<<<<<<<<<<
 *         vnames = self.list_of_vary_param()
 *         return LatexFactory.build_matrix(vnames, matrix)
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __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 = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__correlation), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_matrix = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":484
 *         """
 *         matrix = self.matrix(correlation=True)
 *         vnames = self.list_of_vary_param()             # <<<<<<<<<<<<<<
 *         return LatexFactory.build_matrix(vnames, matrix)
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_vary_param); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_vnames = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":485
 *         matrix = self.matrix(correlation=True)
 *         vnames = self.list_of_vary_param()
 *         return LatexFactory.build_matrix(vnames, matrix)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__LatexFactory); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__build_matrix); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_vnames);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vnames);
  __Pyx_GIVEREF(__pyx_v_vnames);
  __Pyx_INCREF(__pyx_v_matrix);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_matrix);
  __Pyx_GIVEREF(__pyx_v_matrix);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __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.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;
}

/* 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)\nreturn error/correlation matrix in numpy array format.";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_15np_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_correlation = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("np_matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__correlation,0};
    PyObject* values[1] = {0};
    values[0] = __pyx_k_31;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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--; }
        }
      }
      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 = 488; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_correlation = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("np_matrix", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":488
 * 
 * 
 *     def np_matrix(self, correlation=False):             # <<<<<<<<<<<<<<
 *         """return error/correlation matrix in numpy array format."""
 *         import numpy as np
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_14np_matrix(CYTHON_UNUSED struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_correlation) {
  PyObject *__pyx_v_np = 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("np_matrix", 0);

  /* "iminuit/_libiminuit.pyx":490
 *     def np_matrix(self, correlation=False):
 *         """return error/correlation matrix in numpy array format."""
 *         import numpy as np             # <<<<<<<<<<<<<<
 *         #TODO make a not so lazy one
 *         return np.array(matrix)
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __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":492
 *         import numpy as np
 *         #TODO make a not so lazy one
 *         return np.array(matrix)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_np, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__matrix); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* 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 (initialy) 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":495
 * 
 * 
 *     def is_fixed(self,vname):             # <<<<<<<<<<<<<<
 *         """check if variable *vname* is (initialy) fixed"""
 *         if vname not in self.parameters:
 */

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;
  PyObject *__pyx_t_2 = NULL;
  unsigned int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_fixed", 0);

  /* "iminuit/_libiminuit.pyx":497
 *     def is_fixed(self,vname):
 *         """check if variable *vname* is (initialy) 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_Contains(__pyx_v_vname, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":498
 *         """check if variable *vname* is (initialy) 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_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_33), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __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 = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":499
 *         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_2 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_vname); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_index = __pyx_t_3;

  /* "iminuit/_libiminuit.pyx":500
 *             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_1 = (__pyx_v_self->last_upst == NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":501
 *         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_2 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_vname); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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":506
 * 
 *     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":508
 *         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 = 508; __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":509
 *         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":510
 *         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 = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyList_Append(__pyx_v_tmp, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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;
}

/* 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. Extra keyword arguments will\n        be passed to frontend.print_param";
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;
  __pyx_v_kwds = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwds)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwds);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_20print_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_kwds);
  __Pyx_XDECREF(__pyx_v_kwds);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":514
 * 
 *     #dealing with frontend conversion
 *     def print_param(self, **kwds):             # <<<<<<<<<<<<<<
 *         """print current parameter state. Extra keyword arguments will
 *         be passed to frontend.print_param"""
 */

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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_param", 0);

  /* "iminuit/_libiminuit.pyx":517
 *         """print current parameter state. 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);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":518
 *         be passed to frontend.print_param"""
 *         if self.last_upst is NULL:
 *             self.print_initial_param(**kwds)             # <<<<<<<<<<<<<<
 *             return
 *         p = self._prepare_param()
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_initial_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = ((PyObject *)__pyx_v_kwds);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":519
 *         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;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":520
 *             self.print_initial_param(**kwds)
 *             return
 *         p = self._prepare_param()             # <<<<<<<<<<<<<<
 *         self.frontend.print_param(p, self.merrors_struct, **kwds)
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___prepare_param); 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_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_p = __pyx_t_3;
  __pyx_t_3 = 0;

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

  __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_XDECREF(__pyx_t_5);
  __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;
}

/* 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\n        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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":524
 * 
 * 
 *     def latex_param(self):             # <<<<<<<<<<<<<<
 *         """build :class:`iminuit.latex.LatexTable` for current
 *         parameter"""
 */

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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("latex_param", 0);

  /* "iminuit/_libiminuit.pyx":527
 *         """build :class:`iminuit.latex.LatexTable` for current
 *         parameter"""
 *         p = self._prepare_param()             # <<<<<<<<<<<<<<
 *         return LatexFactory.build_param_table(p, self.merrors_struct)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___prepare_param); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_p = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":528
 *         parameter"""
 *         p = self._prepare_param()
 *         return LatexFactory.build_param_table(p, self.merrors_struct)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__LatexFactory); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__build_param_table); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_p);
  __Pyx_GIVEREF(__pyx_v_p);
  __Pyx_INCREF(__pyx_v_self->merrors_struct);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->merrors_struct);
  __Pyx_GIVEREF(__pyx_v_self->merrors_struct);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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.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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":531
 * 
 * 
 *     def _prepare_initial_param(self):             # <<<<<<<<<<<<<<
 *         tmp = []
 *         for i,vname in enumerate(self.parameters):
 */

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":532
 * 
 *     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 = 532; __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":533
 *     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 (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 = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && 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 = 533; __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 = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      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 = 533; __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 = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_vname);
    __pyx_v_vname = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_1;
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __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":534
 *         tmp = []
 *         for i,vname in enumerate(self.parameters):
 *             mps = Struct(             # <<<<<<<<<<<<<<
 *             number = i+1,
 *             name = vname,
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__Struct); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));

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

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

    /* "iminuit/_libiminuit.pyx":537
 *             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 (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__value), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":538
 *             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 (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__error), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":539
 *             value = self.initialvalue[vname],
 *             error = self.initialerror[vname],
 *             is_const = False,             # <<<<<<<<<<<<<<
 *             is_fixed = self.initialfix[vname],
 *             has_limits = self.initiallimit[vname] is not None,
 */
    __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__is_const), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":540
 *             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 (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__is_fixed), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":541
 *             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 -999,
 */
    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __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 = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__has_limits), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":543
 *             has_limits = self.initiallimit[vname] is not None,
 *             lower_limit = self.initiallimit[vname][0]
 *                 if self.initiallimit[vname] is not None else -999,             # <<<<<<<<<<<<<<
 *             upper_limit = self.initiallimit[vname][1]
 *                 if self.initiallimit[vname] is not None else 999,
 */
    __pyx_t_9 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __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) {

      /* "iminuit/_libiminuit.pyx":542
 *             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 -999,
 *             upper_limit = self.initiallimit[vname][1]
 */
      __pyx_t_9 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __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 {
      __Pyx_INCREF(__pyx_int_neg_999);
      __pyx_t_7 = __pyx_int_neg_999;
    }
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__lower_limit), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":545
 *                 if self.initiallimit[vname] is not None else -999,
 *             upper_limit = self.initiallimit[vname][1]
 *                 if self.initiallimit[vname] is not None else 999,             # <<<<<<<<<<<<<<
 *             has_lower_limit = self.initiallimit[vname] is not None,
 *             has_upper_limit = self.initiallimit[vname] is not None
 */
    __pyx_t_10 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __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) {

      /* "iminuit/_libiminuit.pyx":544
 *             lower_limit = self.initiallimit[vname][0]
 *                 if self.initiallimit[vname] is not None else -999,
 *             upper_limit = self.initiallimit[vname][1]             # <<<<<<<<<<<<<<
 *                 if self.initiallimit[vname] is not None else 999,
 *             has_lower_limit = self.initiallimit[vname] is not None,
 */
      __pyx_t_10 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __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 {
      __Pyx_INCREF(__pyx_int_999);
      __pyx_t_7 = __pyx_int_999;
    }
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__upper_limit), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":546
 *             upper_limit = self.initiallimit[vname][1]
 *                 if self.initiallimit[vname] is not None else 999,
 *             has_lower_limit = self.initiallimit[vname] is not None,             # <<<<<<<<<<<<<<
 *             has_upper_limit = self.initiallimit[vname] is not None
 *             )
 */
    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __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 = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__has_lower_limit), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":547
 *                 if self.initiallimit[vname] is not None else 999,
 *             has_lower_limit = self.initiallimit[vname] is not None,
 *             has_upper_limit = self.initiallimit[vname] is not None             # <<<<<<<<<<<<<<
 *             )
 *             tmp.append(mps)
 */
    __pyx_t_7 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_vname); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __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 = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__has_upper_limit), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_v_mps);
    __pyx_v_mps = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "iminuit/_libiminuit.pyx":549
 *             has_upper_limit = self.initiallimit[vname] is not None
 *             )
 *             tmp.append(mps)             # <<<<<<<<<<<<<<
 *         return tmp
 * 
 */
    __pyx_t_11 = PyList_Append(__pyx_v_tmp, __pyx_v_mps); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __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":550
 *             )
 *             tmp.append(mps)
 *         return tmp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_tmp));
  __pyx_r = ((PyObject *)__pyx_v_tmp);
  goto __pyx_L0;

  __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_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;
}

/* 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;
  __pyx_v_kwds = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwds)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwds);
  __pyx_r = __pyx_pf_7iminuit_11_libiminuit_6Minuit_26print_initial_param(((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_v_self), __pyx_v_kwds);
  __Pyx_XDECREF(__pyx_v_kwds);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_initial_param", 0);

  /* "iminuit/_libiminuit.pyx":555
 *     def print_initial_param(self, **kwds):
 *         """Print initial parameters"""
 *         p = self._prepare_initial_param()             # <<<<<<<<<<<<<<
 *         self.frontend.print_param(p, {}, **kwds)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_34); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); 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_1); __pyx_t_1 = 0;
  __pyx_v_p = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":556
 *         """Print initial parameters"""
 *         p = self._prepare_initial_param()
 *         self.frontend.print_param(p, {}, **kwds)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_param); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p);
  __Pyx_GIVEREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = ((PyObject *)__pyx_v_kwds);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); 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);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("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;
}

/* 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\n        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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":559
 * 
 * 
 *     def latex_initial_param(self):             # <<<<<<<<<<<<<<
 *         """build :class:`iminuit.latex.LatexTable` for initial
 *         parameter"""
 */

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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("latex_initial_param", 0);

  /* "iminuit/_libiminuit.pyx":562
 *         """build :class:`iminuit.latex.LatexTable` for initial
 *         parameter"""
 *         p = self._prepare_initial_param()             # <<<<<<<<<<<<<<
 *         return LatexFactory.build_param_table(p, {})
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_34); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_p = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":563
 *         parameter"""
 *         p = self._prepare_initial_param()
 *         return LatexFactory.build_param_table(p, {})             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__LatexFactory); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__build_param_table); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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 = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p);
  __Pyx_GIVEREF(__pyx_v_p);
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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.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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":566
 * 
 * 
 *     def print_fmin(self):             # <<<<<<<<<<<<<<
 *         """print current function minimum state"""
 *         #cdef MnUserParameterState ust = MnUserParameterState(
 */

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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_fmin", 0);

  /* "iminuit/_libiminuit.pyx":570
 *         #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);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":571
 *         #                               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 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_36), NULL); 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);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":572
 *         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 = 572; __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":573
 *             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)) {
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = __pyx_v_self->pyfcn->getNumCall();
  }
  __pyx_v_ncalls = __pyx_t_3;

  /* "iminuit/_libiminuit.pyx":575
 *         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_2 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_hline); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":576
 * 
 *         self.frontend.print_hline()
 *         self.frontend.print_fmin(sfmin,self.tol,ncalls)             # <<<<<<<<<<<<<<
 *         self.print_param()
 *         self.frontend.print_hline()
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_fmin); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->tol); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyInt_FromLong(__pyx_v_ncalls); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_sfmin);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_sfmin);
  __Pyx_GIVEREF(__pyx_v_sfmin);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":577
 *         self.frontend.print_hline()
 *         self.frontend.print_fmin(sfmin,self.tol,ncalls)
 *         self.print_param()             # <<<<<<<<<<<<<<
 *         self.frontend.print_hline()
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__print_param); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __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_6); __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":578
 *         self.frontend.print_fmin(sfmin,self.tol,ncalls)
 *         self.print_param()
 *         self.frontend.print_hline()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_hline); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  __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_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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_all_minos", 0);

  /* "iminuit/_libiminuit.pyx":584
 *     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_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_vary_param); 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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); 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);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (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 = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && 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 = 584; __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 = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 584; __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 = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_vname);
    __pyx_v_vname = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":585
 *         """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_5 = (__Pyx_PySequence_Contains(__pyx_v_vname, __pyx_v_self->merrors_struct, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "iminuit/_libiminuit.pyx":586
 *         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 = PyObject_GetAttr(__pyx_v_self->frontend, __pyx_n_s__print_merror); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyObject_GetItem(__pyx_v_self->merrors_struct, __pyx_v_vname); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_vname);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_vname);
      __Pyx_GIVEREF(__pyx_v_vname);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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;
}

/* 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)\n\n        alias for :meth:`set_errordef`\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_35set_up(PyObject *__pyx_v_self, PyObject *__pyx_arg_errordef) {
  double __pyx_v_errordef;
  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 = 589; __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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":589
 * 
 * 
 *     def set_up(self, double errordef):             # <<<<<<<<<<<<<<
 *         """
 *         alias for :meth:`set_errordef`
 */

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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_up", 0);

  /* "iminuit/_libiminuit.pyx":593
 *         alias for :meth:`set_errordef`
 *         """
 *         self.set_errordef(errordef)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_errordef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_errordef); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __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.set_up", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_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)\n\n        set error parameter 1 for :math:`\\chi^2` and 0.5 for log likelihood\n\n        .. seealso::\n            http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/node31.html\n\n        ";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_37set_errordef(PyObject *__pyx_v_self, PyObject *__pyx_arg_errordef) {
  double __pyx_v_errordef;
  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 = 596; __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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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":604
 * 
 *         """
 *         self.errordef = errordef             # <<<<<<<<<<<<<<
 *         if self.pyfcn is not NULL:
 *             self.pyfcn.set_up(errordef)
 */
  __pyx_v_self->errordef = __pyx_v_errordef;

  /* "iminuit/_libiminuit.pyx":605
 *         """
 *         self.errordef = errordef
 *         if self.pyfcn is not NULL:             # <<<<<<<<<<<<<<
 *             self.pyfcn.set_up(errordef)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->pyfcn != NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":606
 *         self.errordef = errordef
 *         if self.pyfcn is not NULL:
 *             self.pyfcn.set_up(errordef)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_self->pyfcn->set_up(__pyx_v_errordef);
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_39set_strategy(PyObject *__pyx_v_self, PyObject *__pyx_v_stra); /*proto*/
static char __pyx_doc_7iminuit_11_libiminuit_6Minuit_38set_strategy[] = "Minuit.set_strategy(self, stra)\nset strategy 0=fast , 1=default, 2=slow but accurate";
static PyObject *__pyx_pw_7iminuit_11_libiminuit_6Minuit_39set_strategy(PyObject *__pyx_v_self, PyObject *__pyx_v_stra) {
  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_stra));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":609
 * 
 * 
 *     def set_strategy(self,stra):             # <<<<<<<<<<<<<<
 *         """set strategy 0=fast , 1=default, 2=slow but accurate"""
 *         self.strategy=stra
 */

static PyObject *__pyx_pf_7iminuit_11_libiminuit_6Minuit_38set_strategy(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self, PyObject *__pyx_v_stra) {
  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":611
 *     def set_strategy(self,stra):
 *         """set strategy 0=fast , 1=default, 2=slow but accurate"""
 *         self.strategy=stra             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_stra); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->strategy = __pyx_t_1;

  __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;
}

/* 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 printlevel 0 quiet, 1 normal, 2 paranoid, 3 really paranoid ";
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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":614
 * 
 * 
 *     def set_print_level(self, lvl):             # <<<<<<<<<<<<<<
 *         """set printlevel 0 quiet, 1 normal, 2 paranoid, 3 really paranoid """
 *         self.print_level = lvl
 */

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":616
 *     def set_print_level(self, lvl):
 *         """set printlevel 0 quiet, 1 normal, 2 paranoid, 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":617
 *         """set printlevel 0 quiet, 1 normal, 2 paranoid, 3 really paranoid """
 *         self.print_level = lvl
 *         set_migrad_print_level(lvl)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_lvl); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  VariableMetricBuilder::setPrintLevel(__pyx_t_1);

  __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;
}

/* 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)\nreturn current 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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":622
 *     def get_fmin(self):
 *         """return current FunctionMinimum Struct"""
 *         return cfmin2struct(self.cfmin) if self.cfmin is not NULL else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_self->cfmin != NULL)) {
    __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 = 622; __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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("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;
}

/* 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)\nReturn a list of current MinuitParameter Struct\n        for all parameters\n        ";
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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":626
 * 
 *     #expose internal state using various struct
 *     def get_param_states(self):             # <<<<<<<<<<<<<<
 *         """Return a list of current MinuitParameter Struct
 *         for all parameters
 */

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;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_param_states", 0);

  /* "iminuit/_libiminuit.pyx":630
 *         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);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":631
 *         """
 *         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_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_37); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":632
 *         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":634
 *         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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ret = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

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

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

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("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;
}

/* 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)\nReturns a dictionary 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":640
 * 
 * 
 *     def get_merrors(self):             # <<<<<<<<<<<<<<
 *         """Returns a dictionary of varname-> MinosError Struct"""
 *         return self.merrors_struct
 */

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":642
 *     def get_merrors(self):
 *         """Returns a dictionary of varname-> MinosError Struct"""
 *         return self.merrors_struct             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->merrors_struct);
  __pyx_r = __pyx_v_self->merrors_struct;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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)\nget initiail setting inform 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":645
 * 
 * 
 *     def get_initial_param_state(self):             # <<<<<<<<<<<<<<
 *         """get initiail setting inform of MinuitParameter Struct"""
 *         raise NotImplementedError
 */

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":647
 *     def get_initial_param_state(self):
 *         """get initiail setting inform of MinuitParameter Struct"""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.get_initial_param_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_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)\nreturn number of total call 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":650
 * 
 * 
 *     def get_num_call_fcn(self):             # <<<<<<<<<<<<<<
 *         """return number of total call to fcn(not just the last operation)"""
 *         return 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()
 */

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
  long __pyx_t_1;
  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":652
 *     def get_num_call_fcn(self):
 *         """return number of total call to fcn(not just the last operation)"""
 *         return 0 if self.pyfcn is NULL else self.pyfcn.getNumCall()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_self->pyfcn == NULL)) {
    __pyx_t_1 = 0;
  } else {
    __pyx_t_1 = __pyx_v_self->pyfcn->getNumCall();
  }
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); 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_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":655
 * 
 * 
 *     def migrad_ok(self):             # <<<<<<<<<<<<<<
 *         """check if minimum is valid"""
 *         return self.cfmin is not NULL and self.cfmin.isValid()
 */

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
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("migrad_ok", 0);

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix_accurate", 0);

  /* "iminuit/_libiminuit.pyx":662
 *     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_1 = (__pyx_v_self->last_upst != NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":663
 *         """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) {

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __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;
}

/* 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)\nreturn list 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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":669
 *     def list_of_fixed_param(self):
 *         """return list of (initially) fixed parameters"""
 *         return [v for v in self.parameters if 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 = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (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 = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && 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 = 669; __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 = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      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 = 669; __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 = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_v); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __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 = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __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_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;
}

/* 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)\nreturn list of (initially) float vary 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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":674
 *     def list_of_vary_param(self):
 *         """return list of (initially) float vary 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 = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (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 = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && 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 = 674; __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 = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      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 = 674; __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 = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_v); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __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 = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = (!__pyx_t_6);
    if (__pyx_t_7) {
      if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __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_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":678
 * 
 *     #Various utility functions
 *     cdef construct_FCN(self):             # <<<<<<<<<<<<<<
 *         """(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":680
 *     cdef construct_FCN(self):
 *         """(re)construct FCN"""
 *         del self.pyfcn             # <<<<<<<<<<<<<<
 *         self.pyfcn = new PythonFCN(
 *                 self.fcn,
 */
  delete __pyx_v_self->pyfcn;

  /* "iminuit/_libiminuit.pyx":682
 *         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":684
 *                 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 = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "iminuit/_libiminuit.pyx":681
 *         """(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;

  __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;
}

/* 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 at 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":688
 * 
 * 
 *     def is_clean_state(self):             # <<<<<<<<<<<<<<
 *         """check if minuit is at clean state ie. no migrad call"""
 *         return self.pyfcn is NULL and \
 */

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
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_clean_state", 0);

  /* "iminuit/_libiminuit.pyx":690
 *     def is_clean_state(self):
 *         """check if minuit is at 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_1 = (__pyx_v_self->pyfcn == NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":691
 *         """check if minuit is at clean state ie. no migrad call"""
 *         return self.pyfcn is NULL and \
 *             self.minimizer is NULL and self.cfmin is NULL             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = (__pyx_v_self->minimizer == NULL);
    if (__pyx_t_2) {
      __pyx_t_3 = (__pyx_v_self->cfmin == NULL);
      __pyx_t_4 = __pyx_t_3;
    } else {
      __pyx_t_4 = __pyx_t_2;
    }
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __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":694
 * 
 * 
 *     cdef void clear_cobj(self):             # <<<<<<<<<<<<<<
 *         #clear C++ internal state
 *         del self.pyfcn;self.pyfcn = NULL
 */

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":696
 *     cdef void clear_cobj(self):
 *         #clear C++ internal state
 *         del self.pyfcn;self.pyfcn = NULL             # <<<<<<<<<<<<<<
 *         del self.minimizer;self.minimizer = NULL
 *         del self.cfmin;self.cfmin = NULL
 */
  delete __pyx_v_self->pyfcn;
  __pyx_v_self->pyfcn = NULL;

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

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

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

  __Pyx_RefNannyFinishContext();
}

/* 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));
  __Pyx_RefNannyFinishContext();
}

/* "iminuit/_libiminuit.pyx":702
 * 
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.clear_cobj()
 * 
 */

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":703
 * 
 *     def __dealloc__(self):
 *         self.clear_cobj()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_7iminuit_11_libiminuit_Minuit *)__pyx_v_self->__pyx_vtab)->clear_cobj(__pyx_v_self);

  __Pyx_RefNannyFinishContext();
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pedantic", 0);

  /* "iminuit/_libiminuit.pyx":707
 * 
 *     def pedantic(self, kwds):
 *         for vn in self.parameters:             # <<<<<<<<<<<<<<
 *             if vn not in kwds:
 *                 warn(('Parameter %s does not have initial value. '
 */
  if (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 = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && 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 = 707; __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 = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 707; __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 = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_vn);
    __pyx_v_vn = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":708
 *     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_Contains(__pyx_v_vn, __pyx_v_kwds, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "iminuit/_libiminuit.pyx":709
 *         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_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "iminuit/_libiminuit.pyx":710
 *             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_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_38), __pyx_v_vn); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_6));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "iminuit/_libiminuit.pyx":711
 *                 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_7 = PyNumber_Add(((PyObject *)__pyx_n_s__error_), __pyx_v_vn); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_t_7, __pyx_v_kwds, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_5) {
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_vn);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_vn);
      __Pyx_GIVEREF(__pyx_v_vn);
      __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_n_s__fix_), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_v_kwds, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = __pyx_t_9;
    } else {
      __pyx_t_10 = __pyx_t_5;
    }
    if (__pyx_t_10) {

      /* "iminuit/_libiminuit.pyx":712
 *                     '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_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);

      /* "iminuit/_libiminuit.pyx":713
 *             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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_39), __pyx_v_vn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));

      /* "iminuit/_libiminuit.pyx":714
 *                 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_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_4 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":715
 *                     '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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__extract_limit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_kwds);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_kwds);
  __Pyx_GIVEREF(__pyx_v_kwds);
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_7 = __pyx_t_6; __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_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = Py_TYPE(__pyx_t_7)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_7)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_7)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_6 = __pyx_t_3(__pyx_t_7);
      if (unlikely(!__pyx_t_6)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF(__pyx_v_vlim);
    __pyx_v_vlim = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":716
 *                     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_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_vlim);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vlim);
    __Pyx_GIVEREF(__pyx_v_vlim);
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_10) {

      /* "iminuit/_libiminuit.pyx":717
 *         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 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);

      /* "iminuit/_libiminuit.pyx":718
 *             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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_vlim);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_vlim);
      __Pyx_GIVEREF(__pyx_v_vlim);
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__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 = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_vlim);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_vlim);
      __Pyx_GIVEREF(__pyx_v_vlim);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_40), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "iminuit/_libiminuit.pyx":719
 *                 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_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__extract_fix); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_kwds);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_kwds);
  __Pyx_GIVEREF(__pyx_v_kwds);
  __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_1 = __pyx_t_6; __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_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_6 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_6)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF(__pyx_v_vfix);
    __pyx_v_vfix = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":720
 *                     '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_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_vfix);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_vfix);
    __Pyx_GIVEREF(__pyx_v_vfix);
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_10) {

      /* "iminuit/_libiminuit.pyx":721
 *         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_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);

      /* "iminuit/_libiminuit.pyx":722
 *             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_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_vfix);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_vfix);
      __Pyx_GIVEREF(__pyx_v_vfix);
      __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__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 = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_vfix);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_vfix);
      __Pyx_GIVEREF(__pyx_v_vfix);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_41), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L12;
    }
    __pyx_L12:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":723
 *                 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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__extract_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_kwds);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_kwds);
  __Pyx_GIVEREF(__pyx_v_kwds);
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_7 = __pyx_t_6; __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_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = Py_TYPE(__pyx_t_7)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_7)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_7)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_6 = __pyx_t_3(__pyx_t_7);
      if (unlikely(!__pyx_t_6)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF(__pyx_v_verr);
    __pyx_v_verr = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":724
 *                     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_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_verr);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_verr);
    __Pyx_GIVEREF(__pyx_v_verr);
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_10) {

      /* "iminuit/_libiminuit.pyx":725
 *         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_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);

      /* "iminuit/_libiminuit.pyx":726
 *             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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__param_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_verr);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_verr);
      __Pyx_GIVEREF(__pyx_v_verr);
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__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 = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_verr);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_verr);
      __Pyx_GIVEREF(__pyx_v_verr);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_42), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__InitialParamWarning); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L15;
    }
    __pyx_L15:;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __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;
}

/* 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 specify range ie. Migrad results\n        with **vname** fixed 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        **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;
  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] = __pyx_k_43;
    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 = 729; __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 = 729; __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);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_9mnprofile_2generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":766
 *         binstep = blength/(bins-1)
 * 
 *         values = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         results = array.array('d')
 *         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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_9mnprofile_2generator5, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.mnprofile.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 766; __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 = 766; __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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__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_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && 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 = 766; __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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 766; __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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_i = __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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __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 = 766; __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 = 766; __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 = 766; __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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_9mnprofile_5generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":784
 *         if subtract_min:
 *             themin = min(results)
 *             results = array.array('d',(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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_9mnprofile_5generator6, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.mnprofile.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 784; __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 = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (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 = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && 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 = 784; __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 = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 784; __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 = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_x = __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 = 784; __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 = 784; __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 = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "iminuit/_libiminuit.pyx":729
 * 
 * 
 *     def mnprofile(self, vname, bins=30, bound=2,             # <<<<<<<<<<<<<<
 *             subtract_min=False):
 *         """calculate minos profile around specify range ie. Migrad results
 */

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;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  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("mnprofile", 0);
  __pyx_cur_scope = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *)__pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile->tp_new(__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":753
 *             bins(center point), value, migrad results
 *         """
 *         if vname not in self.parameters:             # <<<<<<<<<<<<<<
 *             raise ValueError('Unknown parameter %s'%vname)
 * 
 */
  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_vname, __pyx_v_self->parameters, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":754
 *         """
 *         if vname not in self.parameters:
 *             raise ValueError('Unknown parameter %s'%vname)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(bound, (int,long,float)):
 */
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_44), __pyx_v_vname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":756
 *             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_2 = __pyx_cur_scope->__pyx_v_bound;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = PyInt_Check(__pyx_t_2); 
  if (!__pyx_t_1) {
    __pyx_t_4 = PyLong_Check(__pyx_t_2); 
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_1;
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = PyFloat_Check(__pyx_t_2); 
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_5;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "iminuit/_libiminuit.pyx":757
 * 
 *         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_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__matrix_accurate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = (!__pyx_t_4);
    if (__pyx_t_5) {

      /* "iminuit/_libiminuit.pyx":758
 *         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_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_46), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __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_2); __pyx_t_2 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "iminuit/_libiminuit.pyx":760
 *                 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_2 = PyObject_GetItem(__pyx_v_self->values, __pyx_v_vname); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __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":761
 *                      '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_2 = PyObject_GetItem(__pyx_v_self->errors, __pyx_v_vname); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __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":762
 *             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_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_bound, __pyx_v_sigma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_start, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 762; __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 = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_3 = 0;
    __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_bound);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_bound);
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_cur_scope->__pyx_v_bound = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":763
 *             sigma = self.errors[vname]
 *             bound = (start -  bound*sigma, start + bound*sigma)
 *         blength = bound[1]-bound[0]             # <<<<<<<<<<<<<<
 *         binstep = blength/(bins-1)
 * 
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bound, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __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_6); __pyx_t_6 = 0;
  __pyx_v_blength = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "iminuit/_libiminuit.pyx":764
 *             bound = (start -  bound*sigma, start + bound*sigma)
 *         blength = bound[1]-bound[0]
 *         binstep = blength/(bins-1)             # <<<<<<<<<<<<<<
 * 
 *         values = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 */
  __pyx_t_3 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_bins, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __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 = 764; __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":766
 *         binstep = blength/(bins-1)
 * 
 *         values = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         results = array.array('d')
 *         migrad_status = []
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_9mnprofile_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_values = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":767
 * 
 *         values = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 *         results = array.array('d')             # <<<<<<<<<<<<<<
 *         migrad_status = []
 *         for i, v in enumerate(values):
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_results = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":768
 *         values = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 *         results = array.array('d')
 *         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 = 768; __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":769
 *         results = array.array('d')
 *         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 (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
    __pyx_t_2 = __pyx_v_values; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_3 = __pyx_t_8(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_6;
    __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __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":770
 *         migrad_status = []
 *         for i, v in enumerate(values):
 *             fitparam = self.fitarg.copy()             # <<<<<<<<<<<<<<
 *             fitparam[vname] = v
 *             fitparam['fix_%s'%vname] = True
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->fitarg, __pyx_n_s__copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_fitparam);
    __pyx_v_fitparam = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "iminuit/_libiminuit.pyx":771
 *         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 (PyObject_SetItem(__pyx_v_fitparam, __pyx_v_vname, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":772
 *             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_9 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_48), __pyx_v_vname); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyObject_SetItem(__pyx_v_fitparam, ((PyObject *)__pyx_t_3), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

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

    /* "iminuit/_libiminuit.pyx":775
 *             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 = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (likely(PyDict_Check(__pyx_v_fitparam))) {
      __pyx_t_3 = PyDict_Copy(__pyx_v_fitparam); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    } else {
      __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_fitparam, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    }
    if (unlikely(PyDict_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__print_level)))) {
      __Pyx_RaiseDoubleKeywordsError("function", ((PyObject *)__pyx_n_s__print_level)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__print_level), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":774
 *             fitparam['fix_%s'%vname] = True
 *             m = Minuit(self.fcn, print_level=0,
 *                     pedantic=False, forced_parameters=self.parameters,             # <<<<<<<<<<<<<<
 *                     **fitparam)
 *             m.migrad()
 */
    __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    if (unlikely(PyDict_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__pedantic)))) {
      __Pyx_RaiseDoubleKeywordsError("function", ((PyObject *)__pyx_n_s__pedantic)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__pedantic), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(PyDict_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__forced_parameters)))) {
      __Pyx_RaiseDoubleKeywordsError("function", ((PyObject *)__pyx_n_s__forced_parameters)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__forced_parameters), __pyx_v_self->parameters) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7iminuit_11_libiminuit_Minuit)), ((PyObject *)__pyx_t_9), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_m));
    __pyx_v_m = ((struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "iminuit/_libiminuit.pyx":776
 *                     pedantic=False, forced_parameters=self.parameters,
 *                     **fitparam)
 *             m.migrad()             # <<<<<<<<<<<<<<
 *             migrad_status.append(m.migrad_ok())
 *             if not m.migrad_ok():
 */
    __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_v_m), __pyx_n_s__migrad); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "iminuit/_libiminuit.pyx":777
 *                     **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_3 = PyObject_GetAttr(((PyObject *)__pyx_v_m), __pyx_n_s__migrad_ok); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_11 = PyList_Append(__pyx_v_migrad_status, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "iminuit/_libiminuit.pyx":778
 *             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_10 = PyObject_GetAttr(((PyObject *)__pyx_v_m), __pyx_n_s__migrad_ok); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = (!__pyx_t_5);
    if (__pyx_t_4) {

      /* "iminuit/_libiminuit.pyx":779
 *             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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_vname);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_vname);
      __Pyx_GIVEREF(__pyx_v_vname);
      __Pyx_INCREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_9));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
      __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;

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

  /* "iminuit/_libiminuit.pyx":782
 *             results.append(m.fval)
 * 
 *         if subtract_min:             # <<<<<<<<<<<<<<
 *             themin = min(results)
 *             results = array.array('d',(x-themin for x in results))
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

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

    /* "iminuit/_libiminuit.pyx":784
 *         if subtract_min:
 *             themin = min(results)
 *             results = array.array('d',(x-themin for x in results))             # <<<<<<<<<<<<<<
 * 
 *         return values, results, migrad_status
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_9mnprofile_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
    PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_n_s__d));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_results);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_results);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_results = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "iminuit/_libiminuit.pyx":786
 *             results = array.array('d',(x-themin for x in results))
 * 
 *         return values, results, migrad_status             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_results);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_results);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_results);
  __Pyx_INCREF(((PyObject *)__pyx_v_migrad_status));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_migrad_status));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_migrad_status));
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __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;
}

/* 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 specify range ie. Migrad results\n        with **vname** fixed 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\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;
  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] = __pyx_k_50;
    values[4] = __pyx_k_51;
    values[5] = __pyx_k_52;
    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 = 789; __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 = 789; __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);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":789
 * 
 * 
 *     def draw_mnprofile(self, vname, bins=30, bound=2, subtract_min=False,             # <<<<<<<<<<<<<<
 *         band=True, text=True):
 *         """Draw minos profile around specify range ie. Migrad results
 */

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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_mnprofile", 0);

  /* "iminuit/_libiminuit.pyx":824
 * 
 *         """
 *         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_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__mnprofile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_vname);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vname);
  __Pyx_GIVEREF(__pyx_v_vname);
  __Pyx_INCREF(__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  __Pyx_INCREF(__pyx_v_bound);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_bound);
  __Pyx_GIVEREF(__pyx_v_bound);
  __Pyx_INCREF(__pyx_v_subtract_min);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_subtract_min);
  __Pyx_GIVEREF(__pyx_v_subtract_min);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__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 = 824; __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_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __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 = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __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_1;
  __pyx_t_1 = 0;
  __pyx_v_s = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "iminuit/_libiminuit.pyx":825
 *         """
 *         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_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___plotting); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__draw_profile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_vname);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vname);
  __Pyx_GIVEREF(__pyx_v_vname);
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __Pyx_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "iminuit/_libiminuit.pyx":826
 *         x, y, s= self.mnprofile(vname, bins, bound, subtract_min)
 *         return _plotting.draw_profile(self, vname, x, y, s,
 *                                       band=band, text=text)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__band), __pyx_v_band) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__text), __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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.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;
}

/* 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\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;
  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);

    /* "iminuit/_libiminuit.pyx":829
 * 
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """calculate cost function profile around specify range.
 * 
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k_53;
    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 = 829; __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 = 829; __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);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7profile_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":865
 *         args = list(self.args) if args is None else args
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         ret = array.array('d')
 *         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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_7profile_2generator7, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.profile.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 865; __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 = 865; __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 = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__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_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bins);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (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 = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && 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 = 865; __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 = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 865; __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 = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_i = __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 = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __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 = 865; __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 = 865; __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 = 865; __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 = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "iminuit/_libiminuit.pyx":829
 * 
 * 
 *     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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  double __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_10_profile->tp_new(__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":856
 * 
 *         """
 *         if isinstance(bound, (int,long,float)):             # <<<<<<<<<<<<<<
 *             start = self.values[vname]
 *             sigma = self.errors[vname]
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_bound;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyInt_Check(__pyx_t_1); 
  if (!__pyx_t_2) {
    __pyx_t_3 = PyLong_Check(__pyx_t_1); 
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = PyFloat_Check(__pyx_t_1); 
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

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

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

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

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

  /* "iminuit/_libiminuit.pyx":861
 *             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_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bound, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_blength = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":862
 *                     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 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_bins, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_blength, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __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_binstep = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":863
 *         blength = bound[1]-bound[0]
 *         binstep = blength/(bins-1.)
 *         args = list(self.args) if args is None else args             # <<<<<<<<<<<<<<
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 */
  __pyx_t_3 = (__pyx_v_args == Py_None);
  if (__pyx_t_3) {
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_self->args);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self->args);
    __Pyx_GIVEREF(__pyx_v_self->args);
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_5 = __pyx_t_1;
    __pyx_t_1 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_args);
    __pyx_t_5 = __pyx_v_args;
  }
  __Pyx_DECREF(__pyx_v_args);
  __pyx_v_args = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":865
 *         args = list(self.args) if args is None else args
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))             # <<<<<<<<<<<<<<
 *         ret = array.array('d')
 *         pos = self.var2pos[vname]
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7profile_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_bins = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":866
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 *         ret = array.array('d')             # <<<<<<<<<<<<<<
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_ret = __pyx_t_5;
  __pyx_t_5 = 0;

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

  /* "iminuit/_libiminuit.pyx":868
 *         ret = array.array('d')
 *         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_3 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {
    __pyx_t_4 = (__pyx_v_self->cfmin == NULL);
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":869
 *         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_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__RunTimeError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_56), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":872
 *                 "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_2 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_7 = __pyx_v_self->cfmin->fval();
  } else {
    __pyx_t_7 = 0.;
  }
  __pyx_v_minval = __pyx_t_7;

  /* "iminuit/_libiminuit.pyx":873
 *                 "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 (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_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_bins); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_6)) {
      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_6)) {
      if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_9(__pyx_t_6);
      if (unlikely(!__pyx_t_5)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":874
 *         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 (PyObject_SetItem(__pyx_v_args, __pyx_v_pos, __pyx_v_val) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

  /* "iminuit/_libiminuit.pyx":876
 *             args[pos] = val
 *             ret.append(self.fcn(*args)-minval)
 *         return bins, ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bins);
  __Pyx_INCREF(__pyx_v_ret);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_ret);
  __Pyx_GIVEREF(__pyx_v_ret);
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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;
}

/* 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)\n\n        A 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;
  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);

    /* "iminuit/_libiminuit.pyx":879
 * 
 * 
 *     def draw_profile(self, vname, bins=100, bound=2, args=None,             # <<<<<<<<<<<<<<
 *         subtract_min=False, band=True, text=True):
 *         """
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k_57;
    values[5] = __pyx_k_58;
    values[6] = __pyx_k_59;
    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 = 879; __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 = 879; __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);
  __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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_profile", 0);

  /* "iminuit/_libiminuit.pyx":908
 *             :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_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__profile); 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_t_2 = PyTuple_New(5); 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_INCREF(__pyx_v_vname);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vname);
  __Pyx_GIVEREF(__pyx_v_vname);
  __Pyx_INCREF(__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  __Pyx_INCREF(__pyx_v_bound);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_bound);
  __Pyx_GIVEREF(__pyx_v_bound);
  __Pyx_INCREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_subtract_min);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_subtract_min);
  __Pyx_GIVEREF(__pyx_v_subtract_min);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); 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);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__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 != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      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_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    #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_1 = PySequence_ITEM(sequence, 1); 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);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_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_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":909
 *         """
 *         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_GetName(__pyx_m, __pyx_n_s___plotting); 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_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__draw_profile); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(4); 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_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_vname);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vname);
  __Pyx_GIVEREF(__pyx_v_vname);
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "iminuit/_libiminuit.pyx":910
 *         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
 * 
 */
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__band), __pyx_v_band) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__text), __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  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 != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __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_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); 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_t_3 = PySequence_ITEM(sequence, 1); 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_t_1 = PySequence_ITEM(sequence, 2); 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);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  {
    Py_ssize_t index = -1;
    __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_1 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }

  /* "iminuit/_libiminuit.pyx":909
 *         """
 *         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_DECREF(__pyx_v_x);
  __pyx_v_x = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_y);
  __pyx_v_y = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_s = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":911
 *         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_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __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_6);
  __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;
}

/* 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 countour scan.\n\n        The contour returns is obtained by fixing all others parameters and\n        varying **x** and **y**.\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;
  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);

    /* "iminuit/_libiminuit.pyx":913
 *         return x, y
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D countour scan.
 * 
 */
    values[4] = ((PyObject *)Py_None);
    values[5] = __pyx_k_60;
    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 = 913; __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 = 913; __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 = 913; __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);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_2generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":975
 *         y_binstep = y_blength/(y_bins-1.)
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))             # <<<<<<<<<<<<<<
 *         y_val = array.array('d',(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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_2generator8, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.contour.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 975; __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 = 975; __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 = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__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_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bins);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (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 = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && 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 = 975; __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 = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 975; __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 = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_i = __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 = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __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 = 975; __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 = 975; __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 = 975; __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 = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_5generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":976
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))
 *         y_val = array.array('d',(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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_7contour_5generator9, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.contour.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 976; __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 = 976; __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 = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__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_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bins);
  __pyx_t_2 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (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 = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && 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 = 976; __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 = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 976; __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 = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_i = __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 = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __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 = 976; __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 = 976; __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 = 976; __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 = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "iminuit/_libiminuit.pyx":913
 *         return x, y
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D countour 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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  double __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_12_contour->tp_new(__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":955
 *         """
 *         #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_INCREF(__pyx_v_bound);
  __pyx_t_1 = __pyx_v_bound;
  __pyx_t_2 = PyInt_Check(__pyx_t_1); 
  if (!__pyx_t_2) {
    __pyx_t_3 = PyLong_Check(__pyx_t_1); 
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = PyFloat_Check(__pyx_t_1); 
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":956
 *         #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_1 = PyObject_GetItem(__pyx_v_self->values, __pyx_v_x); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_x_start = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":957
 *         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_1 = PyObject_GetItem(__pyx_v_self->errors, __pyx_v_x); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_x_sigma = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":958
 *             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_1 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_x_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_x_start, __pyx_t_1); 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_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_x_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Add(__pyx_v_x_start, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_cur_scope->__pyx_v_x_bound = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":959
 *             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_1 = PyObject_GetItem(__pyx_v_self->values, __pyx_v_y); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_y_start = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":960
 *             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_1 = PyObject_GetItem(__pyx_v_self->errors, __pyx_v_y); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_y_sigma = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":961
 *             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_1 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_y_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Subtract(__pyx_v_y_start, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_bound, __pyx_v_y_sigma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_v_y_start, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __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(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_5 = 0;
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_cur_scope->__pyx_v_y_bound = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "iminuit/_libiminuit.pyx":963
 *             y_bound = (y_start-bound*y_sigma, y_start+bound*y_sigma)
 *         else:
 *             x_bound = bound[0]             # <<<<<<<<<<<<<<
 *             y_bound = bound[1]
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_x_bound = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":964
 *         else:
 *             x_bound = bound[0]
 *             y_bound = bound[1]             # <<<<<<<<<<<<<<
 * 
 *         x_bins = bins
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bound, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_y_bound = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":966
 *             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":967
 * 
 *         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":969
 *         y_bins = bins
 * 
 *         x_blength = x_bound[1]-x_bound[0]             # <<<<<<<<<<<<<<
 *         x_binstep = x_blength/(x_bins-1.)
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_x_bound, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_x_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_x_blength = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":970
 * 
 *         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 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_x_bins, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_x_blength, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __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_x_binstep = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":972
 *         x_binstep = x_blength/(x_bins-1.)
 * 
 *         y_blength = y_bound[1]-y_bound[0]             # <<<<<<<<<<<<<<
 *         y_binstep = y_blength/(y_bins-1.)
 * 
 */
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_y_bound, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_y_bound, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __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_5); __pyx_t_5 = 0;
  __pyx_v_y_blength = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":973
 * 
 *         y_blength = y_bound[1]-y_bound[0]
 *         y_binstep = y_blength/(y_bins-1.)             # <<<<<<<<<<<<<<
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))
 */
  __pyx_t_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_y_bins, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_y_blength, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_y_binstep = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":975
 *         y_binstep = y_blength/(y_bins-1.)
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))             # <<<<<<<<<<<<<<
 *         y_val = array.array('d',(y_bound[0]+y_binstep*i for i in xrange(y_bins)))
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_v_x_val = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":976
 * 
 *         x_val = array.array('d',(x_bound[0]+x_binstep*i for i in xrange(x_bins)))
 *         y_val = array.array('d',(y_bound[0]+y_binstep*i for i in xrange(y_bins)))             # <<<<<<<<<<<<<<
 * 
 *         x_pos = self.var2pos[x]
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_7contour_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__d));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d));
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_v_y_val = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":978
 *         y_val = array.array('d',(y_bound[0]+y_binstep*i for i in xrange(y_bins)))
 * 
 *         x_pos = self.var2pos[x]             # <<<<<<<<<<<<<<
 *         y_pos = self.var2pos[y]
 * 
 */
  __pyx_t_1 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_x); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x_pos = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":979
 * 
 *         x_pos = self.var2pos[x]
 *         y_pos = self.var2pos[y]             # <<<<<<<<<<<<<<
 * 
 *         args = list(self.args) if args is None else args
 */
  __pyx_t_1 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_y); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_y_pos = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":981
 *         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) {
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->args);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->args);
    __Pyx_GIVEREF(__pyx_v_self->args);
    __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_1 = __pyx_t_6;
    __pyx_t_6 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_args);
    __pyx_t_1 = __pyx_v_args;
  }
  __Pyx_DECREF(__pyx_v_args);
  __pyx_v_args = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":983
 *         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_3 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {
    __pyx_t_4 = (__pyx_v_self->cfmin == NULL);
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":984
 * 
 *         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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__RunTimeError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_61), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":987
 *                 "subtraction but no minimization has been done. "
 *                 "Run migrad first.")
 *         minval = self.cfmin.fval() if subtract_min else 0.             # <<<<<<<<<<<<<<
 * 
 *         ret = list()
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_subtract_min); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_7 = __pyx_v_self->cfmin->fval();
  } else {
    __pyx_t_7 = 0.;
  }
  __pyx_v_minval = __pyx_t_7;

  /* "iminuit/_libiminuit.pyx":989
 *         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 = 989; __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":990
 * 
 *         ret = list()
 *         for yy in y_val:             # <<<<<<<<<<<<<<
 *             args[y_pos] = yy
 *             tmp = array.array('d')
 */
  if (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_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_y_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_6)) {
      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_6)) {
      if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_9(__pyx_t_6);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_yy);
    __pyx_v_yy = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":991
 *         ret = list()
 *         for yy in y_val:
 *             args[y_pos] = yy             # <<<<<<<<<<<<<<
 *             tmp = array.array('d')
 *             for xx in x_val:
 */
    if (PyObject_SetItem(__pyx_v_args, __pyx_v_y_pos, __pyx_v_yy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "iminuit/_libiminuit.pyx":992
 *         for yy in y_val:
 *             args[y_pos] = yy
 *             tmp = array.array('d')             # <<<<<<<<<<<<<<
 *             for xx in x_val:
 *                 args[x_pos] = xx
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_62), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_tmp);
    __pyx_v_tmp = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":993
 *             args[y_pos] = yy
 *             tmp = array.array('d')
 *             for xx in x_val:             # <<<<<<<<<<<<<<
 *                 args[x_pos] = xx
 *                 tmp.append(self.fcn(*args)-minval)
 */
    if (PyList_CheckExact(__pyx_v_x_val) || PyTuple_CheckExact(__pyx_v_x_val)) {
      __pyx_t_1 = __pyx_v_x_val; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_x_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_5 = __pyx_t_11(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF(__pyx_v_xx);
      __pyx_v_xx = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "iminuit/_libiminuit.pyx":994
 *             tmp = array.array('d')
 *             for xx in x_val:
 *                 args[x_pos] = xx             # <<<<<<<<<<<<<<
 *                 tmp.append(self.fcn(*args)-minval)
 *             ret.append(tmp)
 */
      if (PyObject_SetItem(__pyx_v_args, __pyx_v_x_pos, __pyx_v_xx) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "iminuit/_libiminuit.pyx":995
 *             for xx in x_val:
 *                 args[x_pos] = xx
 *                 tmp.append(self.fcn(*args)-minval)             # <<<<<<<<<<<<<<
 *             ret.append(tmp)
 * 
 */
      __pyx_t_5 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_12 = PyObject_Call(__pyx_v_self->fcn, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_minval); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = PyNumber_Subtract(__pyx_t_12, __pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_tmp, __pyx_t_13); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "iminuit/_libiminuit.pyx":996
 *                 args[x_pos] = xx
 *                 tmp.append(self.fcn(*args)-minval)
 *             ret.append(tmp)             # <<<<<<<<<<<<<<
 * 
 *         return x_val, y_val, ret
 */
    __pyx_t_14 = PyList_Append(__pyx_v_ret, __pyx_v_tmp); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":998
 *             ret.append(tmp)
 * 
 *         return x_val, y_val, ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_x_val);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_x_val);
  __Pyx_GIVEREF(__pyx_v_x_val);
  __Pyx_INCREF(__pyx_v_y_val);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_y_val);
  __Pyx_GIVEREF(__pyx_v_y_val);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_ret));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __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;
}

/* 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)\n\n        Minos contour scan. A proper n **sigma** contour scan. This is 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;
  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] = __pyx_k_63;
    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 = 1001; __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 = 1001; __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_AsInt(values[2]); if (unlikely((__pyx_v_numpoints == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __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 = 1001; __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);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1001
 * 
 * 
 *     def mncontour(self, x, y, int numpoints=20, sigma=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Minos contour scan. A proper n **sigma** contour scan. This is line
 */

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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mncontour", 0);

  /* "iminuit/_libiminuit.pyx":1030
 * 
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('Run Migrad first')
 * 
 */
  __pyx_t_1 = (__pyx_v_self->pyfcn == NULL);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_self->cfmin == NULL);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "iminuit/_libiminuit.pyx":1031
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:
 *             raise ValueError('Run Migrad first')             # <<<<<<<<<<<<<<
 * 
 *         cdef unsigned int ix = self.var2pos[x]
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_65), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __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 = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":1033
 *             raise ValueError('Run Migrad first')
 * 
 *         cdef unsigned int ix = self.var2pos[x]             # <<<<<<<<<<<<<<
 *         cdef unsigned int iy = self.var2pos[y]
 * 
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_x); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_4); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_ix = __pyx_t_5;

  /* "iminuit/_libiminuit.pyx":1034
 * 
 *         cdef unsigned int ix = self.var2pos[x]
 *         cdef unsigned int iy = self.var2pos[y]             # <<<<<<<<<<<<<<
 * 
 *         vary_param = self.list_of_vary_param()
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_v_self->var2pos, __pyx_v_y); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_4); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_iy = __pyx_t_5;

  /* "iminuit/_libiminuit.pyx":1036
 *         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_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_vary_param); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_vary_param = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1038
 *         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_3 = (__Pyx_PySequence_Contains(__pyx_v_x, __pyx_v_vary_param, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_3) {
    __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_y, __pyx_v_vary_param, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "iminuit/_libiminuit.pyx":1039
 * 
 *         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_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_67), NULL); 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_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "iminuit/_libiminuit.pyx":1041
 *             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":1042
 * 
 *         cdef double oldup = self.pyfcn.up()
 *         self.pyfcn.set_up(oldup*sigma*sigma)             # <<<<<<<<<<<<<<
 * 
 *         cdef auto_ptr[MnContours] mnc = auto_ptr[MnContours](
 */
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_oldup); 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_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_v_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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_v_sigma); 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_7 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->pyfcn->set_up(__pyx_t_7);

  /* "iminuit/_libiminuit.pyx":1047
 *                                             new MnContours(deref(self.pyfcn),
 *                                                     deref(self.cfmin),
 *                                                     self.strategy))             # <<<<<<<<<<<<<<
 * 
 *         cdef ContoursError cerr = mnc.get().contour(ix, iy, numpoints)
 */
  __pyx_v_mnc = std::auto_ptr<MnContours>(new MnContours((*__pyx_v_self->pyfcn), (*__pyx_v_self->cfmin), __pyx_v_self->strategy));

  /* "iminuit/_libiminuit.pyx":1049
 *                                                     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":1051
 *         cdef ContoursError cerr = mnc.get().contour(ix, iy, numpoints)
 * 
 *         xminos = minoserror2struct(cerr.xMinosError())             # <<<<<<<<<<<<<<
 *         yminos = minoserror2struct(cerr.yMinosError())
 * 
 */
  __pyx_t_6 = __pyx_f_7iminuit_11_libiminuit_minoserror2struct(__pyx_v_cerr.xMinosError()); 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_v_xminos = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1052
 * 
 *         xminos = minoserror2struct(cerr.xMinosError())
 *         yminos = minoserror2struct(cerr.yMinosError())             # <<<<<<<<<<<<<<
 * 
 *         self.pyfcn.set_up(oldup)
 */
  __pyx_t_6 = __pyx_f_7iminuit_11_libiminuit_minoserror2struct(__pyx_v_cerr.yMinosError()); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_yminos = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "iminuit/_libiminuit.pyx":1054
 *         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":1056
 *         self.pyfcn.set_up(oldup)
 * 
 *         return xminos, yminos, cerr.points() #using type coersion here             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_double_2c_double_3e_(__pyx_v_cerr.points()); 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_t_4 = PyTuple_New(3); 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_INCREF(__pyx_v_xminos);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_xminos);
  __Pyx_GIVEREF(__pyx_v_xminos);
  __Pyx_INCREF(__pyx_v_yminos);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_yminos);
  __Pyx_GIVEREF(__pyx_v_yminos);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __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;
}

/* 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)\n\n        compute 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;
  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);
    values[6] = __pyx_k_68;
    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 = 1059; __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 = 1059; __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_AsInt(values[5]); if (unlikely((__pyx_v_sigma_res == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __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 = 1059; __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);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1059
 * 
 * 
 *     def mncontour_grid(self, x, y, bins=100, nsigma=2, numpoints=20,             # <<<<<<<<<<<<<<
 *                         int sigma_res=4, edges=False):
 *         """
 */

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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mncontour_grid", 0);

  /* "iminuit/_libiminuit.pyx":1095
 * 
 *         """
 *         return _plotting.mncontour_grid(self, x, y, numpoints,             # <<<<<<<<<<<<<<
 *                                         nsigma, sigma_res, bins, edges)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___plotting); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__mncontour_grid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1096
 *         """
 *         return _plotting.mncontour_grid(self, x, y, numpoints,
 *                                         nsigma, sigma_res, bins, edges)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_sigma_res); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __Pyx_INCREF(__pyx_v_numpoints);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_numpoints);
  __Pyx_GIVEREF(__pyx_v_numpoints);
  __Pyx_INCREF(__pyx_v_nsigma);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_nsigma);
  __Pyx_GIVEREF(__pyx_v_nsigma);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  __Pyx_INCREF(__pyx_v_edges);
  PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_edges);
  __Pyx_GIVEREF(__pyx_v_edges);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __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.mncontour_grid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_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)\n\n        draw 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;
  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 = 1099; __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 = 1099; __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 = 1099; __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);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1099
 * 
 * 
 *     def draw_mncontour(self, x, y, bins=100, nsigma=2,             # <<<<<<<<<<<<<<
 *                         numpoints=20, sigma_res=4):
 *         """
 */

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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_mncontour", 0);

  /* "iminuit/_libiminuit.pyx":1123
 *             gridvalue is interorlated nsigma
 *         """
 *         return _plotting.draw_mncontour(self, x, y, bins, nsigma,             # <<<<<<<<<<<<<<
 *                                         numpoints, sigma_res)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___plotting); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__draw_mncontour); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1124
 *         """
 *         return _plotting.draw_mncontour(self, x, y, bins, nsigma,
 *                                         numpoints, sigma_res)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __Pyx_INCREF(__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  __Pyx_INCREF(__pyx_v_nsigma);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_nsigma);
  __Pyx_GIVEREF(__pyx_v_nsigma);
  __Pyx_INCREF(__pyx_v_numpoints);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_numpoints);
  __Pyx_GIVEREF(__pyx_v_numpoints);
  __Pyx_INCREF(__pyx_v_sigma_res);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_sigma_res);
  __Pyx_GIVEREF(__pyx_v_sigma_res);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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.draw_mncontour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_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)\n\n        Convenient wrapper for drawing contour. The argument is the same as\n        :meth:`contour`. If `show_sigma=True`(Default), the label on the\n        contour lines will show how many :math:`\\sigma` away from the optimal\n        value instead of raw value.\n\n        .. note::\n\n            Like :meth:`contour`. The error shown on the plot is not strictly\n            1 :math:`\\sigma` contour since the other parameters are fixed.\n\n        .. seealso::\n\n            :meth:`contour`\n            :meth:`mncontour`\n\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;
  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);

    /* "iminuit/_libiminuit.pyx":1127
 * 
 * 
 *     def draw_contour(self, x, y, bins=20, bound=2, args=None,             # <<<<<<<<<<<<<<
 *                      show_sigma=False):
 *         """
 */
    values[4] = ((PyObject *)Py_None);
    values[5] = __pyx_k_69;
    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 = 1127; __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 = 1127; __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 = 1127; __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);
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_contour", 0);

  /* "iminuit/_libiminuit.pyx":1146
 * 
 *         """
 *         return _plotting.draw_contour(self, x, y, bins,             # <<<<<<<<<<<<<<
 *                                       bound, args, show_sigma)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___plotting); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__draw_contour); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1147
 *         """
 *         return _plotting.draw_contour(self, x, y, bins,
 *                                       bound, args, show_sigma)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __Pyx_INCREF(__pyx_v_bins);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  __Pyx_INCREF(__pyx_v_bound);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_bound);
  __Pyx_GIVEREF(__pyx_v_bound);
  __Pyx_INCREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_show_sigma);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_show_sigma);
  __Pyx_GIVEREF(__pyx_v_show_sigma);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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.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":1150
 * 
 * 
 *     cdef refreshInternalState(self):             # <<<<<<<<<<<<<<
 *         """refresh internal state attributes.
 *         These attributes should be in a function instead
 */

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;
  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;
  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)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  unsigned int __pyx_t_16;
  unsigned int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("refreshInternalState", 0);

  /* "iminuit/_libiminuit.pyx":1157
 *         cdef vector[MinuitParameter] mpv
 *         cdef MnUserCovariance cov
 *         if self.last_upst is not NULL:             # <<<<<<<<<<<<<<
 *             mpv = self.last_upst.minuitParameters()
 *             self.values = {}
 */
  __pyx_t_1 = (__pyx_v_self->last_upst != NULL);
  if (__pyx_t_1) {

    /* "iminuit/_libiminuit.pyx":1158
 *         cdef MnUserCovariance cov
 *         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":1159
 *         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 = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_GOTREF(__pyx_v_self->values);
    __Pyx_DECREF(__pyx_v_self->values);
    __pyx_v_self->values = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1160
 *             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 = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_GOTREF(__pyx_v_self->errors);
    __Pyx_DECREF(__pyx_v_self->errors);
    __pyx_v_self->errors = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1161
 *             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 = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_GOTREF(__pyx_v_self->args);
    __Pyx_DECREF(__pyx_v_self->args);
    __pyx_v_self->args = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1162
 *             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":1163
 *             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 = 1163; __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)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __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_5); __pyx_t_5 = 0;

      /* "iminuit/_libiminuit.pyx":1164
 *             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_5 = PyFloat_FromDouble((__pyx_v_mpv[__pyx_v_i]).value()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyBytes_FromString((__pyx_v_mpv[__pyx_v_i]).name()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      if (PyObject_SetItem(__pyx_v_self->values, ((PyObject *)__pyx_t_2), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "iminuit/_libiminuit.pyx":1165
 *                 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_5 = PyFloat_FromDouble((__pyx_v_mpv[__pyx_v_i]).error()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyBytes_FromString((__pyx_v_mpv[__pyx_v_i]).name()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      if (PyObject_SetItem(__pyx_v_self->errors, ((PyObject *)__pyx_t_2), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }

    /* "iminuit/_libiminuit.pyx":1166
 *                 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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->args);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->args);
    __Pyx_GIVEREF(__pyx_v_self->args);
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __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":1167
 *                 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_2 = PyObject_GetAttr(__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->values);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->values);
    __Pyx_GIVEREF(__pyx_v_self->values);
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "iminuit/_libiminuit.pyx":1168
 *             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 = PyObject_GetAttr(__pyx_v_self->fitarg, __pyx_n_s__update); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __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 = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->errors, __pyx_n_s__items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          #endif
        } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          #endif
        } else {
          __pyx_t_7 = __pyx_t_9(__pyx_t_2);
          if (unlikely(!__pyx_t_7)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __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 = 1168; __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_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 = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_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 = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_11);
          #endif
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        {
          Py_ssize_t index = -1;
          __pyx_t_12 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_L11_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_L11_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 = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __pyx_t_13 = NULL;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L12_unpacking_done;
          __pyx_L11_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 = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __pyx_L12_unpacking_done:;
        }
        __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k);
        __pyx_9genexpr11__pyx_v_k = __pyx_t_10;
        __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v);
        __pyx_9genexpr11__pyx_v_v = __pyx_t_11;
        __pyx_t_11 = 0;
        __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_n_s__error_), __pyx_9genexpr11__pyx_v_k); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_7);
        if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_t_7, (PyObject*)__pyx_9genexpr11__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k);
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v);
      goto __pyx_L13_exit_scope;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_k);
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_v);
      goto __pyx_L1_error;
      __pyx_L13_exit_scope:;
    } /* exit inner scope */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":1169
 *             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_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_vary_param); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_vary_param = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1170
 *             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();
    if (__pyx_t_1) {

      /* "iminuit/_libiminuit.pyx":1171
 *             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":1173
 *                 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_9genexpr12__pyx_v_i = NULL;
        PyObject *__pyx_9genexpr12__pyx_v_v1 = NULL;
        PyObject *__pyx_9genexpr12__pyx_v_j = NULL;
        PyObject *__pyx_9genexpr12__pyx_v_v2 = NULL;
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_5 = __pyx_int_0;

        /* "iminuit/_libiminuit.pyx":1174
 *                 self.covariance =\
 *                      {(v1,v2):cov.get(i,j)\
 *                          for i,v1 in enumerate(vary_param)\             # <<<<<<<<<<<<<<
 *                          for j,v2 in enumerate(vary_param)}
 *             else:
 */
        if (PyList_CheckExact(__pyx_v_vary_param) || PyTuple_CheckExact(__pyx_v_vary_param)) {
          __pyx_t_6 = __pyx_v_vary_param; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_vary_param); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
        }
        for (;;) {
          if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_6)) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #endif
          } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_6)) {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #endif
          } else {
            __pyx_t_7 = __pyx_t_9(__pyx_t_6);
            if (unlikely(!__pyx_t_7)) {
              if (PyErr_Occurred()) {
                if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_v1);
          __pyx_9genexpr12__pyx_v_v1 = __pyx_t_7;
          __pyx_t_7 = 0;
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i);
          __pyx_9genexpr12__pyx_v_i = __pyx_t_5;
          __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5);
          __pyx_t_5 = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "iminuit/_libiminuit.pyx":1175
 *                      {(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_7 = __pyx_int_0;
          if (PyList_CheckExact(__pyx_v_vary_param) || PyTuple_CheckExact(__pyx_v_vary_param)) {
            __pyx_t_11 = __pyx_v_vary_param; __Pyx_INCREF(__pyx_t_11); __pyx_t_14 = 0;
            __pyx_t_15 = NULL;
          } else {
            __pyx_t_14 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_vary_param); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_15 = Py_TYPE(__pyx_t_11)->tp_iternext;
          }
          for (;;) {
            if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_11)) {
              if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_11)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              #else
              __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              #endif
            } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_11)) {
              if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              #else
              __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
              #endif
            } else {
              __pyx_t_10 = __pyx_t_15(__pyx_t_11);
              if (unlikely(!__pyx_t_10)) {
                if (PyErr_Occurred()) {
                  if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_10);
            }
            __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_v2);
            __pyx_9genexpr12__pyx_v_v2 = __pyx_t_10;
            __pyx_t_10 = 0;
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_j);
            __pyx_9genexpr12__pyx_v_j = __pyx_t_7;
            __pyx_t_10 = PyNumber_Add(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_7);
            __pyx_t_7 = __pyx_t_10;
            __pyx_t_10 = 0;

            /* "iminuit/_libiminuit.pyx":1173
 *                 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_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_INCREF(__pyx_9genexpr12__pyx_v_v1);
            PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_9genexpr12__pyx_v_v1);
            __Pyx_GIVEREF(__pyx_9genexpr12__pyx_v_v1);
            __Pyx_INCREF(__pyx_9genexpr12__pyx_v_v2);
            PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_9genexpr12__pyx_v_v2);
            __Pyx_GIVEREF(__pyx_9genexpr12__pyx_v_v2);
            __pyx_t_16 = __Pyx_PyInt_AsUnsignedInt(__pyx_9genexpr12__pyx_v_i); if (unlikely((__pyx_t_16 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __pyx_t_17 = __Pyx_PyInt_AsUnsignedInt(__pyx_9genexpr12__pyx_v_j); if (unlikely((__pyx_t_17 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __pyx_t_12 = PyFloat_FromDouble(__pyx_v_cov.operator()(__pyx_t_16, __pyx_t_17)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_12);
            if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_10, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i);
        __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_v1);
        __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_j);
        __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_v2);
        goto __pyx_L22_exit_scope;
        __pyx_L17_error:;
        __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i);
        __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_v1);
        __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_j);
        __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_v2);
        goto __pyx_L1_error;
        __pyx_L22_exit_scope:;
      } /* exit inner scope */
      __pyx_t_5 = ((PyObject *)__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

      /* "iminuit/_libiminuit.pyx":1172
 *             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_5);
      __Pyx_GOTREF(__pyx_v_self->covariance);
      __Pyx_DECREF(__pyx_v_self->covariance);
      __pyx_v_self->covariance = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "iminuit/_libiminuit.pyx":1177
 *                          for j,v2 in enumerate(vary_param)}
 *             else:
 *                 self.covariance = None             # <<<<<<<<<<<<<<
 *             self.fval = self.last_upst.fval()
 *             self.ncalls = self.last_upst.nfcn()
 */
      __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":1178
 *             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":1179
 *                 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":1180
 *             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":1181
 *             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().at(i)\
 */
    __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":1182
 *             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().at(i)\
 *                     for i,v in enumerate(self.list_of_vary_param())}
 */
    __pyx_t_1 = __pyx_v_self->last_upst->hasGlobalCC();
    if (__pyx_t_1) {
      __pyx_t_18 = __pyx_v_self->last_upst->globalCC().isValid();
      __pyx_t_19 = __pyx_t_18;
    } else {
      __pyx_t_19 = __pyx_t_1;
    }
    if (__pyx_t_19) {

      /* "iminuit/_libiminuit.pyx":1183
 *             self.gcc = None
 *             if self.last_upst.hasGlobalCC() and self.last_upst.globalCC().isValid():
 *                 self.gcc = {v:self.last_upst.globalCC().globalCC().at(i)\             # <<<<<<<<<<<<<<
 *                     for i,v in enumerate(self.list_of_vary_param())}
 *         self.merrors = {(k,1.0):v.upper
 */
      { /* enter inner scope */
        PyObject *__pyx_9genexpr13__pyx_v_i = NULL;
        PyObject *__pyx_9genexpr13__pyx_v_v = NULL;
        __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __Pyx_INCREF(__pyx_int_0);
        __pyx_t_2 = __pyx_int_0;

        /* "iminuit/_libiminuit.pyx":1184
 *             if self.last_upst.hasGlobalCC() and self.last_upst.globalCC().isValid():
 *                 self.gcc = {v:self.last_upst.globalCC().globalCC().at(i)\
 *                     for i,v in enumerate(self.list_of_vary_param())}             # <<<<<<<<<<<<<<
 *         self.merrors = {(k,1.0):v.upper
 *                        for k,v in self.merrors_struct.items()}
 */
        __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__list_of_vary_param); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
          __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        for (;;) {
          if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_6)) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
            #endif
          } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_6)) {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
            #endif
          } else {
            __pyx_t_7 = __pyx_t_9(__pyx_t_6);
            if (unlikely(!__pyx_t_7)) {
              if (PyErr_Occurred()) {
                if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v);
          __pyx_9genexpr13__pyx_v_v = __pyx_t_7;
          __pyx_t_7 = 0;
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i);
          __pyx_9genexpr13__pyx_v_i = __pyx_t_2;
          __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_2);
          __pyx_t_2 = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "iminuit/_libiminuit.pyx":1183
 *             self.gcc = None
 *             if self.last_upst.hasGlobalCC() and self.last_upst.globalCC().isValid():
 *                 self.gcc = {v:self.last_upst.globalCC().globalCC().at(i)\             # <<<<<<<<<<<<<<
 *                     for i,v in enumerate(self.list_of_vary_param())}
 *         self.merrors = {(k,1.0):v.upper
 */
          __pyx_t_3 = __Pyx_PyInt_AsSize_t(__pyx_9genexpr13__pyx_v_i); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
          __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->last_upst->globalCC().globalCC().at(__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
          __Pyx_GOTREF(__pyx_t_7);
          if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_9genexpr13__pyx_v_v, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
          __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;
        __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i);
        __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v);
        goto __pyx_L29_exit_scope;
        __pyx_L26_error:;
        __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i);
        __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v);
        goto __pyx_L1_error;
        __pyx_L29_exit_scope:;
      } /* exit inner scope */
      __pyx_t_2 = ((PyObject *)__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __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;
      goto __pyx_L23;
    }
    __pyx_L23:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "iminuit/_libiminuit.pyx":1185
 *                 self.gcc = {v:self.last_upst.globalCC().globalCC().at(i)\
 *                     for 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_9genexpr14__pyx_v_k = NULL;
    PyObject *__pyx_9genexpr14__pyx_v_v = NULL;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));

    /* "iminuit/_libiminuit.pyx":1186
 *                     for 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
 *                        for k,v in self.merrors_struct.items()})
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->merrors_struct, __pyx_n_s__items); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        #endif
      } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        #endif
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_5);
        if (unlikely(!__pyx_t_6)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_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 = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_11);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_11);
        #endif
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_7)) goto __pyx_L35_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L35_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 = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L36_unpacking_done;
        __pyx_L35_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 = 1186; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __pyx_L36_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_k);
      __pyx_9genexpr14__pyx_v_k = __pyx_t_7;
      __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v);
      __pyx_9genexpr14__pyx_v_v = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "iminuit/_libiminuit.pyx":1185
 *                 self.gcc = {v:self.last_upst.globalCC().globalCC().at(i)\
 *                     for 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 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_9genexpr14__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_9genexpr14__pyx_v_k);
      __Pyx_GIVEREF(__pyx_9genexpr14__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_GetAttr(__pyx_9genexpr14__pyx_v_v, __pyx_n_s__upper); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_11, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v);
    goto __pyx_L37_exit_scope;
    __pyx_L32_error:;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L37_exit_scope:;
  } /* exit inner scope */
  __pyx_t_5 = ((PyObject *)__pyx_t_2);
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->merrors);
  __Pyx_DECREF(__pyx_v_self->merrors);
  __pyx_v_self->merrors = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "iminuit/_libiminuit.pyx":1187
 *         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_5 = PyObject_GetAttr(__pyx_v_self->merrors, __pyx_n_s__update); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  { /* enter inner scope */
    PyObject *__pyx_9genexpr15__pyx_v_k = NULL;
    PyObject *__pyx_9genexpr15__pyx_v_v = NULL;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));

    /* "iminuit/_libiminuit.pyx":1188
 *                        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 = PyObject_GetAttr(__pyx_v_self->merrors_struct, __pyx_n_s__items); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyList_CheckExact(__pyx_t_11) || PyTuple_CheckExact(__pyx_t_11)) {
      __pyx_t_6 = __pyx_t_11; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    for (;;) {
      if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_6)) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_11 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
        #else
        __pyx_t_11 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
        #endif
      } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_6)) {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
        #else
        __pyx_t_11 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
        #endif
      } else {
        __pyx_t_11 = __pyx_t_9(__pyx_t_6);
        if (unlikely(!__pyx_t_11)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_11);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) {
        PyObject* sequence = __pyx_t_11;
        #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 = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_12);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
        __Pyx_GOTREF(__pyx_t_12);
        #endif
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L43_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_12 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_12)) goto __pyx_L43_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L44_unpacking_done;
        __pyx_L43_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
        __pyx_L44_unpacking_done:;
      }
      __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_k);
      __pyx_9genexpr15__pyx_v_k = __pyx_t_7;
      __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_v);
      __pyx_9genexpr15__pyx_v_v = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "iminuit/_libiminuit.pyx":1187
 *         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_11 = PyFloat_FromDouble(-1.0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_9genexpr15__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_9genexpr15__pyx_v_k);
      __Pyx_GIVEREF(__pyx_9genexpr15__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_GetAttr(__pyx_9genexpr15__pyx_v_v, __pyx_n_s__lower); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_12, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L40_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_v);
    goto __pyx_L45_exit_scope;
    __pyx_L40_error:;
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_k);
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L45_exit_scope:;
  } /* exit inner scope */
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __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":1191
 * 
 * 
 *     cdef MnUserParameterState* initialParameterState(self) except *:             # <<<<<<<<<<<<<<
 *         """construct parameter state from initial array.
 *         caller is responsible for cleaning up the pointer
 */

static MnUserParameterState *__pyx_f_7iminuit_11_libiminuit_6Minuit_initialParameterState(struct __pyx_obj_7iminuit_11_libiminuit_Minuit *__pyx_v_self) {
  MnUserParameterState *__pyx_v_ret;
  double __pyx_v_lb;
  double __pyx_v_ub;
  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;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialParameterState", 0);

  /* "iminuit/_libiminuit.pyx":1195
 *         caller is responsible for cleaning up the pointer
 *         """
 *         cdef MnUserParameterState* ret = new MnUserParameterState()             # <<<<<<<<<<<<<<
 *         cdef double lb
 *         cdef double ub
 */
  __pyx_v_ret = new MnUserParameterState();

  /* "iminuit/_libiminuit.pyx":1198
 *         cdef double lb
 *         cdef double ub
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             ret.add(v,self.initialvalue[v],self.initialerror[v])
 *         for v in self.parameters:
 */
  if (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 = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && 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 = 1198; __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 = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 1198; __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 = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1199
 *         cdef double ub
 *         for v in self.parameters:
 *             ret.add(v,self.initialvalue[v],self.initialerror[v])             # <<<<<<<<<<<<<<
 *         for v in self.parameters:
 *             if self.initiallimit[v] is not None:
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initialvalue, __pyx_v_v); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __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 = 1199; __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 (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __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 = 1199; __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);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1200
 *         for v in self.parameters:
 *             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 (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 = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && 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 = 1200; __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 = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 1200; __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 = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "iminuit/_libiminuit.pyx":1201
 *             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 lb >= ub:
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_v); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __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;
    if (__pyx_t_8) {

      /* "iminuit/_libiminuit.pyx":1202
 *         for v in self.parameters:
 *             if self.initiallimit[v] is not None:
 *                 lb,ub = self.initiallimit[v]             # <<<<<<<<<<<<<<
 *                 if lb >= ub:
 *                     raise ValueError(
 */
      __pyx_t_4 = PyObject_GetItem(__pyx_v_self->initiallimit, __pyx_v_v); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __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 = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        #else
        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L9_unpacking_done:;
      }
      __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_v_lb = __pyx_t_7;
      __pyx_v_ub = __pyx_t_6;

      /* "iminuit/_libiminuit.pyx":1203
 *             if self.initiallimit[v] is not None:
 *                 lb,ub = self.initiallimit[v]
 *                 if lb >= ub:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'limit for parameter %s is invalid. %r'%(v,(lb,ub)))
 */
      __pyx_t_8 = (__pyx_v_lb >= __pyx_v_ub);
      if (__pyx_t_8) {

        /* "iminuit/_libiminuit.pyx":1205
 *                 if lb >= ub:
 *                     raise ValueError(
 *                         'limit for parameter %s is invalid. %r'%(v,(lb,ub)))             # <<<<<<<<<<<<<<
 *                 ret.setLimits(v,lb,ub)
 *         for v in self.parameters:
 */
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_lb); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_10 = PyFloat_FromDouble(__pyx_v_ub); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_4 = 0;
        __pyx_t_10 = 0;
        __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_v);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_v);
        __Pyx_GIVEREF(__pyx_v_v);
        PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_t_9));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
        __pyx_t_9 = 0;
        __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_70), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
        __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_9));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
        __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
        __Pyx_Raise(__pyx_t_9, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "iminuit/_libiminuit.pyx":1206
 *                     raise ValueError(
 *                         'limit for parameter %s is invalid. %r'%(v,(lb,ub)))
 *                 ret.setLimits(v,lb,ub)             # <<<<<<<<<<<<<<
 *         for v in self.parameters:
 *             if self.initialfix[v]:
 */
      __pyx_t_5 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_ret->setLimits(__pyx_t_5, __pyx_v_lb, __pyx_v_ub);
      goto __pyx_L7;
    }
    __pyx_L7:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1207
 *                         'limit for parameter %s is invalid. %r'%(v,(lb,ub)))
 *                 ret.setLimits(v,lb,ub)
 *         for v in self.parameters:             # <<<<<<<<<<<<<<
 *             if self.initialfix[v]:
 *                 ret.fix(v)
 */
  if (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 = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_9); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_9); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_9 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_9)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_XDECREF(__pyx_v_v);
    __pyx_v_v = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "iminuit/_libiminuit.pyx":1208
 *                 ret.setLimits(v,lb,ub)
 *         for v in self.parameters:
 *             if self.initialfix[v]:             # <<<<<<<<<<<<<<
 *                 ret.fix(v)
 *         return ret
 */
    __pyx_t_9 = PyObject_GetItem(__pyx_v_self->initialfix, __pyx_v_v); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_8) {

      /* "iminuit/_libiminuit.pyx":1209
 *         for v in self.parameters:
 *             if self.initialfix[v]:
 *                 ret.fix(v)             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
      __pyx_t_5 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_ret->fix(__pyx_t_5);
      goto __pyx_L13;
    }
    __pyx_L13:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1210
 *             if self.initialfix[v]:
 *                 ret.fix(v)
 *         return ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit.initialParameterState", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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 front end automatically.\n        If this session is an IPYTHON session then use Html frontend,\n        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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":1213
 * 
 * 
 *     def _auto_frontend(self):             # <<<<<<<<<<<<<<
 *         """determine front end automatically.
 *         If this session is an IPYTHON session then use Html frontend,
 */

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_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auto_frontend", 0);

  /* "iminuit/_libiminuit.pyx":1218
 *         Console Frontend otherwise.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             __IPYTHON__
 *             from HtmlFrontend 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":1219
 *         """
 *         try:
 *             __IPYTHON__             # <<<<<<<<<<<<<<
 *             from HtmlFrontend import HtmlFrontend
 *             return HtmlFrontend()
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s____IPYTHON__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "iminuit/_libiminuit.pyx":1220
 *         try:
 *             __IPYTHON__
 *             from HtmlFrontend import HtmlFrontend             # <<<<<<<<<<<<<<
 *             return HtmlFrontend()
 *         except NameError:
 */
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__HtmlFrontend));
      PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__HtmlFrontend));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__HtmlFrontend));
      __pyx_t_5 = __Pyx_Import(((PyObject *)__pyx_n_s__HtmlFrontend), ((PyObject *)__pyx_t_4), -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__HtmlFrontend);
      if (__pyx_t_4 == NULL) {
        if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__HtmlFrontend);
        if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __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":1221
 *             __IPYTHON__
 *             from HtmlFrontend import HtmlFrontend
 *             return HtmlFrontend()             # <<<<<<<<<<<<<<
 *         except NameError:
 *             return ConsoleFrontend()
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = PyObject_Call(__pyx_v_HtmlFrontend, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __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_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "iminuit/_libiminuit.pyx":1222
 *             from HtmlFrontend import HtmlFrontend
 *             return HtmlFrontend()
 *         except NameError:             # <<<<<<<<<<<<<<
 *             return ConsoleFrontend()
 * 
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_NameError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("iminuit._libiminuit.Minuit._auto_frontend", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);

      /* "iminuit/_libiminuit.pyx":1223
 *             return HtmlFrontend()
 *         except NameError:
 *             return ConsoleFrontend()             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__ConsoleFrontend); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __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_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __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_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;
    __pyx_L4_exception_handled:;
    __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);
    __pyx_L10_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._auto_frontend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_HtmlFrontend);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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;
  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 = 1226; __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 = 1226; __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 = 1226; __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);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":1228
 *     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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_2generator10, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) { __Pyx_RaiseClosureNameError("parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (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 = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && 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 = 1228; __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 = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 1228; __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 = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_p = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_n_s__fix_), __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __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 = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_5generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":1229
 *         """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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_5generator11, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) { __Pyx_RaiseClosureNameError("parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (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 = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && 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 = 1229; __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 = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 1229; __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 = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_p = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_n_s__limit_), __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __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 = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_8generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "iminuit/_libiminuit.pyx":1230
 *         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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr->tp_new(__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_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_8generator12, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("iminuit._libiminuit.Minuit._check_extra_args.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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_GeneratorObject *__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;
  __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 = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parameters)) { __Pyx_RaiseClosureNameError("parameters"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (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 = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && 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 = 1230; __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 = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 1230; __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 = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_p = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_n_s__error_), __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __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 = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "iminuit/_libiminuit.pyx":1226
 * 
 * 
 *     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;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  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_ptype_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args->tp_new(__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":1228
 *     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 = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_fixed_param = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1229
 *         """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_1 = __pyx_pf_7iminuit_11_libiminuit_6Minuit_17_check_extra_args_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_limit_param = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1230
 *         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 = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_error_param = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1231
 *         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 = PyObject_GetAttr(__pyx_v_kwd, __pyx_n_s__keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (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 = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_4 && 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 = 1231; __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 = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      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 = 1231; __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 = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_k);
    __pyx_v_k = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "iminuit/_libiminuit.pyx":1232
 *         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_5 = (__Pyx_PySequence_Contains(__pyx_v_k, __pyx_cur_scope->__pyx_v_parameters, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "iminuit/_libiminuit.pyx":1233
 *         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_6 = (__Pyx_PySequence_Contains(__pyx_v_k, ((PyObject *)__pyx_v_fixed_param), Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_6) {

        /* "iminuit/_libiminuit.pyx":1234
 *             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_Contains(__pyx_v_k, ((PyObject *)__pyx_v_limit_param), Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_7) {

          /* "iminuit/_libiminuit.pyx":1235
 *                     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_Contains(__pyx_v_k, ((PyObject *)__pyx_v_error_param), Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_9 = __pyx_t_8;
        } else {
          __pyx_t_9 = __pyx_t_7;
        }
        __pyx_t_7 = __pyx_t_9;
      } else {
        __pyx_t_7 = __pyx_t_6;
      }
      __pyx_t_6 = __pyx_t_7;
    } else {
      __pyx_t_6 = __pyx_t_5;
    }
    if (__pyx_t_6) {

      /* "iminuit/_libiminuit.pyx":1238
 *                 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 = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k);
      __Pyx_GIVEREF(__pyx_v_k);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_parameters);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_parameters);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_parameters);
      __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_71), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_10));
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_10));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
      __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __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_10);
  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":42
 *     #standard stuff
 * 
 *     cdef readonly object fcn #:fcn             # <<<<<<<<<<<<<<
 *     #cdef readonly object varname #:variable names
 *     """this should work"""
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":45
 *     #cdef readonly object varname #:variable names
 *     """this should work"""
 *     cdef readonly object pos2var#:map variable position to varname             # <<<<<<<<<<<<<<
 *     """or this should work"""
 *     cdef readonly object var2pos#:map varname to position
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":47
 *     cdef readonly object pos2var#:map variable position to varname
 *     """or this should work"""
 *     cdef readonly object var2pos#:map varname to position             # <<<<<<<<<<<<<<
 * 
 *     #Initial settings
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":63
 * 
 *     #PyMinuit compatible field
 *     cdef public double errordef #:UP parameter             # <<<<<<<<<<<<<<
 *     cdef public double tol #:tolerance migrad stops when edm<0.0001*tol*UP
 *     cdef public unsigned int strategy #:0 fast 1 default 2 slow but accurate
 */

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 = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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));
  __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 = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->errordef = __pyx_t_1;

  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":64
 *     #PyMinuit compatible field
 *     cdef public double errordef #:UP parameter
 *     cdef public double tol #:tolerance migrad stops when edm<0.0001*tol*UP             # <<<<<<<<<<<<<<
 *     cdef public unsigned int strategy #:0 fast 1 default 2 slow but accurate
 *     #: 0: quiet 1: print stuff the end 2: 1+fit status during call
 */

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 = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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));
  __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->tol = __pyx_t_1;

  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":65
 *     cdef public double errordef #:UP parameter
 *     cdef public double tol #:tolerance migrad stops when edm<0.0001*tol*UP
 *     cdef public unsigned int strategy #:0 fast 1 default 2 slow but accurate             # <<<<<<<<<<<<<<
 *     #: 0: quiet 1: print stuff the end 2: 1+fit status during call
 *     #: yes I know the case is wrong but this is to keep it compatible with
 */

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 = PyLong_FromUnsignedLong(__pyx_v_self->strategy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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));
  __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_AsUnsignedInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->strategy = __pyx_t_1;

  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":69
 *     #: yes I know the case is wrong but this is to keep it compatible with
 *     #: PyMinuit
 *     cdef public print_level             # <<<<<<<<<<<<<<
 *     #: raise runtime error if function evaluate to nan
 *     cdef readonly bint throw_nan
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __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));
  __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;

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

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":71
 *     cdef public print_level
 *     #: raise runtime error if function evaluate to nan
 *     cdef readonly bint throw_nan             # <<<<<<<<<<<<<<
 * 
 *     #PyMinuit Compatible interface
 */

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 = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":74
 * 
 *     #PyMinuit Compatible interface
 *     cdef readonly object parameters#:tuple of parameter name(correct order)             # <<<<<<<<<<<<<<
 *     cdef readonly object args#:tuple of values
 *     cdef readonly object values#:map varname -> value
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":75
 *     #PyMinuit Compatible interface
 *     cdef readonly object parameters#:tuple of parameter name(correct order)
 *     cdef readonly object args#:tuple of values             # <<<<<<<<<<<<<<
 *     cdef readonly object values#:map varname -> value
 *     cdef readonly object errors#:map varname -> parabolic error
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":76
 *     cdef readonly object parameters#:tuple of parameter name(correct order)
 *     cdef readonly object args#:tuple of values
 *     cdef readonly object values#:map varname -> value             # <<<<<<<<<<<<<<
 *     cdef readonly object errors#:map varname -> parabolic error
 *     cdef readonly object covariance#:map (v1,v2)->covariance
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":77
 *     cdef readonly object args#:tuple of values
 *     cdef readonly object values#:map varname -> value
 *     cdef readonly object errors#:map varname -> parabolic error             # <<<<<<<<<<<<<<
 *     cdef readonly object covariance#:map (v1,v2)->covariance
 *     cdef readonly double fval#:last value of fcn
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":78
 *     cdef readonly object values#:map varname -> value
 *     cdef readonly object errors#:map varname -> parabolic error
 *     cdef readonly object covariance#:map (v1,v2)->covariance             # <<<<<<<<<<<<<<
 *     cdef readonly double fval#:last value of fcn
 *     cdef readonly int ncalls#:number of fcn call of last migrad/minos/hesse
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":79
 *     cdef readonly object errors#:map varname -> parabolic error
 *     cdef readonly object covariance#:map (v1,v2)->covariance
 *     cdef readonly double fval#:last value of fcn             # <<<<<<<<<<<<<<
 *     cdef readonly int ncalls#:number of fcn call of last migrad/minos/hesse
 *     cdef readonly double edm#Estimate distance to minimum
 */

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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":80
 *     cdef readonly object covariance#:map (v1,v2)->covariance
 *     cdef readonly double fval#:last value of fcn
 *     cdef readonly int ncalls#:number of fcn call of last migrad/minos/hesse             # <<<<<<<<<<<<<<
 *     cdef readonly double edm#Estimate distance to minimum
 *     #:minos error ni a funny map from
 */

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 = PyInt_FromLong(__pyx_v_self->ncalls); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":81
 *     cdef readonly double fval#:last value of fcn
 *     cdef readonly int ncalls#:number of fcn call of last migrad/minos/hesse
 *     cdef readonly double edm#Estimate distance to minimum             # <<<<<<<<<<<<<<
 *     #:minos error ni a funny map from
 *     #:(vname,direction)->error
 */

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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __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;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":85
 *     #:(vname,direction)->error
 *     #:direction is 1.0 for positive error and -1.0 for negative error
 *     cdef readonly object merrors             # <<<<<<<<<<<<<<
 *     #:global correlation coefficient
 *     cdef readonly object gcc
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":87
 *     cdef readonly object merrors
 *     #:global correlation coefficient
 *     cdef readonly object gcc             # <<<<<<<<<<<<<<
 *     #and some extra
 *     #:map of
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":96
 *     #:user can just use python keyword expansion to use all the argument like
 *     #:Minuit(fcn,**fitargs)
 *     cdef public object fitarg             # <<<<<<<<<<<<<<
 *     cdef readonly object narg#: number of arguments
 *     #: map vname-> struct with various minos error calcumation information
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __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));
  __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;

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

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":97
 *     #:Minuit(fcn,**fitargs)
 *     cdef public object fitarg
 *     cdef readonly object narg#: number of arguments             # <<<<<<<<<<<<<<
 *     #: map vname-> struct with various minos error calcumation information
 *     cdef public object merrors_struct
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":99
 *     cdef readonly object narg#: number of arguments
 *     #: map vname-> struct with various minos error calcumation information
 *     cdef public object merrors_struct             # <<<<<<<<<<<<<<
 *     cdef public object frontend
 * 
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __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));
  __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;

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

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "iminuit/_libiminuit.pyx":100
 *     #: map vname-> struct with various minos error calcumation information
 *     cdef public object merrors_struct
 *     cdef public object frontend             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, fcn,
 */

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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __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));
  __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;

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

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.from_py":12
 * 
 * @cname("__pyx_convert_string_from_py_")
 * cdef string __pyx_convert_string_from_py_(object o) except *:             # <<<<<<<<<<<<<<
 *     return string(<char*>o, len(o))
 * 
 */

static std::string __pyx_convert_string_from_py_(PyObject *__pyx_v_o) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_", 0);

  /* "string.from_py":13
 * @cname("__pyx_convert_string_from_py_")
 * cdef string __pyx_convert_string_from_py_(object o) except *:
 *     return string(<char*>o, len(o))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyBytes_AsString(__pyx_v_o); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = std::string(((char *)__pyx_t_1), __pyx_t_2);
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.from_py":42
 * 
 * @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":44
 * 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 (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[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && 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[3]; __pyx_lineno = 44; __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[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      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[3]; __pyx_lineno = 44; __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[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_item);
    __pyx_v_item = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "vector.from_py":45
 *     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_(__pyx_v_item); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_v.push_back(__pyx_t_5);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":46
 *     for item in o:
 *         v.push_back(X_from_py(item))
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  goto __pyx_L0;
  __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":176
 * 
 * @cname("__pyx_convert_pair_to_py_double____double")
 * cdef object __pyx_convert_pair_to_py_double____double(pair[X,Y]& p):             # <<<<<<<<<<<<<<
 *     return X_to_py(p.first), Y_to_py(p.second)
 * 
 */

static PyObject *__pyx_convert_pair_to_py_double____double(const std::pair<double,double> &__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":177
 * @cname("__pyx_convert_pair_to_py_double____double")
 * cdef object __pyx_convert_pair_to_py_double____double(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[4]; __pyx_lineno = 177; __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[4]; __pyx_lineno = 177; __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[4]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __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("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":59
 * 
 * @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":60
 * @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[5]; __pyx_lineno = 60; __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[5]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __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_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 = (*t->tp_alloc)(t, 0);
  if (!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;
  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);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(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);
  PyObject_GC_Track(o);
  (*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) {
  struct __pyx_obj_7iminuit_11_libiminuit_Minuit *p = (struct __pyx_obj_7iminuit_11_libiminuit_Minuit *)o;
  PyObject* tmp;
  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[] = {
  {__Pyx_NAMESTR("migrad"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_3migrad, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_2migrad)},
  {__Pyx_NAMESTR("hesse"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_5hesse, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_4hesse)},
  {__Pyx_NAMESTR("minos"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_7minos, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_6minos)},
  {__Pyx_NAMESTR("matrix"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_9matrix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_8matrix)},
  {__Pyx_NAMESTR("print_matrix"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_11print_matrix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_10print_matrix)},
  {__Pyx_NAMESTR("latex_matrix"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_13latex_matrix, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_12latex_matrix)},
  {__Pyx_NAMESTR("np_matrix"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_15np_matrix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_14np_matrix)},
  {__Pyx_NAMESTR("is_fixed"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_17is_fixed, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_16is_fixed)},
  {__Pyx_NAMESTR("_prepare_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_19_prepare_param, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_18_prepare_param)},
  {__Pyx_NAMESTR("print_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_21print_param, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_20print_param)},
  {__Pyx_NAMESTR("latex_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_23latex_param, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_22latex_param)},
  {__Pyx_NAMESTR("_prepare_initial_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_25_prepare_initial_param, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_24_prepare_initial_param)},
  {__Pyx_NAMESTR("print_initial_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_27print_initial_param, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_26print_initial_param)},
  {__Pyx_NAMESTR("latex_initial_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_29latex_initial_param, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_28latex_initial_param)},
  {__Pyx_NAMESTR("print_fmin"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_31print_fmin, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_30print_fmin)},
  {__Pyx_NAMESTR("print_all_minos"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_33print_all_minos, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_32print_all_minos)},
  {__Pyx_NAMESTR("set_up"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_35set_up, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_34set_up)},
  {__Pyx_NAMESTR("set_errordef"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_37set_errordef, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_36set_errordef)},
  {__Pyx_NAMESTR("set_strategy"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_39set_strategy, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_38set_strategy)},
  {__Pyx_NAMESTR("set_print_level"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_41set_print_level, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_40set_print_level)},
  {__Pyx_NAMESTR("get_fmin"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_43get_fmin, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_42get_fmin)},
  {__Pyx_NAMESTR("get_param_states"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_45get_param_states, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_44get_param_states)},
  {__Pyx_NAMESTR("get_merrors"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_47get_merrors, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_46get_merrors)},
  {__Pyx_NAMESTR("get_initial_param_state"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_49get_initial_param_state, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_48get_initial_param_state)},
  {__Pyx_NAMESTR("get_num_call_fcn"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_51get_num_call_fcn, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_50get_num_call_fcn)},
  {__Pyx_NAMESTR("migrad_ok"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_53migrad_ok, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_52migrad_ok)},
  {__Pyx_NAMESTR("matrix_accurate"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_55matrix_accurate, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_54matrix_accurate)},
  {__Pyx_NAMESTR("list_of_fixed_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_57list_of_fixed_param, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_56list_of_fixed_param)},
  {__Pyx_NAMESTR("list_of_vary_param"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_59list_of_vary_param, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_58list_of_vary_param)},
  {__Pyx_NAMESTR("is_clean_state"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_61is_clean_state, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_60is_clean_state)},
  {__Pyx_NAMESTR("pedantic"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_65pedantic, METH_O, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_64pedantic)},
  {__Pyx_NAMESTR("mnprofile"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_67mnprofile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_66mnprofile)},
  {__Pyx_NAMESTR("draw_mnprofile"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_69draw_mnprofile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_68draw_mnprofile)},
  {__Pyx_NAMESTR("profile"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_71profile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_70profile)},
  {__Pyx_NAMESTR("draw_profile"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_73draw_profile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_72draw_profile)},
  {__Pyx_NAMESTR("contour"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_75contour, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_74contour)},
  {__Pyx_NAMESTR("mncontour"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_77mncontour, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_76mncontour)},
  {__Pyx_NAMESTR("mncontour_grid"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_79mncontour_grid, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_78mncontour_grid)},
  {__Pyx_NAMESTR("draw_mncontour"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_81draw_mncontour, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_80draw_mncontour)},
  {__Pyx_NAMESTR("draw_contour"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_83draw_contour, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_82draw_contour)},
  {__Pyx_NAMESTR("_auto_frontend"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_85_auto_frontend, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7iminuit_11_libiminuit_6Minuit_84_auto_frontend)},
  {__Pyx_NAMESTR("_check_extra_args"), (PyCFunction)__pyx_pw_7iminuit_11_libiminuit_6Minuit_87_check_extra_args, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__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_DOCSTR(__pyx_k_72), 0},
  {(char *)"pos2var", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_pos2var, 0, __Pyx_DOCSTR(__pyx_k_73), 0},
  {(char *)"var2pos", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_var2pos, 0, __Pyx_DOCSTR(__pyx_k_74), 0},
  {(char *)"errordef", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_errordef, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_errordef, __Pyx_DOCSTR(__pyx_k_75), 0},
  {(char *)"tol", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_tol, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_tol, __Pyx_DOCSTR(__pyx_k_76), 0},
  {(char *)"strategy", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_strategy, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_strategy, __Pyx_DOCSTR(__pyx_k_77), 0},
  {(char *)"print_level", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_print_level, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_print_level, __Pyx_DOCSTR(__pyx_k_78), 0},
  {(char *)"throw_nan", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_throw_nan, 0, __Pyx_DOCSTR(__pyx_k_79), 0},
  {(char *)"parameters", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_parameters, 0, __Pyx_DOCSTR(__pyx_k_80), 0},
  {(char *)"args", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_args, 0, __Pyx_DOCSTR(__pyx_k_81), 0},
  {(char *)"values", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_values, 0, __Pyx_DOCSTR(__pyx_k_82), 0},
  {(char *)"errors", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_errors, 0, __Pyx_DOCSTR(__pyx_k_83), 0},
  {(char *)"covariance", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_covariance, 0, __Pyx_DOCSTR(__pyx_k_84), 0},
  {(char *)"fval", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_fval, 0, __Pyx_DOCSTR(__pyx_k_85), 0},
  {(char *)"ncalls", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_ncalls, 0, __Pyx_DOCSTR(__pyx_k_86), 0},
  {(char *)"edm", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_edm, 0, __Pyx_DOCSTR(__pyx_k_87), 0},
  {(char *)"merrors", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_merrors, 0, __Pyx_DOCSTR(__pyx_k_88), 0},
  {(char *)"gcc", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_gcc, 0, __Pyx_DOCSTR(__pyx_k_89), 0},
  {(char *)"fitarg", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_fitarg, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_fitarg, __Pyx_DOCSTR(__pyx_k_90), 0},
  {(char *)"narg", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_narg, 0, __Pyx_DOCSTR(__pyx_k_91), 0},
  {(char *)"merrors_struct", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_merrors_struct, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_merrors_struct, __Pyx_DOCSTR(__pyx_k_92), 0},
  {(char *)"frontend", __pyx_getprop_7iminuit_11_libiminuit_6Minuit_frontend, __pyx_setprop_7iminuit_11_libiminuit_6Minuit_frontend, __Pyx_DOCSTR(__pyx_k_93), 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Minuit = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Minuit = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Minuit = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Minuit = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit_Minuit = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Minuit, /*tp_as_number*/
  &__pyx_tp_as_sequence_Minuit, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Minuit, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Minuit, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct____init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *)o);
  p->__pyx_v_args = 0;
  p->__pyx_v_self = 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);
  PyObject_GC_Track(o);
  (*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) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *p = (struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct____init__ *)o;
  PyObject* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct____init__[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct____init__ = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct____init__ = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct____init__ = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct____init__ = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct____init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct____init__, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct____init__, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct____init__, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct____init__, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct____init__, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_k = 0;
  p->__pyx_t_0 = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_1_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_1_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_1_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_1_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_1_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_1_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_1_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_1_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_1_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

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 = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix *)o);
  new((void*)&(p->__pyx_v_cov)) MnUserCovariance();
  p->__pyx_v_params = 0;
  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);
  p->__pyx_v_cov.MnUserCovariance::~MnUserCovariance();
  Py_CLEAR(p->__pyx_v_params);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  tmp = ((PyObject*)p->__pyx_v_params);
  p->__pyx_v_params = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_2_matrix = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_2_matrix = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_2_matrix = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_2_matrix = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_2_matrix, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_2_matrix, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_2_matrix, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_2_matrix, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_2_matrix, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_genexpr = 0;
  p->__pyx_v_iv2 = 0;
  p->__pyx_v_v2 = 0;
  p->__pyx_t_0 = 0;
  p->__pyx_t_1 = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_3_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_3_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_3_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_3_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_3_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_3_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_3_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_3_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_3_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_iv1 = 0;
  p->__pyx_v_v1 = 0;
  p->__pyx_t_0 = 0;
  p->__pyx_t_1 = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_4_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_4_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_4_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_4_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_4_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_4_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_4_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_4_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_4_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_genexpr = 0;
  p->__pyx_v_iv2 = 0;
  p->__pyx_v_v2 = 0;
  p->__pyx_t_0 = 0;
  p->__pyx_t_1 = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_5_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_5_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_5_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_5_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_5_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_5_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_5_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_5_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_5_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_iv1 = 0;
  p->__pyx_v_v1 = 0;
  p->__pyx_t_0 = 0;
  p->__pyx_t_1 = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_6_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_6_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_6_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_6_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_6_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_6_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_6_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_6_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_6_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile *)o);
  p->__pyx_v_bins = 0;
  p->__pyx_v_binstep = 0;
  p->__pyx_v_bound = 0;
  p->__pyx_v_results = 0;
  p->__pyx_v_themin = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_7_mnprofile = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_7_mnprofile = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_7_mnprofile = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_7_mnprofile = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_7_mnprofile, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_7_mnprofile, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_7_mnprofile, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_7_mnprofile, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_7_mnprofile, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_i = 0;
  p->__pyx_t_0 = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_8_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_8_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_8_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_8_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_8_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_8_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_8_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_8_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_8_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_x = 0;
  p->__pyx_t_0 = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_9_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_9_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_9_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_9_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_9_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_9_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_9_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_9_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_9_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_10_profile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_10_profile *)o);
  p->__pyx_v_bins = 0;
  p->__pyx_v_binstep = 0;
  p->__pyx_v_bound = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_10_profile[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_10_profile = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_10_profile = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_10_profile = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_10_profile = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_10_profile = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_10_profile, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_10_profile, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_10_profile, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_10_profile, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_10_profile, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_i = 0;
  p->__pyx_t_0 = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_11_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_11_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_11_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_11_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_11_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_11_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_11_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_11_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_11_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_12_contour(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_12_contour *)o);
  p->__pyx_v_x_bins = 0;
  p->__pyx_v_x_binstep = 0;
  p->__pyx_v_x_bound = 0;
  p->__pyx_v_y_bins = 0;
  p->__pyx_v_y_binstep = 0;
  p->__pyx_v_y_bound = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_12_contour[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_12_contour = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_12_contour = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_12_contour = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_12_contour = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_12_contour = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_12_contour, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_12_contour, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_12_contour, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_12_contour, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_12_contour, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_i = 0;
  p->__pyx_t_0 = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_13_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_13_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_13_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_13_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_13_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_13_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_13_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_13_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_13_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_i = 0;
  p->__pyx_t_0 = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  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 PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_14_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_14_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_14_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_14_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_14_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_14_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_14_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_14_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_14_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

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) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args *)o);
  p->__pyx_v_parameters = 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);
  PyObject_GC_Track(o);
  (*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) {
  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* tmp;
  tmp = ((PyObject*)p->__pyx_v_parameters);
  p->__pyx_v_parameters = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_15__check_extra_args = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_15__check_extra_args = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_15__check_extra_args = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_15__check_extra_args = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_15__check_extra_args, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_15__check_extra_args, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_15__check_extra_args, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_15__check_extra_args, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_15__check_extra_args, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_p = 0;
  p->__pyx_t_0 = 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);
  Py_CLEAR(p->__pyx_t_0);
  PyObject_GC_Track(o);
  (*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;
  }
  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_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* tmp;
  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);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_16_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_16_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_16_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_16_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_16_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_16_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_16_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_16_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_16_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_p = 0;
  p->__pyx_t_0 = 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);
  Py_CLEAR(p->__pyx_t_0);
  PyObject_GC_Track(o);
  (*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;
  }
  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_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* tmp;
  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);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_17_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_17_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_17_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_17_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_17_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_17_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_17_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_17_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_17_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_p = 0;
  p->__pyx_t_0 = 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);
  Py_CLEAR(p->__pyx_t_0);
  PyObject_GC_Track(o);
  (*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;
  }
  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_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* tmp;
  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);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_18_genexpr = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_18_genexpr = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_18_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_18_genexpr = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("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*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_18_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_18_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_18_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_18_genexpr, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|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*/
  __pyx_methods_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

static char* __pyx_import_star_type_names[] = {
  "ContoursError",
  "__pyx_scope_struct_16_genexpr",
  "__pyx_scope_struct_8_genexpr",
  "__pyx_scope_struct_13_genexpr",
  "MnUserParameterState",
  "__pyx_scope_struct_12_contour",
  "MinuitParameter",
  "__pyx_scope_struct_4_genexpr",
  "__pyx_scope_struct_6_genexpr",
  "__pyx_scope_struct_9_genexpr",
  "X",
  "__pyx_scope_struct____init__",
  "Minuit",
  "bool",
  "MnGlobalCorrelationCoeff",
  "MnStrategy",
  "__pyx_scope_struct_10_profile",
  "string",
  "__pyx_scope_struct_3_genexpr",
  "auto_ptr",
  "MnMigrad",
  "MinosError",
  "pair",
  "__pyx_scope_struct_2_matrix",
  "__pyx_scope_struct_14_genexpr",
  "MnUserCovariance",
  "FunctionMinimum",
  "__pyx_scope_struct_5_genexpr",
  "__pyx_scope_struct_18_genexpr",
  "MnMinos",
  "__pyx_scope_struct_11_genexpr",
  "__pyx_scope_struct_7_mnprofile",
  "MnHesse",
  "__pyx_scope_struct_15__check_extra_args",
  "PythonFCN",
  "vector",
  "MnApplication",
  "Y",
  "FCNBase",
  "__pyx_scope_struct_1_genexpr",
  "__pyx_opt_args_7MnHesse_call",
  "MnContours",
  "__pyx_scope_struct_17_genexpr",
  0
};

static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
  char** type_name = __pyx_import_star_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;
}


/* import_all_from is an unexposed function from ceval.c */

static int
__Pyx_import_all_from(PyObject *locals, PyObject *v)
{
    PyObject *all = __Pyx_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; /* Unexpected error */
        PyErr_Clear();
        dict = __Pyx_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
    __Pyx_NAMESTR("_libiminuit"),
    0, /* 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_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 1},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_n_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 1},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_n_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 1},
  {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
  {&__pyx_n_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 1},
  {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
  {&__pyx_n_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 1},
  {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
  {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
  {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
  {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
  {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
  {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0},
  {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
  {&__pyx_kp_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 0},
  {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
  {&__pyx_n_s_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 1, 1},
  {&__pyx_n_s__ConsoleFrontend, __pyx_k__ConsoleFrontend, sizeof(__pyx_k__ConsoleFrontend), 0, 0, 1, 1},
  {&__pyx_n_s__HESSE, __pyx_k__HESSE, sizeof(__pyx_k__HESSE), 0, 0, 1, 1},
  {&__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__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_s__MIGRAD, __pyx_k__MIGRAD, sizeof(__pyx_k__MIGRAD), 0, 0, 1, 1},
  {&__pyx_n_s__MINOS, __pyx_k__MINOS, sizeof(__pyx_k__MINOS), 0, 0, 1, 1},
  {&__pyx_n_s__Minuit, __pyx_k__Minuit, sizeof(__pyx_k__Minuit), 0, 0, 1, 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_n_s__RunTimeError, __pyx_k__RunTimeError, sizeof(__pyx_k__RunTimeError), 0, 0, 1, 1},
  {&__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_n_s__Struct, __pyx_k__Struct, sizeof(__pyx_k__Struct), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s____IPYTHON__, __pyx_k____IPYTHON__, sizeof(__pyx_k____IPYTHON__), 0, 0, 1, 1},
  {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 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___check_extra_args, __pyx_k___check_extra_args, sizeof(__pyx_k___check_extra_args), 0, 0, 1, 1},
  {&__pyx_n_s___plotting, __pyx_k___plotting, sizeof(__pyx_k___plotting), 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__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__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__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_s__d, __pyx_k__d, sizeof(__pyx_k__d), 0, 0, 1, 1},
  {&__pyx_n_s__default_errordef, __pyx_k__default_errordef, sizeof(__pyx_k__default_errordef), 0, 0, 1, 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__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_s__error_, __pyx_k__error_, sizeof(__pyx_k__error_), 0, 0, 1, 1},
  {&__pyx_n_s__errordef, __pyx_k__errordef, sizeof(__pyx_k__errordef), 0, 0, 1, 1},
  {&__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_s__fix_, __pyx_k__fix_, sizeof(__pyx_k__fix_), 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__fval, __pyx_k__fval, sizeof(__pyx_k__fval), 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_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_posdef_covar, __pyx_k__has_posdef_covar, sizeof(__pyx_k__has_posdef_covar), 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__hesse_failed, __pyx_k__hesse_failed, sizeof(__pyx_k__hesse_failed), 0, 0, 1, 1},
  {&__pyx_n_s__iminuit_warnings, __pyx_k__iminuit_warnings, sizeof(__pyx_k__iminuit_warnings), 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_s__latex, __pyx_k__latex, sizeof(__pyx_k__latex), 0, 0, 1, 1},
  {&__pyx_n_s__limit_, __pyx_k__limit_, sizeof(__pyx_k__limit_), 0, 0, 1, 1},
  {&__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__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__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_n_s__mnprofile, __pyx_k__mnprofile, sizeof(__pyx_k__mnprofile), 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__pprint, __pyx_k__pprint, sizeof(__pyx_k__pprint), 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__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_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_n_s__subtract_min, __pyx_k__subtract_min, sizeof(__pyx_k__subtract_min), 0, 0, 1, 1},
  {&__pyx_n_s__text, __pyx_k__text, sizeof(__pyx_k__text), 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__util, __pyx_k__util, sizeof(__pyx_k__util), 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_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_round = __Pyx_GetName(__pyx_b, __pyx_n_s__round); if (!__pyx_builtin_round) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeWarning = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_min = __Pyx_GetName(__pyx_b, __pyx_n_s__min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_NameError = __Pyx_GetName(__pyx_b, __pyx_n_s__NameError); if (!__pyx_builtin_NameError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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":233
 *             if not callable(default_errordef):
 *                 if pedantic:
 *                     warn(InitialParamWarning(             # <<<<<<<<<<<<<<
 *                         'errordef is not given. Default to 1.'))
 *                 self.errordef = 1.0
 */
  __pyx_k_tuple_7 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_7);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));

  /* "iminuit/_libiminuit.pyx":307
 *         cdef MnStrategy* strat = NULL
 * 
 *         if self.print_level>0: self.frontend.print_banner('MIGRAD')             # <<<<<<<<<<<<<<
 * 
 *         if not resume or self.is_clean_state():
 */
  __pyx_k_tuple_9 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__MIGRAD)); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_9);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));

  /* "iminuit/_libiminuit.pyx":366
 *         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_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__HESSE)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_10);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));

  /* "iminuit/_libiminuit.pyx":368
 *         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_k_tuple_12 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_11)); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_12);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));

  /* "iminuit/_libiminuit.pyx":404
 *         """
 *         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_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_16);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));

  /* "iminuit/_libiminuit.pyx":412
 *         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_k_tuple_17 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__MINOS)); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_17);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));

  /* "iminuit/_libiminuit.pyx":414
 *         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_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_19);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));

  /* "iminuit/_libiminuit.pyx":428
 *             if vname in fixed_param:
 *                 if var is not None:#specifying vname but it's fixed
 *                     warnings.warn(RuntimeWarning(             # <<<<<<<<<<<<<<
 *                         'Specified variable name for minos is set to fixed'))
 *                     return None
 */
  __pyx_k_tuple_22 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_21)); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_22);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));

  /* "iminuit/_libiminuit.pyx":448
 *         """return error/correlation matrix in tuple or tuple 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_k_tuple_26 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_25)); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_26);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

  /* "iminuit/_libiminuit.pyx":450
 *             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_k_tuple_28 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_27)); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_28);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28));

  /* "iminuit/_libiminuit.pyx":452
 *             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_k_tuple_30 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_29)); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_30);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));

  /* "iminuit/_libiminuit.pyx":498
 *         """check if variable *vname* is (initialy) 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_k_tuple_33 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_32)); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_33);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33));

  /* "iminuit/_libiminuit.pyx":571
 *         #                               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_k_tuple_36 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_35)); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_36);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));

  /* "iminuit/_libiminuit.pyx":758
 *         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_k_tuple_46 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_45)); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_46);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));

  /* "iminuit/_libiminuit.pyx":767
 * 
 *         values = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 *         results = array.array('d')             # <<<<<<<<<<<<<<
 *         migrad_status = []
 *         for i, v in enumerate(values):
 */
  __pyx_k_tuple_47 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__d)); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_47);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));

  /* "iminuit/_libiminuit.pyx":866
 *         #center value
 *         bins = array.array('d',(bound[0]+binstep*i for i in xrange(bins)))
 *         ret = array.array('d')             # <<<<<<<<<<<<<<
 *         pos = self.var2pos[vname]
 *         if subtract_min and self.cfmin is NULL:
 */
  __pyx_k_tuple_54 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__d)); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_54);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));

  /* "iminuit/_libiminuit.pyx":869
 *         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_k_tuple_56 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_55)); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_56);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));

  /* "iminuit/_libiminuit.pyx":984
 * 
 *         if subtract_min and self.cfmin is NULL:
 *             raise RunTimeError("Request for minimization "             # <<<<<<<<<<<<<<
 *                 "subtraction but no minimization has been done. "
 *                 "Run migrad first.")
 */
  __pyx_k_tuple_61 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_55)); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_61);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));

  /* "iminuit/_libiminuit.pyx":992
 *         for yy in y_val:
 *             args[y_pos] = yy
 *             tmp = array.array('d')             # <<<<<<<<<<<<<<
 *             for xx in x_val:
 *                 args[x_pos] = xx
 */
  __pyx_k_tuple_62 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__d)); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_62);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));

  /* "iminuit/_libiminuit.pyx":1031
 *         """
 *         if self.pyfcn is NULL or self.cfmin is NULL:
 *             raise ValueError('Run Migrad first')             # <<<<<<<<<<<<<<
 * 
 *         cdef unsigned int ix = self.var2pos[x]
 */
  __pyx_k_tuple_65 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_65);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));

  /* "iminuit/_libiminuit.pyx":1039
 * 
 *         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_k_tuple_67 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_66)); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_67);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));
  __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_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;};
  __pyx_int_999 = PyInt_FromLong(999); if (unlikely(!__pyx_int_999)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_999 = PyInt_FromLong(-999); if (unlikely(!__pyx_int_neg_999)) {__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;
  __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_Generator_USED
  if (__pyx_Generator_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(__Pyx_NAMESTR("_libiminuit"), __pyx_methods, 0, 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;}
  #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
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__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 (__Pyx_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 (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_iminuit___libiminuit) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__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 = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_7iminuit_11_libiminuit_Minuit, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __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 = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Minuit", (PyObject *)&__pyx_type_7iminuit_11_libiminuit_Minuit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __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 = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr = &__pyx_type_7iminuit_11_libiminuit___pyx_scope_struct_18_genexpr;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "iminuit/_libiminuit.pyx":2
 * #cython: embedsignature=True
 * __all__ = ['Minuit']             # <<<<<<<<<<<<<<
 * from libcpp.vector cimport vector
 * from libcpp.string cimport string
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Minuit));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Minuit));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Minuit));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":7
 * from cpython cimport exc
 * #from libcpp import bool
 * from util import *             # <<<<<<<<<<<<<<
 * from warnings import warn
 * from cython.operator cimport dereference as deref
 */
  __pyx_t_1 = PyList_New(1); 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);
  __Pyx_INCREF(((PyObject *)__pyx_n_s_94));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s_94));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_94));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__util), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (__pyx_import_star(__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "iminuit/_libiminuit.pyx":8
 * #from libcpp import bool
 * from util import *
 * from warnings import warn             # <<<<<<<<<<<<<<
 * from cython.operator cimport dereference as deref
 * from libc.math cimport sqrt
 */
  __pyx_t_2 = PyList_New(1); 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_INCREF(((PyObject *)__pyx_n_s__warn));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__warn));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__warn));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), ((PyObject *)__pyx_t_2), -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_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warn);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__warn);
    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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__warn, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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":11
 * from cython.operator cimport dereference as deref
 * from libc.math cimport sqrt
 * from pprint import pprint             # <<<<<<<<<<<<<<
 * from ConsoleFrontend import ConsoleFrontend
 * from iminuit_warnings import *
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pprint));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__pprint));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pprint));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__pprint), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__pprint);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__pprint);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pprint, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __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 libc.math cimport sqrt
 * from pprint import pprint
 * from ConsoleFrontend import ConsoleFrontend             # <<<<<<<<<<<<<<
 * from iminuit_warnings import *
 * from latex import LatexFactory
 */
  __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(((PyObject *)__pyx_n_s__ConsoleFrontend));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__ConsoleFrontend));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ConsoleFrontend));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__ConsoleFrontend), ((PyObject *)__pyx_t_2), -1); 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(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ConsoleFrontend);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__ConsoleFrontend);
    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 (PyObject_SetAttr(__pyx_m, __pyx_n_s__ConsoleFrontend, __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 pprint import pprint
 * from ConsoleFrontend import ConsoleFrontend
 * from iminuit_warnings import *             # <<<<<<<<<<<<<<
 * from latex import LatexFactory
 * import _plotting
 */
  __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(((PyObject *)__pyx_n_s_94));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s_94));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_94));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__iminuit_warnings), ((PyObject *)__pyx_t_1), -1); 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(((PyObject *)__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 ConsoleFrontend import ConsoleFrontend
 * from iminuit_warnings import *
 * from latex import LatexFactory             # <<<<<<<<<<<<<<
 * import _plotting
 * include "Lcg_Minuit.pxi"
 */
  __pyx_t_2 = PyList_New(1); 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(((PyObject *)__pyx_n_s__LatexFactory));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__LatexFactory));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__LatexFactory));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__latex), ((PyObject *)__pyx_t_2), -1); 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(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__LatexFactory);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__LatexFactory);
    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 (PyObject_SetAttr(__pyx_m, __pyx_n_s__LatexFactory, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":15
 * from iminuit_warnings import *
 * from latex import LatexFactory
 * import _plotting             # <<<<<<<<<<<<<<
 * include "Lcg_Minuit.pxi"
 * include "Minuit2Struct.pxi"
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s___plotting), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___plotting, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":18
 * include "Lcg_Minuit.pxi"
 * include "Minuit2Struct.pxi"
 * import array             # <<<<<<<<<<<<<<
 * #our wrapper
 * cdef extern from "PythonFCN.h":
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__array), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__array, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":103
 * 
 *     def __init__(self, fcn,
 *             throw_nan=False, pedantic=True,             # <<<<<<<<<<<<<<
 *             frontend=None, forced_parameters=None, print_level=1,
 *             errordef=None, **kwds):
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_4 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_5 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":272
 * 
 * 
 *     def migrad(self, int ncall=10000, resume=True, int nsplit=1):             # <<<<<<<<<<<<<<
 *         """Run migrad.
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_8 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":386
 * 
 * 
 *     def minos(self, var = None, sigma = 1., unsigned int maxcall=1000):             # <<<<<<<<<<<<<<
 *         """Run minos for parameter *var*
 * 
 */
  __pyx_t_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_14 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":445
 * 
 * 
 *     def matrix(self, correlation=False, skip_fixed=True):             # <<<<<<<<<<<<<<
 *         """return error/correlation matrix in tuple or tuple format."""
 *         if self.last_upst is NULL:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_23 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_24 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":488
 * 
 * 
 *     def np_matrix(self, correlation=False):             # <<<<<<<<<<<<<<
 *         """return error/correlation matrix in numpy array format."""
 *         import numpy as np
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_31 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":730
 * 
 *     def mnprofile(self, vname, bins=30, bound=2,
 *             subtract_min=False):             # <<<<<<<<<<<<<<
 *         """calculate minos profile around specify range ie. Migrad results
 *         with **vname** fixed at various places within **bound**
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_43 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":789
 * 
 * 
 *     def draw_mnprofile(self, vname, bins=30, bound=2, subtract_min=False,             # <<<<<<<<<<<<<<
 *         band=True, text=True):
 *         """Draw minos profile around specify range ie. Migrad results
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_50 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":790
 * 
 *     def draw_mnprofile(self, vname, bins=30, bound=2, subtract_min=False,
 *         band=True, text=True):             # <<<<<<<<<<<<<<
 *         """Draw minos profile around specify range ie. Migrad results
 *         with **vname** fixed at various places within **bound**
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); 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_k_51 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); 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_k_52 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":829
 * 
 * 
 *     def profile(self, vname, bins=100, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """calculate cost function profile around specify range.
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_53 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":880
 * 
 *     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
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_57 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_58 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_59 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":913
 *         return x, y
 * 
 *     def contour(self, x, y, bins=20, bound=2, args=None, subtract_min=False):             # <<<<<<<<<<<<<<
 *         """2D countour scan.
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_60 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1001
 * 
 * 
 *     def mncontour(self, x, y, int numpoints=20, sigma=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Minos contour scan. A proper n **sigma** contour scan. This is line
 */
  __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_63 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1060
 * 
 *     def mncontour_grid(self, x, y, bins=100, nsigma=2, numpoints=20,
 *                         int sigma_res=4, edges=False):             # <<<<<<<<<<<<<<
 *         """
 *         compute gridded minos contour.
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_68 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1128
 * 
 *     def draw_contour(self, x, y, bins=20, bound=2, args=None,
 *                      show_sigma=False):             # <<<<<<<<<<<<<<
 *         """
 *         Convenient wrapper for drawing contour. The argument is the same as
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_69 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "iminuit/_libiminuit.pyx":1
 * #cython: embedsignature=True             # <<<<<<<<<<<<<<
 * __all__ = ['Minuit']
 * from libcpp.vector cimport vector
 */
  __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(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "vector.to_py":59
 * 
 * @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())]
 * 
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    __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 /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

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,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        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,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" 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);
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = PyObject_GetAttr(o, n);
    if (!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%s 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 PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#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;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            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;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
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 *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 = PyEval_CallObject(type, args);
        Py_DECREF(args);
        if (!owned_instance)
            goto bad;
        value = owned_instance;
        if (!PyExceptionInstance_Check(value)) {
            PyErr_Format(PyExc_TypeError,
                         "calling %R should have returned an instance of "
                         "BaseException, not %R",
                         type, Py_TYPE(value));
            goto bad;
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause && cause != Py_None) {
        PyObject *fixed_cause;
        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) {
        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);
        }
    }
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 CPYTHON_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,
        "%s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

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 (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    *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;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (DECREF may run arbitrary code). */
    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 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 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 = 0;
    py_import = __Pyx_GetAttrString(__pyx_b, "__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_VERSION_HEX >= 0x02050000
    {
        #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; /* try absolute import on failure */
        }
        #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
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #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 void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

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

static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Generator_Close(PyObject *self);
static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_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 (unlikely(et != PyExc_StopIteration) &&
            unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            return 0;
        }
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_IsInstance(ev, 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 = PyObject_GetAttrString(ev, "args");
        Py_DECREF(ev);
        if (likely(args)) {
            value = PyObject_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_Generator_ExceptionClear(__pyx_GeneratorObject *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_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *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
        /* Generators always return to their most recent caller, not
         * necessarily their creator. */
        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_Generator_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
        /* Don't keep the reference to f_back any longer than necessary.  It
         * may keep a chain of frames alive or it could create a reference
         * cycle. */
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Generator_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Generator_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Generator_SendEx(gen, val);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Generator_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_Generator_FinishDelegation(gen);
    }
    return __Pyx_Generator_SendEx(gen, Py_None);
}
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Send(yf, value);
        } else {
            if (value == Py_None)
                ret = PyIter_Next(yf);
            else
                ret = PyObject_CallMethod(yf, (char*)"send", (char*)"O", value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Generator_FinishDelegation(gen);
    }
    return __Pyx_Generator_SendEx(gen, value);
}
static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Generator_Close(yf);
        if (!retval)
            return -1;
    } else {
        PyObject *meth;
        gen->is_running = 1;
        meth = PyObject_GetAttrString(yf, "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_Close(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Generator_CloseIter(gen, yf);
        __Pyx_Generator_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
#if PY_VERSION_HEX < 0x02050000
        PyErr_SetNone(PyExc_StopIteration);
#else
        PyErr_SetNone(PyExc_GeneratorExit);
#endif
    retval = __Pyx_Generator_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
#if PY_VERSION_HEX >= 0x02050000
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
#endif
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();      /* ignore these errors */
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) 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_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
#if PY_VERSION_HEX >= 0x02050000
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Generator_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Generator_Undelegate(gen);
            if (err < 0)
                return __Pyx_Generator_SendEx(gen, NULL);
            goto throw_here;
        }
#endif
        gen->is_running = 1;
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Throw(yf, args);
        } else {
            PyObject *meth = PyObject_GetAttrString(yf, "throw");
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Generator_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_Generator_FinishDelegation(gen);
        }
        return ret;
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Generator_SendEx(gen, NULL);
}
static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) 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_Generator_clear(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) 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);
    return 0;
}
static void __Pyx_Generator_dealloc(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    PyObject_GC_Track(self);
    if (gen->resume_label > 0) {
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
            return;                     /* resurrected.  :( */
    }
    PyObject_GC_UnTrack(self);
    __Pyx_Generator_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Generator_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    if (gen->resume_label <= 0)
        return ;
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Generator_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
    /* Undo the temporary resurrection; can't use DECREF here, it would
     * cause a recursive call.
     */
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0)
        return; /* this is the normal path out */
    /* close() resurrected it!  Make it look like the original Py_DECREF
     * never happened.
     */
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_FOR_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
     * we need to undo that. */
    _Py_DEC_REFTOTAL;
#endif
    /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
     * chain, so no more to do there.
     * If COUNT_ALLOCS, the original decref bumped tp_frees, and
     * _Py_NewReference bumped tp_allocs:  both of those need to be
     * undone.
     */
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
}
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running",
#if PY_VERSION_HEX >= 0x02060000
     T_BOOL,
#else
     T_BYTE,
#endif
     offsetof(__pyx_GeneratorObject, is_running),
     READONLY,
     NULL},
    {0, 0, 0, 0, 0}
};
static PyMethodDef __pyx_Generator_methods[] = {
    {__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
    {__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
    {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("generator"),         /*tp_name*/
    sizeof(__pyx_GeneratorObject),      /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#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_GC, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_Generator_traverse,   /*tp_traverse*/
    0,                                  /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */
    0,                                  /*tp_iter*/
    (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/
    __pyx_Generator_methods,            /*tp_methods*/
    __pyx_Generator_memberlist,         /*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*/
    0,                                  /*tp_new*/
    0,                                  /*tp_free*/
    0,                                  /*tp_is_gc*/
    0,                                  /*tp_bases*/
    0,                                  /*tp_mro*/
    0,                                  /*tp_cache*/
    0,                                  /*tp_subclasses*/
    0,                                  /*tp_weaklist*/
    __Pyx_Generator_del,                /*tp_del*/
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
};
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure) {
    __pyx_GeneratorObject *gen =
        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_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;
    PyObject_GC_Track(gen);
    return gen;
}
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    if (PyType_Ready(&__pyx_GeneratorType_type)) {
        return -1;
    }
    __pyx_GeneratorType = &__pyx_GeneratorType_type;
    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);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

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) / 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, 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,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __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,      /*int firstlineno,*/
        __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;
    PyObject *py_globals = 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_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*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);
}

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  /* Python 3+ has unicode identifiers */
        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 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_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  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_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (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 = 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) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
