/* Generated by Cython 0.21.2 */

#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 0
#else
#include "pyconfig.h"
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 1
#else
#define CYTHON_USE_PYLONG_INTERNALS 0
#endif
#endif
#endif
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_21_2"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#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_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
   a quiet NaN. */
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#ifdef __cplusplus
template<typename T>
void __Pyx_call_destructor(T* x) {
    x->~T();
}
#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__cypari_src__gen
#define __PYX_HAVE_API__cypari_src__gen
#include "stdlib.h"
#include "string.h"
#include "stdio.h"
#include "math.h"
#include "setjmp.h"
#include "pari/paricfg.h"
#include "wordsize.h"
#include "pari/pari.h"
#include "misc.h"
#include "pari/paripriv.h"
#include "pari_errors.h"
#include "signal.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
    (sizeof(type) > sizeof(Py_ssize_t) &&               \
          likely(v < (type)PY_SSIZE_T_MAX ||            \
                 v == (type)PY_SSIZE_T_MAX)  &&         \
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
                                v == (type)PY_SSIZE_T_MIN)))  ||  \
    (sizeof(type) == sizeof(Py_ssize_t) &&              \
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_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);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


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

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


static const char *__pyx_f[] = {
  "cypari_src/gen.pyx",
};

/* "cypari_src/decl.pxi":29
 *     int longjmp (jmp_buf __env, int val)
 * 
 * ctypedef unsigned long ulong             # <<<<<<<<<<<<<<
 * 
 * cdef extern from 'pari/paricfg.h':
 */
typedef unsigned long __pyx_t_10cypari_src_3gen_ulong;

/*--- Type declarations ---*/
struct __pyx_obj_10cypari_src_3gen_gen;
struct __pyx_obj_10cypari_src_3gen_PariInstance;
struct __pyx_opt_args_10cypari_src_3gen_prec_bits_to_words;

/* "cypari_src/gen.pyx":280
 *     return int(prec_in_dec*log_10)
 * 
 * cpdef prec_bits_to_words(int prec_in_bits=0):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in bits to pari real precision
 */
struct __pyx_opt_args_10cypari_src_3gen_prec_bits_to_words {
  int __pyx_n;
  int prec_in_bits;
};

/* "cypari_src/gen.pxd":6
 * 
 * #cdef class gen(sage.structure.element.RingElement):
 * cdef class gen:             # <<<<<<<<<<<<<<
 *     cdef GEN g
 *     cdef object _parent
 */
struct __pyx_obj_10cypari_src_3gen_gen {
  PyObject_HEAD
  struct __pyx_vtabstruct_10cypari_src_3gen_gen *__pyx_vtab;
  GEN g;
  PyObject *_parent;
  PyObject *_refers_to;
  pari_sp b;
};


/* "cypari_src/gen.pxd":26
 * 
 * #cdef class PariInstance(sage.structure.parent_base.ParentWithBase):
 * cdef class PariInstance:             # <<<<<<<<<<<<<<
 *     cdef public UI_callback
 *     cdef gen PARI_ZERO, PARI_ONE, PARI_TWO
 */
struct __pyx_obj_10cypari_src_3gen_PariInstance {
  PyObject_HEAD
  struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *__pyx_vtab;
  PyObject *UI_callback;
  struct __pyx_obj_10cypari_src_3gen_gen *PARI_ZERO;
  struct __pyx_obj_10cypari_src_3gen_gen *PARI_ONE;
  struct __pyx_obj_10cypari_src_3gen_gen *PARI_TWO;
};



/* "cypari_src/gen.pyx":396
 *     t4 = P.toGEN(x, 4)
 * 
 * cdef class gen:             # <<<<<<<<<<<<<<
 *     """
 *     Python extension class that models the PARI GEN type.
 */

struct __pyx_vtabstruct_10cypari_src_3gen_gen {
  void (*init)(struct __pyx_obj_10cypari_src_3gen_gen *, GEN, pari_sp);
  GEN (*_gen)(struct __pyx_obj_10cypari_src_3gen_gen *);
  struct __pyx_obj_10cypari_src_3gen_gen *(*new_gen)(struct __pyx_obj_10cypari_src_3gen_gen *, GEN);
  struct __pyx_obj_10cypari_src_3gen_gen *(*new_leaf_gen)(struct __pyx_obj_10cypari_src_3gen_gen *, GEN);
  struct __pyx_obj_10cypari_src_3gen_gen *(*new_gen_noclear)(struct __pyx_obj_10cypari_src_3gen_gen *, GEN);
  struct __pyx_obj_10cypari_src_3gen_gen *(*pari)(struct __pyx_obj_10cypari_src_3gen_gen *, PyObject *);
  GEN (*_deepcopy_to_python_heap)(struct __pyx_obj_10cypari_src_3gen_gen *, GEN, pari_sp *, pari_sp);
  long (*get_var)(struct __pyx_obj_10cypari_src_3gen_gen *, PyObject *);
  GEN (*get_nf)(struct __pyx_obj_10cypari_src_3gen_gen *);
  int (*compare)(struct __pyx_obj_10cypari_src_3gen_gen *, struct __pyx_obj_10cypari_src_3gen_gen *, int);
};
static struct __pyx_vtabstruct_10cypari_src_3gen_gen *__pyx_vtabptr_10cypari_src_3gen_gen;


/* "cypari_src/gen.pyx":8844
 *     pass
 * 
 * cdef class PariInstance:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, long size=16000000, unsigned long maxprime=500000):
 */

struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance {
  struct __pyx_obj_10cypari_src_3gen_gen *(*new_gen)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN);
  struct __pyx_obj_10cypari_src_3gen_gen *(*new_gen_with_sp)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN);
  struct __pyx_obj_10cypari_src_3gen_gen *(*new_leaf_gen)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN);
  PyObject *(*new_gen_to_bytes)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN);
  struct __pyx_obj_10cypari_src_3gen_gen *(*new_gen_noclear)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN);
  struct __pyx_obj_10cypari_src_3gen_gen *(*new_gen_from_int)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, int);
  struct __pyx_obj_10cypari_src_3gen_gen *(*new_t_POL_from_int_star)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, int *, int, long);
  void (*clear_stack)(struct __pyx_obj_10cypari_src_3gen_PariInstance *);
  void (*set_mytop_to_avma)(struct __pyx_obj_10cypari_src_3gen_PariInstance *);
  struct __pyx_obj_10cypari_src_3gen_gen *(*double_to_gen_c)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, double);
  PyObject *(*_real_coerced_to_bits_prec)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, double, long, int __pyx_skip_dispatch);
  GEN (*double_to_GEN)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, double);
  GEN (*deepcopy_to_python_heap)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN, pari_sp *, pari_sp);
  struct __pyx_obj_10cypari_src_3gen_gen *(*new_ref)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN, struct __pyx_obj_10cypari_src_3gen_gen *);
  struct __pyx_obj_10cypari_src_3gen_gen *(*_empty_vector)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, long);
  long (*get_var)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, PyObject *);
  GEN (*toGEN)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, PyObject *, int);
};
static struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *__pyx_vtabptr_10cypari_src_3gen_PariInstance;
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext() \
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {                            \
        PyObject *tmp = (PyObject *) r;                         \
        r = v; __Pyx_XDECREF(tmp);                              \
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {                             \
        PyObject *tmp = (PyObject *) r;                         \
        r = v; __Pyx_DECREF(tmp);                               \
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

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

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

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

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

static CYTHON_INLINE int __Pyx_div_int(int, int); /* proto */

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

#define UNARY_NEG_WOULD_OVERFLOW(x)            (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

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

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

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

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

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

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback);

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact);

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

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

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 CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void);

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

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

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

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

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

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

#include <string.h>

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

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

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

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

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

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

#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

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

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

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f) \
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f) \
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f) \
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __Pyx_CyFunction_init(void);

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

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

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

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

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

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

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

static PyObject* __Pyx_Globals(void);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_pari_sp(pari_sp value);

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

static int __Pyx_check_binary_version(void);

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static void __pyx_f_10cypari_src_3gen_3gen_init(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, GEN __pyx_v_g, pari_sp __pyx_v_b); /* proto*/
static GEN __pyx_f_10cypari_src_3gen_3gen__gen(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto*/
static GEN __pyx_f_10cypari_src_3gen_3gen_get_nf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto*/
static int __pyx_f_10cypari_src_3gen_3gen_compare(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_left, struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_right, int __pyx_v_op); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_3gen_pari(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_3gen_new_gen(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, GEN __pyx_v_x); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_3gen_new_leaf_gen(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, GEN __pyx_v_x); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_3gen_new_gen_noclear(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, GEN __pyx_v_x); /* proto*/
static GEN __pyx_f_10cypari_src_3gen_3gen__deepcopy_to_python_heap(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, GEN __pyx_v_x, pari_sp *__pyx_v_address, pari_sp __pyx_v_prior_sp); /* proto*/
static long __pyx_f_10cypari_src_3gen_3gen_get_var(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v); /* proto*/
static GEN __pyx_f_10cypari_src_3gen_12PariInstance_toGEN(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_x, int __pyx_v_i); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_gen(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_with_sp(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_leaf_gen(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x); /* proto*/
static PyObject *__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_to_bytes(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x); /* proto*/
static void __pyx_f_10cypari_src_3gen_12PariInstance_clear_stack(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto*/
static void __pyx_f_10cypari_src_3gen_12PariInstance_set_mytop_to_avma(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_noclear(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_from_int(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, int __pyx_v_value); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_t_POL_from_int_star(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, int *__pyx_v_vals, int __pyx_v_length, long __pyx_v_varnum); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_double_to_gen_c(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, double __pyx_v_x); /* proto*/
static GEN __pyx_f_10cypari_src_3gen_12PariInstance_double_to_GEN(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, double __pyx_v_x); /* proto*/
static PyObject *__pyx_f_10cypari_src_3gen_12PariInstance__real_coerced_to_bits_prec(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, double __pyx_v_x, long __pyx_v_bits, int __pyx_skip_dispatch); /* proto*/
static GEN __pyx_f_10cypari_src_3gen_12PariInstance_deepcopy_to_python_heap(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x, pari_sp *__pyx_v_address, pari_sp __pyx_v_prior_sp); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_ref(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_g, struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_parent); /* proto*/
static long __pyx_f_10cypari_src_3gen_12PariInstance_get_var(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_v); /* proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance__empty_vector(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n); /* proto*/

/* Module declarations from 'cypari_src.gen' */
static PyTypeObject *__pyx_ptype_10cypari_src_3gen_gen = 0;
static PyTypeObject *__pyx_ptype_10cypari_src_3gen_PariInstance = 0;
static int __pyx_v_10cypari_src_3gen_sizeof_pari_word;
static struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_10cypari_src_3gen_pari_instance = 0;
static struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_10cypari_src_3gen_P = 0;
static GEN __pyx_v_10cypari_src_3gen_pari_nil;
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_10cypari_src_3gen__tmp = 0;
static GEN __pyx_v_10cypari_src_3gen_ten_to_15;
static pari_sp __pyx_v_10cypari_src_3gen_stack_mark;
static pari_sp __pyx_v_10cypari_src_3gen_mytop;
static unsigned long __pyx_v_10cypari_src_3gen_prec;
static GEN __pyx_v_10cypari_src_3gen_t0;
static GEN __pyx_v_10cypari_src_3gen_t1;
static GEN __pyx_v_10cypari_src_3gen_t2;
static GEN __pyx_v_10cypari_src_3gen_t3;
static GEN __pyx_v_10cypari_src_3gen_t4;
static unsigned long __pyx_v_10cypari_src_3gen_num_primes;
static struct PariOUT __pyx_v_10cypari_src_3gen_pari_output;
static struct PariOUT __pyx_v_10cypari_src_3gen_pari_error;
__PYX_EXTERN_C DL_EXPORT(jmp_buf) jmp_env;
static sig_t __pyx_v_10cypari_src_3gen_old_sigint_handler;
static sig_t __pyx_v_10cypari_src_3gen_old_sigalrm_handler;
static GEN __pyx_f_10cypari_src_3gen__Vec_append(GEN, GEN, long); /*proto*/
static CYTHON_INLINE void __pyx_f_10cypari_src_3gen_set_mark(void); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_bits_to_dec(int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_dec_to_bits(int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_bits_to_words(int __pyx_skip_dispatch, struct __pyx_opt_args_10cypari_src_3gen_prec_bits_to_words *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_words_to_bits(int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_dec_to_words(int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_words_to_dec(int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_t0GEN(PyObject *); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_t1GEN(PyObject *); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_t2GEN(PyObject *); /*proto*/
static void __pyx_f_10cypari_src_3gen_py_putchar(char); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_py_puts(const char*); /*proto*/
static void __pyx_f_10cypari_src_3gen_py_flush(void); /*proto*/
static void __pyx_f_10cypari_src_3gen_py_swallow(void); /*proto*/
static int __pyx_f_10cypari_src_3gen_init_stack(size_t); /*proto*/
static size_t __pyx_f_10cypari_src_3gen_fix_size(size_t); /*proto*/
static GEN __pyx_f_10cypari_src_3gen_deepcopy_to_python_heap(GEN, pari_sp *, pari_sp); /*proto*/
static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen__new_gen(GEN, pari_sp); /*proto*/
static void __pyx_f_10cypari_src_3gen_sigalrm_handler(int); /*proto*/
static void __pyx_f_10cypari_src_3gen_pari_signal_handler(int); /*proto*/
__PYX_EXTERN_C DL_EXPORT(void) set_pari_signals(void); /*proto*/
__PYX_EXTERN_C DL_EXPORT(void) unset_pari_signals(void); /*proto*/
static CYTHON_INLINE void __pyx_f_10cypari_src_3gen_sig_off(void); /*proto*/
static int __pyx_f_10cypari_src_3gen_pari_error_handler(long); /*proto*/
static void __pyx_f_10cypari_src_3gen_pari_error_recoverer(long); /*proto*/
static void __pyx_f_10cypari_src_3gen_pari_sigint_handler(void); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen__factor_int_when_pari_factor_failed(PyObject *, PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "cypari_src.gen"
int __pyx_module_is_main_cypari_src__gen = 0;

/* Implementation of 'cypari_src.gen' */
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_chr;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_eval;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_OverflowError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_lambda_funcdef_10cypari_src_3gen_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_lambda_funcdef_10cypari_src_3gen_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_lambda_funcdef_10cypari_src_3gen_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_lambda_funcdef_10cypari_src_3gen_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_prec_bits_to_dec(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_bits); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_2prec_dec_to_bits(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_dec); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_4prec_bits_to_words(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_bits); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_6prec_words_to_bits(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_words); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_8prec_dec_to_words(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_dec); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_10prec_words_to_dec(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_words); /* proto */
static int __pyx_pf_10cypari_src_3gen_3gen___init__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_2parent(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static void __pyx_pf_10cypari_src_3gen_3gen_4__dealloc__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_6__repr__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static Py_hash_t __pyx_pf_10cypari_src_3gen_3gen_8__hash__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_10_testclass(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_12list(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_14__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_16__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_18__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_20__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
#if PY_MAJOR_VERSION < 3
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_22__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
#endif
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_24_add_one(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_26__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_28__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *__pyx_v_m); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_30__neg__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_32__xor__(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_34__rshift__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_36__lshift__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_38__invert__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_40getattr(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_42mod(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_44nf_get_pol(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_46nf_get_diff(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_48nf_get_sign(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_50nf_get_zk(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_52bnf_get_no(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_54bnf_get_cyc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_56bnf_get_gen(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_58bnf_get_reg(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_60pr_get_p(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_62pr_get_e(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_64pr_get_f(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_66pr_get_gen(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_68bid_get_cyc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_70bid_get_gen(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_72__getitem__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_74_gen_length(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static int __pyx_pf_10cypari_src_3gen_3gen_76__setitem__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_y); /* proto */
static Py_ssize_t __pyx_pf_10cypari_src_3gen_3gen_78__len__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_80__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_82__copy__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_84list_str(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_86__index__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_88hex(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_90__int__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_92int_unsafe(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_94intvec_unsafe(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_96python_list_small(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_98python_list(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_100__float__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_102__complex__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static int __pyx_pf_10cypari_src_3gen_3gen_104__nonzero__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_106gequal(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_108gequal0(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_a); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_110gequal_long(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_a, long __pyx_v_b); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_112isprime(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_114qfbhclassno(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_116ispseudoprime(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_118ispower(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_k); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_120divrem(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_var); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_122lex(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_124max(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_126min(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_128shift(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_130shiftmul(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_132moebius(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_134sign(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_136vecmax(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_138vecmin(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_140Col(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_142Colrev(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_144List(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_146Mat(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_148Mod(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_150Pol(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_152Polrev(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_154Qfb(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_D); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_156Ser(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_v, long __pyx_v_seriesprecision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_158Set(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_160Str(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_162Strchr(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_164Strexpand(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_166Strtex(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_168printtex(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_170Vec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_172Vecrev(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_174Vecsmall(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_176binary(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_178bitand(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_180bitneg(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_182bitnegimply(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_184bitor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_186bittest(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_188bitxor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_190ceil(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_192centerlift(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_194component(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_196conj(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_198conjvec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_200denominator(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_202floor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_204frac(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_206imag(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_208length(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_210lift(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_212numbpart(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_214numerator(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_216numtoperm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_k, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_218padicprec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_220padicprime(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_222permtonum(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_224precision(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_226random(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_N); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_228real(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_230round(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_estimate); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_232simplify(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_234sizeword(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_236sizebyte(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_238sizedigit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_240truncate(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_estimate); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_242valuation(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_244_valp(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_246variable(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_248abs(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_250acos(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_252acosh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_254agm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_256arg(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_258asin(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_260asinh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_262atan(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_264atanh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_266bernfrac(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_268bernreal(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_270bernvec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_272besselh1(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_274besselh2(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_276besselj(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_278besseljh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_280besseli(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_282besselk(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, CYTHON_UNUSED long __pyx_v_flag, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_284besseln(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_286cos(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_288cosh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_290cotan(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_292dilog(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_294eint1(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_296erfc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_298eta(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_flag, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_300exp(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_302gamma(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_s, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_304gammah(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_s, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_306hyperu(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_308incgam(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_s, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_310incgamc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_s, PyObject *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_312log(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_314log_gamma(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_316polylog(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_m, PyObject *__pyx_v_flag, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_318psi(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_320sin(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_322sinh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_324sqr(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_326sqrt(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_328sqrtn(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_n, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_330tan(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_332tanh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_334teichmuller(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_336theta(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_q, PyObject *__pyx_v_z, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_338thetanullk(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_q, long __pyx_v_k, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_340weber(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_flag, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_342zeta(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_s, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_344bezout(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_346binomial(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_k); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_348contfrac(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_b, long __pyx_v_lmax); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_350contfracpnqn(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_b, CYTHON_UNUSED long __pyx_v_lmax); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_352fibonacci(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_354gcd(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y, CYTHON_UNUSED long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_356issquare(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_find_root); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_358issquarefree(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_360lcm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_362numdiv(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_364phi(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_366primepi(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_368sumdiv(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_370sumdivk(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_n, long __pyx_v_k); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_372xgcd(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_374ellinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, int __pyx_v_flag, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_376ellglobalred(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_378elladd(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z0, PyObject *__pyx_v_z1); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_380ellak(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_382ellan(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_python_ints); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_384ellanalyticrank(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_386ellap(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_388ellaplist(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_python_ints); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_390ellbil(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z0, PyObject *__pyx_v_z1); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_392ellchangecurve(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_ch); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_394elleta(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_396ellheight(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_flag, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_398ellheightmatrix(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_400ellisoncurve(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_402elllocalred(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_404elllseries(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_s, PyObject *__pyx_v_A); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_406ellminimalmodel(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_408ellorder(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_410ellordinate(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_412ellpointtoz(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_P, long __pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_414ellpow(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_416ellrootno(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_418ellsigma(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_420ellsub(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z0, PyObject *__pyx_v_z1); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_422elltaniyama(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_424elltors(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_426ellzeta(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_428ellztopoint(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_430omega(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_432disc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_434j(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_436ellj(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_438bnfcertify(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_440bnfinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, PyObject *__pyx_v_tech); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_442bnfisintnorm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_444bnfisnorm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_446bnfisprincipal(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_448bnfnarrow(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_450bnfsunit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_bnf, PyObject *__pyx_v_S, long __pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_452bnfunit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_454bnfisunit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_456dirzetak(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_458galoisapply(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_aut, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_460galoisinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_den); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_462galoispermtopol(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_perm); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_464galoisfixedfield(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_perm, long __pyx_v_flag, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_466idealred(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_vdir); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_468idealadd(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_470idealaddtoone(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_472idealappr(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, CYTHON_UNUSED long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_474idealcoprime(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_476idealdiv(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_478idealfactor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_480idealhnf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_482idealintersection(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_484ideallist(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_bound, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_486ideallog(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_bid); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_488idealmul(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_490idealnorm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_492idealprimedec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nf, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_494idealstar(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_I, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_496idealtwoelt(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_a); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_498idealval(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_500elementval(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_502modreverse(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_504nfbasis(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, PyObject *__pyx_v_fa); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_506nfbasis_d(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, PyObject *__pyx_v_fa); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_508nfbasistoalg(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nf, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_510nfbasistoalg_lift(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nf, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_512nfdisc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_514nfeltreduce(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_I); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_516nffactor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_518nfgenerator(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_520nfhilbert(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_522nfinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, long __pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_524_nfinit_with_prec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, long __pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_526nfisisom(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_528nfrootsof1(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_530nfsubfields(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_d); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_532rnfcharpoly(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_T, PyObject *__pyx_v_a, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_534rnfdisc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_536rnfeltabstorel(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_538rnfeltreltoabs(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_540rnfequation(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_poly, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_542rnfidealabstorel(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_544rnfidealdown(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_546rnfidealhnf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_548rnfidealnormrel(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_550rnfidealreltoabs(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_552rnfidealtwoelt(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_554rnfinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_poly); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_556rnfisfree(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_poly); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_558quadhilbert(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_560reverse(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_562content(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_564deriv(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_566eval(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_568__call__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_570factornf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_t); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_572factorpadic(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p, long __pyx_v_r, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_574factormod(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_576intformal(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_578padicappr(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_a); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_580newtonpoly(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_582polcoeff(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_var); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_584polcompositum(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_pol2, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_586poldegree(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_var); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_588poldisc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_var); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_590poldiscreduced(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_592polgalois(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_594nfgaloisconj(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, PyObject *__pyx_v_denom, long __pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_596nfroots(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_poly); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_598polhensellift(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y, PyObject *__pyx_v_p, long __pyx_v_e); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_600polisirreducible(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_602pollead(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_604polrecip(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_606polred(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_fa); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_608polredabs(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_610polresultant(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y, PyObject *__pyx_v_var, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_612polroots(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_614polrootsmod(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_616polrootspadic(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_618polrootspadicfast(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_620polsturm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_622polsturm_full(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_624polsylvestermatrix(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_g); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_626polsym(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_628serconvol(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_g); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_630serlaplace(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_632serreverse(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_634thueinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_636rnfisnorminit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_polrel, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_638rnfisnorm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_T, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_640vecextract(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y, PyObject *__pyx_v_z); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_642ncols(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_644nrows(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_646mattranspose(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_648matadjoint(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_650qflll(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_652qflllgram(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_654lllgram(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_656lllgramint(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_658qfminim(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_B, PyObject *__pyx_v_max, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_660qfrep(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_B, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_662matsolve(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_B); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_664matker(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_666matkerint(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_668matdet(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_670trace(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_672mathnf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_674mathnfmod(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_676mathnfmodid(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_678matsnf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_680matrank(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_682matfrobenius(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_684factor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_limit, int __pyx_v_proof); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_686hilbert(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_688chinese(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_690order(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_692znprimroot(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_694__abs__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_696norm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_698nextprime(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, int __pyx_v_add_one); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_700change_variable_name(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_var); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_702subst(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_var, PyObject *__pyx_v_z); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_704substpol(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y, PyObject *__pyx_v_z); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_706nf_subst(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_708taylor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_710thue(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_rhs, PyObject *__pyx_v_ne); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_712charpoly(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_var, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_714kronecker(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_716type(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_718polinterpolate(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_ya, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_720algdep(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_722concat(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_724lindep(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_726listinsert(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_obj, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_728listput(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_obj, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_730elleisnum(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_k, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_732ellwp(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z, long __pyx_v_n, long __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_734ellchangepoint(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_736debug(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_depth); /* proto */
static int __pyx_pf_10cypari_src_3gen_12PariInstance___init__(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_size, unsigned long __pyx_v_maxprime); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_2_unsafe_deallocate_pari_stack(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_4__repr__(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static Py_hash_t __pyx_pf_10cypari_src_3gen_12PariInstance_6__hash__(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_8abort(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_10_set_alarm_handler(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_handler); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_12shut_up(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_14speak_up(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_16stack_info(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_18exception_info(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_20default(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_variable, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_22set_debug_level(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_24get_debug_level(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_26set_real_precision(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_28get_real_precision(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_30set_series_precision(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_32get_series_precision(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_34double_to_gen(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_36_real_coerced_to_bits_prec(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, double __pyx_v_x, long __pyx_v_bits); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_38complex(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_re, PyObject *__pyx_v_im); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_40__call__(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_42new_with_bits_prec(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_s, long __pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_44allocatemem(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_s, PyObject *__pyx_v_silent); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_46pari_version(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_48init_primes(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v__M); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_50read(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_52_primelimit(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_54prime_list(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_56primes_up_to_n(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_58__nth_prime(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_60nth_prime(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_62euler(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_64pi(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_precision); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_66pollegendre(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_68poltchebi(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_70factorial(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_72polcyclo(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_74polsubcyclo(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, long __pyx_v_d, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_76polzagier(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, long __pyx_v_m); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_78setrand(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_seed); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_80getrand(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_82vector(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_entries); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_84matrix(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_m, long __pyx_v_n, PyObject *__pyx_v_entries); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_11UI_callback___get__(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static int __pyx_pf_10cypari_src_3gen_12PariInstance_11UI_callback_2__set__(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10cypari_src_3gen_12PariInstance_11UI_callback_4__del__(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_12init_pari_stack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_9PariError___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_9PariError_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_9PariError_4errmessage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_9PariError_6errnum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_9PariError_8set_errnum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errnum); /* proto */
static PyObject *__pyx_pf_10cypari_src_3gen_14vecsmall_to_intlist(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_v); /* proto */
static PyObject *__pyx_tp_new_10cypari_src_3gen_gen(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10cypari_src_3gen_PariInstance(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_[] = ".";
static char __pyx_k_A[] = "A";
static char __pyx_k_B[] = "B";
static char __pyx_k_D[] = "D";
static char __pyx_k_I[] = "I";
static char __pyx_k_P[] = "P";
static char __pyx_k_S[] = "S";
static char __pyx_k_T[] = "T";
static char __pyx_k_a[] = "a";
static char __pyx_k_b[] = "b";
static char __pyx_k_c[] = "c";
static char __pyx_k_d[] = "d";
static char __pyx_k_e[] = "e";
static char __pyx_k_k[] = "k";
static char __pyx_k_m[] = "m";
static char __pyx_k_n[] = "n";
static char __pyx_k_p[] = "p";
static char __pyx_k_r[] = "r";
static char __pyx_k_s[] = "s";
static char __pyx_k_v[] = "v";
static char __pyx_k_x[] = "x";
static char __pyx_k_y[] = "y";
static char __pyx_k_z[] = "z";
static char __pyx_k_0x[] = "0x";
static char __pyx_k__5[] = "\"";
static char __pyx_k__6[] = "..";
static char __pyx_k__8[] = "[";
static char __pyx_k_fa[] = "fa";
static char __pyx_k_im[] = "im";
static char __pyx_k_ne[] = "ne";
static char __pyx_k_re[] = "re";
static char __pyx_k_ya[] = "ya";
static char __pyx_k_z0[] = "z0";
static char __pyx_k_z1[] = "z1";
static char __pyx_k_Mat[] = "Mat(";
static char __pyx_k_Mod[] = "Mod";
static char __pyx_k_Vec[] = "Vec";
static char __pyx_k__10[] = "]";
static char __pyx_k__11[] = "~";
static char __pyx_k__12[] = "";
static char __pyx_k__14[] = ";";
static char __pyx_k__16[] = "], [";
static char __pyx_k_abs[] = "abs";
static char __pyx_k_aut[] = "aut";
static char __pyx_k_bid[] = "bid";
static char __pyx_k_chr[] = "chr";
static char __pyx_k_den[] = "den";
static char __pyx_k_doc[] = "__doc__";
static char __pyx_k_hex[] = "hex";
static char __pyx_k_max[] = "max";
static char __pyx_k_obj[] = "obj";
static char __pyx_k_pbw[] = "pbw";
static char __pyx_k_rhs[] = "rhs";
static char __pyx_k_s_d[] = "%s (%d)";
static char __pyx_k_str[] = "__str__";
static char __pyx_k_sys[] = "sys";
static char __pyx_k_var[] = "var";
static char __pyx_k_args[] = "args";
static char __pyx_k_bits[] = "bits";
static char __pyx_k_eval[] = "eval";
static char __pyx_k_find[] = "find";
static char __pyx_k_flag[] = "flag";
static char __pyx_k_imag[] = "imag";
static char __pyx_k_init[] = "_init";
static char __pyx_k_lmax[] = "lmax";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_math[] = "math";
static char __pyx_k_pari[] = "pari";
static char __pyx_k_perm[] = "perm";
static char __pyx_k_pol2[] = "pol2";
static char __pyx_k_poly[] = "poly";
static char __pyx_k_real[] = "real";
static char __pyx_k_repr[] = "__repr__";
static char __pyx_k_self[] = "self";
static char __pyx_k_size[] = "size";
static char __pyx_k_tech[] = "tech";
static char __pyx_k_test[] = "test";
static char __pyx_k_type[] = "type";
static char __pyx_k_utf8[] = "utf8";
static char __pyx_k_vdir[] = "vdir";
static char __pyx_k_Mat_2[] = "Mat";
static char __pyx_k_bound[] = "bound";
static char __pyx_k_debug[] = "debug";
static char __pyx_k_denom[] = "denom";
static char __pyx_k_depth[] = "depth";
static char __pyx_k_flush[] = "flush";
static char __pyx_k_limit[] = "limit";
static char __pyx_k_ncols[] = "ncols";
static char __pyx_k_nrows[] = "nrows";
static char __pyx_k_print[] = "print";
static char __pyx_k_proof[] = "proof";
static char __pyx_k_range[] = "range";
static char __pyx_k_t_COL[] = "t_COL";
static char __pyx_k_t_INT[] = "t_INT";
static char __pyx_k_t_MAT[] = "t_MAT";
static char __pyx_k_t_POL[] = "t_POL";
static char __pyx_k_t_QFI[] = "t_QFI";
static char __pyx_k_t_QFR[] = "t_QFR";
static char __pyx_k_t_SER[] = "t_SER";
static char __pyx_k_t_STR[] = "t_STR";
static char __pyx_k_t_VEC[] = "t_VEC";
static char __pyx_k_types[] = "types";
static char __pyx_k_value[] = "value";
static char __pyx_k_write[] = "write";
static char __pyx_k_Polrev[] = "Polrev";
static char __pyx_k_SIGINT[] = "SIGINT";
static char __pyx_k_Strtex[] = "Strtex";
static char __pyx_k_Vecrev[] = "Vecrev";
static char __pyx_k_append[] = "append";
static char __pyx_k_bezout[] = "bezout";
static char __pyx_k_d_full[] = "%d %% full";
static char __pyx_k_decode[] = "decode";
static char __pyx_k_errnum[] = "errnum";
static char __pyx_k_factor[] = "factor";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_lambda[] = "<lambda>";
static char __pyx_k_matrix[] = "matrix";
static char __pyx_k_module[] = "__module__";
static char __pyx_k_pari_2[] = "_pari_";
static char __pyx_k_polrel[] = "polrel";
static char __pyx_k_signal[] = "signal";
static char __pyx_k_silent[] = "silent";
static char __pyx_k_stdout[] = "stdout";
static char __pyx_k_t0heap[] = "t0heap";
static char __pyx_k_t_FRAC[] = "t_FRAC";
static char __pyx_k_t_LIST[] = "t_LIST";
static char __pyx_k_t_QUAD[] = "t_QUAD";
static char __pyx_k_t_REAL[] = "t_REAL";
static char __pyx_k_test_2[] = "__test__";
static char __pyx_k_used_d[] = "used: %d";
static char __pyx_k_vector[] = "vector";
static char __pyx_k_xrange[] = "xrange";
static char __pyx_k_add_one[] = "add_one";
static char __pyx_k_default[] = "default";
static char __pyx_k_entries[] = "entries";
static char __pyx_k_getitem[] = "__getitem__";
static char __pyx_k_indices[] = "indices";
static char __pyx_k_isprime[] = "isprime";
static char __pyx_k_prepare[] = "__prepare__";
static char __pyx_k_primepi[] = "primepi";
static char __pyx_k_replace[] = "replace";
static char __pyx_k_t_FFELT[] = "t_FFELT";
static char __pyx_k_t_PADIC[] = "t_PADIC";
static char __pyx_k_t_RFRAC[] = "t_RFRAC";
static char __pyx_k_unknown[] = "unknown";
static char __pyx_k_estimate[] = "estimate";
static char __pyx_k_exc_info[] = "exc_info";
static char __pyx_k_maxprime[] = "maxprime";
static char __pyx_k_operator[] = "operator";
static char __pyx_k_polcoeff[] = "polcoeff";
static char __pyx_k_pysignal[] = "pysignal";
static char __pyx_k_qualname[] = "__qualname__";
static char __pyx_k_speak_up[] = "speak_up";
static char __pyx_k_t_INTMOD[] = "t_INTMOD";
static char __pyx_k_t_POLMOD[] = "t_POLMOD";
static char __pyx_k_variable[] = "variable";
static char __pyx_k_Exception[] = "Exception";
static char __pyx_k_PariError[] = "PariError";
static char __pyx_k_TypeError[] = "TypeError";
static char __pyx_k_component[] = "component";
static char __pyx_k_default_s[] = "default(%s)";
static char __pyx_k_enumerate[] = "enumerate";
static char __pyx_k_find_root[] = "find_root";
static char __pyx_k_metaclass[] = "__metaclass__";
static char __pyx_k_nth_prime[] = "nth_prime";
static char __pyx_k_poldegree[] = "poldegree";
static char __pyx_k_precision[] = "precision";
static char __pyx_k_qflllgram[] = "qflllgram";
static char __pyx_k_t_CLOSURE[] = "t_CLOSURE";
static char __pyx_k_t_COMPLEX[] = "t_COMPLEX";
static char __pyx_k_testclass[] = "testclass";
static char __pyx_k_IndexError[] = "IndexError";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_errmessage[] = "errmessage";
static char __pyx_k_prime_list[] = "prime_list";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_set_errnum[] = "set_errnum";
static char __pyx_k_t_VECSMALL[] = "t_VECSMALL";
static char __pyx_k_vecextract[] = "vecextract";
static char __pyx_k_ImportError[] = "ImportError";
static char __pyx_k_MemoryError[] = "MemoryError";
static char __pyx_k_PariError_d[] = "PariError(%d)";
static char __pyx_k_allocatemem[] = "allocatemem";
static char __pyx_k_available_d[] = "available: %d";
static char __pyx_k_default_s_s[] = "default(%s, %s)";
static char __pyx_k_init_primes[] = "init_primes";
static char __pyx_k_nth_prime_2[] = "__nth_prime";
static char __pyx_k_python_ints[] = "python_ints";
static char __pyx_k_RuntimeError[] = "RuntimeError";
static char __pyx_k_chars_to_str[] = "chars_to_str";
static char __pyx_k_prec_in_bits[] = "prec_in_bits";
static char __pyx_k_str_to_chars[] = "str_to_chars";
static char __pyx_k_version_info[] = "version_info";
static char __pyx_k_GeneratorType[] = "GeneratorType";
static char __pyx_k_OverflowError[] = "OverflowError";
static char __pyx_k_alarm_handler[] = "alarm_handler";
static char __pyx_k_AttributeError[] = "AttributeError";
static char __pyx_k_cypari_src_gen[] = "cypari_src.gen";
static char __pyx_k_PariError___str[] = "PariError.__str__";
static char __pyx_k_future_builtins[] = "future_builtins";
static char __pyx_k_gen_j_line_6599[] = "gen.j (line 6599)";
static char __pyx_k_init_pari_stack[] = "init_pari_stack";
static char __pyx_k_seriesprecision[] = "seriesprecision";
static char __pyx_k_1000000000000000[] = "1000000000000000";
static char __pyx_k_PariError___repr[] = "PariError.__repr__";
static char __pyx_k_PariError_errnum[] = "PariError.errnum";
static char __pyx_k_Setjmp_enabled_d[] = "Setjmp enabled ? %d";
static char __pyx_k_gen_mod_line_623[] = "gen.mod (line 623)";
static char __pyx_k_nfinit_with_prec[] = "_nfinit_with_prec";
static char __pyx_k_PARI_stack_size_d[] = "PARI stack size: %d";
static char __pyx_k_gen_Col_line_2080[] = "gen.Col (line 2080)";
static char __pyx_k_gen_Mat_line_2200[] = "gen.Mat (line 2200)";
static char __pyx_k_gen_Mod_line_2263[] = "gen.Mod (line 2263)";
static char __pyx_k_gen_Pol_line_2324[] = "gen.Pol (line 2324)";
static char __pyx_k_gen_Qfb_line_2423[] = "gen.Qfb (line 2423)";
static char __pyx_k_gen_Ser_line_2475[] = "gen.Ser (line 2475)";
static char __pyx_k_gen_Set_line_2532[] = "gen.Set (line 2532)";
static char __pyx_k_gen_Str_line_2567[] = "gen.Str (line 2567)";
static char __pyx_k_gen_Vec_line_2694[] = "gen.Vec (line 2694)";
static char __pyx_k_gen_abs_line_4056[] = "gen.abs (line 4056)";
static char __pyx_k_gen_agm_line_4131[] = "gen.agm (line 4131)";
static char __pyx_k_gen_arg_line_4160[] = "gen.arg (line 4160)";
static char __pyx_k_gen_cos_line_4488[] = "gen.cos (line 4488)";
static char __pyx_k_gen_eta_line_4631[] = "gen.eta (line 4631)";
static char __pyx_k_gen_exp_line_4660[] = "gen.exp (line 4660)";
static char __pyx_k_gen_hex_line_1477[] = "gen.hex (line 1477)";
static char __pyx_k_gen_lcm_line_5348[] = "gen.lcm (line 5348)";
static char __pyx_k_gen_list_line_458[] = "gen.list (line 458)";
static char __pyx_k_gen_log_line_4799[] = "gen.log (line 4799)";
static char __pyx_k_gen_phi_line_5371[] = "gen.phi (line 5371)";
static char __pyx_k_gen_psi_line_4895[] = "gen.psi (line 4895)";
static char __pyx_k_gen_sin_line_4915[] = "gen.sin (line 4915)";
static char __pyx_k_gen_sqr_line_4953[] = "gen.sqr (line 4953)";
static char __pyx_k_gen_tan_line_5055[] = "gen.tan (line 5055)";
static char __pyx_k_gen_List_line_2180[] = "gen.List (line 2180)";
static char __pyx_k_gen_acos_line_4082[] = "gen.acos (line 4082)";
static char __pyx_k_gen_asin_line_4177[] = "gen.asin (line 4177)";
static char __pyx_k_gen_atan_line_4219[] = "gen.atan (line 4219)";
static char __pyx_k_gen_ceil_line_3111[] = "gen.ceil (line 3111)";
static char __pyx_k_gen_conj_line_3238[] = "gen.conj (line 3238)";
static char __pyx_k_gen_cosh_line_4509[] = "gen.cosh (line 4509)";
static char __pyx_k_gen_disc_line_6585[] = "gen.disc (line 6585)";
static char __pyx_k_gen_erfc_line_4608[] = "gen.erfc (line 4608)";
static char __pyx_k_gen_frac_line_3367[] = "gen.frac (line 3367)";
static char __pyx_k_gen_imag_line_3393[] = "gen.imag (line 3393)";
static char __pyx_k_gen_lift_line_3430[] = "gen.lift (line 3430)";
static char __pyx_k_gen_sinh_line_4934[] = "gen.sinh (line 4934)";
static char __pyx_k_gen_sqrt_line_4980[] = "gen.sqrt (line 4980)";
static char __pyx_k_gen_tanh_line_5074[] = "gen.tanh (line 5074)";
static char __pyx_k_gen_type_line_8523[] = "gen.type (line 8523)";
static char __pyx_k_gen_xgcd_line_5435[] = "gen.xgcd (line 5435)";
static char __pyx_k_gen_zeta_line_5178[] = "gen.zeta (line 5178)";
static char __pyx_k_prec_bits_to_words[] = "prec_bits_to_words";
static char __pyx_k_set_real_precision[] = "set_real_precision";
static char __pyx_k_unindexable_object[] = "unindexable object";
static char __pyx_k_PARI_user_exception[] = "PARI user exception";
static char __pyx_k_Unknown_PARI_type_s[] = "Unknown PARI type: %s";
static char __pyx_k_default_int_handler[] = "default_int_handler";
static char __pyx_k_gen__valp_line_3997[] = "gen._valp (line 3997)";
static char __pyx_k_gen_acosh_line_4107[] = "gen.acosh (line 4107)";
static char __pyx_k_gen_asinh_line_4199[] = "gen.asinh (line 4199)";
static char __pyx_k_gen_atanh_line_4239[] = "gen.atanh (line 4239)";
static char __pyx_k_gen_bitor_line_3002[] = "gen.bitor (line 3002)";
static char __pyx_k_gen_cotan_line_4530[] = "gen.cotan (line 4530)";
static char __pyx_k_gen_debug_line_8776[] = "gen.debug (line 8776)";
static char __pyx_k_gen_dilog_line_4557[] = "gen.dilog (line 4557)";
static char __pyx_k_gen_ellak_line_5595[] = "gen.ellak (line 5595)";
static char __pyx_k_gen_ellan_line_5634[] = "gen.ellan (line 5634)";
static char __pyx_k_gen_ellap_line_5689[] = "gen.ellap (line 5689)";
static char __pyx_k_gen_ellwp_line_8677[] = "gen.ellwp (line 8677)";
static char __pyx_k_gen_floor_line_3324[] = "gen.floor (line 3324)";
static char __pyx_k_gen_gamma_line_4681[] = "gen.gamma (line 4681)";
static char __pyx_k_gen_ncols_line_7829[] = "gen.ncols (line 7829)";
static char __pyx_k_gen_nrows_line_7844[] = "gen.nrows (line 7844)";
static char __pyx_k_gen_omega_line_6572[] = "gen.omega (line 6572)";
static char __pyx_k_gen_round_line_3665[] = "gen.round (line 3665)";
static char __pyx_k_gen_sqrtn_line_4997[] = "gen.sqrtn (line 4997)";
static char __pyx_k_gen_subst_line_8423[] = "gen.subst (line 8423)";
static char __pyx_k_gen_theta_line_5113[] = "gen.theta (line 5113)";
static char __pyx_k_gen_trace_line_8054[] = "gen.trace (line 8054)";
static char __pyx_k_gen_weber_line_5149[] = "gen.weber (line 5149)";
static char __pyx_k_index_out_of_bounds[] = "index out of bounds";
static char __pyx_k_vecsmall_to_intlist[] = "vecsmall_to_intlist";
static char __pyx_k_PARI_was_interrupted[] = "PARI was interrupted!";
static char __pyx_k_PariError_errmessage[] = "PariError.errmessage";
static char __pyx_k_PariError_set_errnum[] = "PariError.set_errnum";
static char __pyx_k_gen_Colrev_line_2127[] = "gen.Colrev (line 2127)";
static char __pyx_k_gen_Polrev_line_2383[] = "gen.Polrev (line 2383)";
static char __pyx_k_gen_Strchr_line_2607[] = "gen.Strchr (line 2607)";
static char __pyx_k_gen_Strtex_line_2657[] = "gen.Strtex (line 2657)";
static char __pyx_k_gen_Vecrev_line_2752[] = "gen.Vecrev (line 2752)";
static char __pyx_k_gen_algdep_line_8596[] = "gen.algdep (line 8596)";
static char __pyx_k_gen_binary_line_2841[] = "gen.binary (line 2841)";
static char __pyx_k_gen_bitand_line_2881[] = "gen.bitand (line 2881)";
static char __pyx_k_gen_bitneg_line_2922[] = "gen.bitneg (line 2922)";
static char __pyx_k_gen_bitxor_line_3078[] = "gen.bitxor (line 3078)";
static char __pyx_k_gen_elladd_line_5559[] = "gen.elladd (line 5559)";
static char __pyx_k_gen_ellbil_line_5801[] = "gen.ellbil (line 5801)";
static char __pyx_k_gen_elleta_line_5857[] = "gen.elleta (line 5857)";
static char __pyx_k_gen_ellpow_line_6307[] = "gen.ellpow (line 6307)";
static char __pyx_k_gen_ellsub_line_6425[] = "gen.ellsub (line 6425)";
static char __pyx_k_gen_factor_line_8228[] = "gen.factor (line 8228)";
static char __pyx_k_gen_gammah_line_4709[] = "gen.gammah (line 4709)";
static char __pyx_k_gen_gequal_line_1724[] = "gen.gequal (line 1724)";
static char __pyx_k_gen_hyperu_line_4730[] = "gen.hyperu (line 4730)";
static char __pyx_k_gen_incgam_line_4750[] = "gen.incgam (line 4750)";
static char __pyx_k_gen_matdet_line_8032[] = "gen.matdet (line 8032)";
static char __pyx_k_gen_mathnf_line_8066[] = "gen.mathnf (line 8066)";
static char __pyx_k_gen_matker_line_7977[] = "gen.matker (line 7977)";
static char __pyx_k_gen_matsnf_line_8155[] = "gen.matsnf (line 8155)";
static char __pyx_k_gen_nfdisc_line_7097[] = "gen.nfdisc (line 7097)";
static char __pyx_k_gen_nfinit_line_7194[] = "gen.nfinit (line 7194)";
static char __pyx_k_gen_numdiv_line_5359[] = "gen.numdiv (line 5359)";
static char __pyx_k_gen_sumdiv_line_5411[] = "gen.sumdiv (line 5411)";
static char __pyx_k_used_by_cypari_gen_d[] = "used by cypari.gen: %d";
static char __pyx_k_gen___hash___line_432[] = "gen.__hash__ (line 432)";
static char __pyx_k_gen___int___line_1498[] = "gen.__int__ (line 1498)";
static char __pyx_k_gen__add_one_line_556[] = "gen._add_one (line 556)";
static char __pyx_k_gen_bernvec_line_4293[] = "gen.bernvec (line 4293)";
static char __pyx_k_gen_besseli_line_4401[] = "gen.besseli (line 4401)";
static char __pyx_k_gen_besselj_line_4354[] = "gen.besselj (line 4354)";
static char __pyx_k_gen_besselk_line_4426[] = "gen.besselk (line 4426)";
static char __pyx_k_gen_besseln_line_4468[] = "gen.besseln (line 4468)";
static char __pyx_k_gen_bittest_line_3037[] = "gen.bittest (line 3037)";
static char __pyx_k_gen_conjvec_line_3270[] = "gen.conjvec (line 3270)";
static char __pyx_k_gen_content_line_7461[] = "gen.content (line 7461)";
static char __pyx_k_gen_ellinit_line_5451[] = "gen.ellinit (line 5451)";
static char __pyx_k_gen_elltors_line_6455[] = "gen.elltors (line 6455)";
static char __pyx_k_gen_ellzeta_line_6500[] = "gen.ellzeta (line 6500)";
static char __pyx_k_gen_gequal0_line_1758[] = "gen.gequal0 (line 1758)";
static char __pyx_k_gen_incgamc_line_4773[] = "gen.incgamc (line 4773)";
static char __pyx_k_gen_ispower_line_1928[] = "gen.ispower (line 1928)";
static char __pyx_k_gen_isprime_line_1809[] = "gen.isprime (line 1809)";
static char __pyx_k_gen_nfbasis_line_6955[] = "gen.nfbasis (line 6955)";
static char __pyx_k_gen_nfroots_line_7636[] = "gen.nfroots (line 7636)";
static char __pyx_k_gen_polylog_line_4867[] = "gen.polylog (line 4867)";
static char __pyx_k_gen_pr_get_e_line_870[] = "gen.pr_get_e (line 870)";
static char __pyx_k_gen_pr_get_f_line_893[] = "gen.pr_get_f (line 893)";
static char __pyx_k_gen_pr_get_p_line_852[] = "gen.pr_get_p (line 852)";
static char __pyx_k_gen_primepi_line_5381[] = "gen.primepi (line 5381)";
static char __pyx_k_gen_rnfinit_line_7405[] = "gen.rnfinit (line 7405)";
static char __pyx_k_gen_sumdivk_line_5423[] = "gen.sumdivk (line 5423)";
static char __pyx_k_Current_error_number_d[] = "Current error number: %d";
static char __pyx_k_gen_Vecsmall_line_2799[] = "gen.Vecsmall (line 2799)";
static char __pyx_k_gen_bernfrac_line_4261[] = "gen.bernfrac (line 4261)";
static char __pyx_k_gen_bernreal_line_4278[] = "gen.bernreal (line 4278)";
static char __pyx_k_gen_besselh1_line_4314[] = "gen.besselh1 (line 4314)";
static char __pyx_k_gen_besselh2_line_4334[] = "gen.besselh2 (line 4334)";
static char __pyx_k_gen_besseljh_line_4377[] = "gen.besseljh (line 4377)";
static char __pyx_k_gen_binomial_line_5243[] = "gen.binomial (line 5243)";
static char __pyx_k_gen_ellorder_line_6219[] = "gen.ellorder (line 6219)";
static char __pyx_k_gen_ellsigma_line_6408[] = "gen.ellsigma (line 6408)";
static char __pyx_k_gen_factornf_line_7487[] = "gen.factornf (line 7487)";
static char __pyx_k_gen_ideallog_line_6817[] = "gen.ideallog (line 6817)";
static char __pyx_k_gen_matsolve_line_7950[] = "gen.matsolve (line 7950)";
static char __pyx_k_gen_nf_get_zk_line_772[] = "gen.nf_get_zk (line 772)";
static char __pyx_k_gen_nf_subst_line_8456[] = "gen.nf_subst (line 8456)";
static char __pyx_k_gen_nfisisom_line_7258[] = "gen.nfisisom (line 7258)";
static char __pyx_k_gen_numbpart_line_3465[] = "gen.numbpart (line 3465)";
static char __pyx_k_gen_polcoeff_line_7556[] = "gen.polcoeff (line 7556)";
static char __pyx_k_gen_simplify_line_3721[] = "gen.simplify (line 3721)";
static char __pyx_k_gen_sizebyte_line_3795[] = "gen.sizebyte (line 3795)";
static char __pyx_k_gen_sizeword_line_3762[] = "gen.sizeword (line 3762)";
static char __pyx_k_gen_truncate_line_3858[] = "gen.truncate (line 3858)";
static char __pyx_k_gen_variable_line_4019[] = "gen.variable (line 4019)";
static char __pyx_k_Doubling_the_PARI_stack[] = "Doubling the PARI stack.";
static char __pyx_k_Not_a_PARI_number_field[] = "Not a PARI number field";
static char __pyx_k_gen___index___line_1458[] = "gen.__index__ (line 1458)";
static char __pyx_k_gen_bnf_get_no_line_792[] = "gen.bnf_get_no (line 792)";
static char __pyx_k_gen_component_line_3192[] = "gen.component (line 3192)";
static char __pyx_k_gen_ellaplist_line_5729[] = "gen.ellaplist (line 5729)";
static char __pyx_k_gen_elleisnum_line_8635[] = "gen.elleisnum (line 8635)";
static char __pyx_k_gen_ellheight_line_5879[] = "gen.ellheight (line 5879)";
static char __pyx_k_gen_ellrootno_line_6370[] = "gen.ellrootno (line 6370)";
static char __pyx_k_gen_fibonacci_line_5287[] = "gen.fibonacci (line 5287)";
static char __pyx_k_gen_ideallist_line_6791[] = "gen.ideallist (line 6791)";
static char __pyx_k_gen_idealstar_line_6881[] = "gen.idealstar (line 6881)";
static char __pyx_k_gen_log_gamma_line_4841[] = "gen.log_gamma (line 4841)";
static char __pyx_k_gen_mathnfmod_line_8092[] = "gen.mathnfmod (line 8092)";
static char __pyx_k_gen_matkerint_line_8006[] = "gen.matkerint (line 8006)";
static char __pyx_k_gen_nextprime_line_8346[] = "gen.nextprime (line 8346)";
static char __pyx_k_gen_nf_get_pol_line_691[] = "gen.nf_get_pol (line 691)";
static char __pyx_k_gen_nfbasis_d_line_7002[] = "gen.nfbasis_d (line 7002)";
static char __pyx_k_gen_nfhilbert_line_7160[] = "gen.nfhilbert (line 7160)";
static char __pyx_k_gen_padicprec_line_3522[] = "gen.padicprec (line 3522)";
static char __pyx_k_gen_pr_get_gen_line_916[] = "gen.pr_get_gen (line 916)";
static char __pyx_k_gen_sizedigit_line_3814[] = "gen.sizedigit (line 3814)";
static char __pyx_k_gen_valuation_line_3921[] = "gen.valuation (line 3921)";
static char __pyx_k_row_index_out_of_bounds[] = "row index out of bounds";
static char __pyx_k_x_must_be_of_type_t_VEC[] = "x must be of type t_VEC.";
static char __pyx_k_gen___getitem___line_982[] = "gen.__getitem__ (line 982)";
static char __pyx_k_gen_bid_get_cyc_line_937[] = "gen.bid_get_cyc (line 937)";
static char __pyx_k_gen_bid_get_gen_line_955[] = "gen.bid_get_gen (line 955)";
static char __pyx_k_gen_bnf_get_cyc_line_805[] = "gen.bnf_get_cyc (line 805)";
static char __pyx_k_gen_bnf_get_gen_line_821[] = "gen.bnf_get_gen (line 821)";
static char __pyx_k_gen_bnf_get_reg_line_837[] = "gen.bnf_get_reg (line 837)";
static char __pyx_k_gen_centerlift_line_3153[] = "gen.centerlift (line 3153)";
static char __pyx_k_gen_elllseries_line_6138[] = "gen.elllseries (line 6138)";
static char __pyx_k_gen_matadjoint_line_7876[] = "gen.matadjoint (line 7876)";
static char __pyx_k_gen_newtonpoly_line_7541[] = "gen.newtonpoly (line 7541)";
static char __pyx_k_gen_nf_get_diff_line_724[] = "gen.nf_get_diff (line 724)";
static char __pyx_k_gen_nf_get_sign_line_744[] = "gen.nf_get_sign (line 744)";
static char __pyx_k_gen_nfrootsof1_line_7298[] = "gen.nfrootsof1 (line 7298)";
static char __pyx_k_gen_padicprime_line_3554[] = "gen.padicprime (line 3554)";
static char __pyx_k_gen_serreverse_line_7766[] = "gen.serreverse (line 7766)";
static char __pyx_k_gen_thetanullk_line_5132[] = "gen.thetanullk (line 5132)";
static char __pyx_k_gen_znprimroot_line_8309[] = "gen.znprimroot (line 8309)";
static char __pyx_k_PariInstance_pi_line_9607[] = "PariInstance.pi (line 9607)";
static char __pyx_k_gen___complex___line_1673[] = "gen.__complex__ (line 1673)";
static char __pyx_k_gen___setitem___line_1211[] = "gen.__setitem__ (line 1211)";
static char __pyx_k_gen__gen_length_line_1196[] = "gen._gen_length (line 1196)";
static char __pyx_k_gen_bitnegimply_line_2968[] = "gen.bitnegimply (line 2968)";
static char __pyx_k_gen_denominator_line_3294[] = "gen.denominator (line 3294)";
static char __pyx_k_gen_elllocalred_line_5983[] = "gen.elllocalred (line 5983)";
static char __pyx_k_gen_ellordinate_line_6250[] = "gen.ellordinate (line 6250)";
static char __pyx_k_gen_ellpointtoz_line_6281[] = "gen.ellpointtoz (line 6281)";
static char __pyx_k_gen_ellztopoint_line_6533[] = "gen.ellztopoint (line 6533)";
static char __pyx_k_gen_gequal_long_line_1778[] = "gen.gequal_long (line 1778)";
static char __pyx_k_gen_mathnfmodid_line_8126[] = "gen.mathnfmodid (line 8126)";
static char __pyx_k_gen_nfeltreduce_line_7132[] = "gen.nfeltreduce (line 7132)";
static char __pyx_k_gen_python_list_line_1627[] = "gen.python_list (line 1627)";
static char __pyx_k_gen_qfbhclassno_line_1848[] = "gen.qfbhclassno (line 1848)";
static char __pyx_k_gen_quadhilbert_line_7428[] = "gen.quadhilbert (line 7428)";
static char __pyx_k_gen_teichmuller_line_5098[] = "gen.teichmuller (line 5098)";
static char __pyx_k_prec_bits_to_dec_line_248[] = "prec_bits_to_dec (line 248)";
static char __pyx_k_prec_dec_to_bits_line_264[] = "prec_dec_to_bits (line 264)";
static char __pyx_k_real_coerced_to_bits_prec[] = "_real_coerced_to_bits_prec";
static char __pyx_k_column_index_out_of_bounds[] = "column index out of bounds";
static char __pyx_k_gen_ellglobalred_line_5524[] = "gen.ellglobalred (line 5524)";
static char __pyx_k_gen_ellisoncurve_line_5955[] = "gen.ellisoncurve (line 5955)";
static char __pyx_k_gen_idealcoprime_line_6743[] = "gen.idealcoprime (line 6743)";
static char __pyx_k_gen_issquarefree_line_5334[] = "gen.issquarefree (line 5334)";
static char __pyx_k_gen_matfrobenius_line_8182[] = "gen.matfrobenius (line 8182)";
static char __pyx_k_gen_mattranspose_line_7864[] = "gen.mattranspose (line 7864)";
static char __pyx_k_gen_nfbasistoalg_line_7034[] = "gen.nfbasistoalg (line 7034)";
static char __pyx_k_gen_nfgaloisconj_line_7607[] = "gen.nfgaloisconj (line 7607)";
static char __pyx_k_gen_rnfidealdown_line_7362[] = "gen.rnfidealdown (line 7362)";
static char __pyx_k_prec_dec_to_words_line_331[] = "prec_dec_to_words (line 331)";
static char __pyx_k_prec_words_to_dec_line_350[] = "prec_words_to_dec (line 350)";
static char __pyx_k_PariInstance_read_line_9455[] = "PariInstance.read (line 9455)";
static char __pyx_k_gen_idealprimedec_line_6861[] = "gen.idealprimedec (line 6861)";
static char __pyx_k_gen_intvec_unsafe_line_1563[] = "gen.intvec_unsafe (line 1563)";
static char __pyx_k_gen_ispseudoprime_line_1889[] = "gen.ispseudoprime (line 1889)";
static char __pyx_k_prec_bits_to_words_line_280[] = "prec_bits_to_words (line 280)";
static char __pyx_k_prec_words_to_bits_line_311[] = "prec_words_to_bits (line 311)";
static char __pyx_k_PariInstance_euler_line_9590[] = "PariInstance.euler (line 9590)";
static char __pyx_k_gen_ellchangecurve_line_5826[] = "gen.ellchangecurve (line 5826)";
static char __pyx_k_gen_ellchangepoint_line_8751[] = "gen.ellchangepoint (line 8751)";
static char __pyx_k_pari_trap_recursion_too_deep[] = "_pari_trap recursion too deep";
static char __pyx_k_PariError___repr___line_10114[] = "PariError.__repr__ (line 10114)";
static char __pyx_k_PariInstance_vector_line_9785[] = "PariInstance.vector (line 9785)";
static char __pyx_k_gen_ellanalyticrank_line_5674[] = "gen.ellanalyticrank (line 5674)";
static char __pyx_k_gen_ellheightmatrix_line_5926[] = "gen.ellheightmatrix (line 5926)";
static char __pyx_k_gen_ellminimalmodel_line_6181[] = "gen.ellminimalmodel (line 6181)";
static char __pyx_k_Computes_the_Hurwitz_Kronecker[] = "\n        Computes the Hurwitz-Kronecker class number of `n`.\n\n        INPUT:\n\n        - `n` (gen) -- a non-negative integer\n        \n        .. note::\n\n           If `n` is large (more than `5*10^5`), the result is\n           conditional upon GRH.\n        \n        EXAMPLES:\n\n        The Hurwitx class number is 0 is n is congruent to 1 or 2 modulo 4::\n            >>> pari(-10007).qfbhclassno()\n            0\n            >>> pari(-2).qfbhclassno()\n            0\n\n        It is -1/12 for n=0::\n\n            >>> pari(0).qfbhclassno()\n            -1/12\n\n        Otherwise it is the number of classes of positive definite\n        binary quadratic forms with discriminant `-n`, weighted by\n        `1/m` where `m` is the number of automorphisms of the form::\n        \n            >>> pari(4).qfbhclassno()\n            1/2\n            >>> pari(3).qfbhclassno()\n            1/3\n            >>> pari(23).qfbhclassno()\n            3\n        \n        ";
static char __pyx_k_Convert_self_to_a_list_of_PARI[] = "\n        Convert self to a list of PARI gens.\n\n        EXAMPLES:\n\n        A PARI vector becomes a Sage list::\n\n            >>> L = pari(\"vector(10,i,i^2)\").list()\n            >>> L\n            [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\n            >>> isinstance(L, list)\n            True\n            >>> isinstance(L[0], gen)\n            True\n\n        For polynomials, list() behaves as for ordinary Sage polynomials::\n\n            >>> pol = pari(\"x^3 + 5/3*x\"); pol.list()\n            [0, 5/3, 0, 1]\n\n        For power series or laurent series, we get all coefficients starting\n        from the lowest degree term.  This includes trailing zeros::\n\n            >>> pari('x^2 + O(x^8)').list()\n            [1, 0, 0, 0, 0, 0]\n            >>> s = pari('x^-2 + O(x^0)')\n            >>> s.list()\n            [1, 0]\n\n        For matrices, we get a list of columns::\n\n            >>> M = pari('[1,4;2,5;3,6]'); M\n            [1, 4; 2, 5; 3, 6]\n            >>> M.list()\n            [[1, 2, 3]~, [4, 5, 6]~]\n\n        For \"scalar\" types, we get a 1-element list containing ``self``::\n\n            >>> pari(\"42\").list()\n            [42]\n        ";
static char __pyx_k_Creates_a_vector_containing_as[] = "\n        Creates a vector containing, as rational numbers, the Bernoulli\n        numbers `B_0, B_2,\\ldots, B_{2x}`. This routine is\n        obsolete. Use bernfrac instead each time you need a Bernoulli\n        number in exact form.\n        \n        Note: this routine is implemented using repeated independent calls\n        to bernfrac, which is faster than the standard recursion in exact\n        arithmetic.\n        \n        EXAMPLES::\n        \n            >>> pari(8).bernvec()\n            [1, 1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510]\n            >>> [pari(2*n).bernfrac() for n in range(9)]\n            [1, 1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510]\n        ";
static char __pyx_k_For_real_x_return_the_smallest[] = "\n        For real x: return the smallest integer = x. For rational\n        functions: the quotient of numerator by denominator. For lists:\n        apply componentwise.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - depends on type of x\n        \n        \n        EXAMPLES::\n        \n            >>> pari(1.4).ceil()\n            2\n            >>> pari(-1.4).ceil()\n            -1\n            >>> pari('3/4').ceil()\n            1\n            >>> pari('x').ceil()\n            x\n            >>> pari('(x^2+x+1)/x').ceil()\n            x + 1\n        \n        This may be unexpected: but it is correct, treating the argument as\n        a rational function in RR(x).\n        \n        ::\n        \n            >>> pari('x^2+5*x+2.5').ceil()\n            x^2 + 5*x + 2.50000000000000\n        ";
static char __pyx_k_Given_a_PARI_number_field_self[] = "\n        Given a PARI number field ``self``, return the same PARI\n        number field but in the variable ``z``.\n\n        INPUT:\n\n        - ``self`` -- A PARI number field being the output of ``nfinit()``,\n                      ``bnfinit()`` or ``bnrinit()``.\n\n        EXAMPLES::\n\n            >>> K = pari('x^2 + 5').nfinit()\n\n        We can substitute in a PARI ``nf`` structure::\n\n            >>> K.nf_get_pol()\n            x^2 + 5\n            >>> L = K.nf_subst('a')\n            >>> L.nf_get_pol()\n            a^2 + 5\n\n        We can also substitute in a PARI ``bnf`` structure::\n\n            >>> K = K.bnfinit()\n            >>> K.nf_get_pol()\n            x^2 + 5\n            >>> K.bnf_get_cyc()  # Structure of class group\n            [2]\n            >>> L = K.nf_subst('a')\n            >>> L.nf_get_pol()\n            a^2 + 5\n            >>> L.bnf_get_cyc()  # We still have a bnf after substituting\n            [2]\n        ";
static char __pyx_k_Greatest_common_divisor_of_all[] = "\n        Greatest common divisor of all the components of ``self``.\n\n        EXAMPLES::\n\n            >>> pari(\"2*x^2 + 2\").content()\n            2\n            >>> pari(\"4*x^3 - 2*x/3 + 2/5\").content()\n            2/15\n        ";
static char __pyx_k_Not_an_INTMOD_or_POLMOD_in_mod[] = "Not an INTMOD or POLMOD in mod()";
static char __pyx_k_Object_s_must_be_of_type_t_VEC[] = "Object (=%s) must be of type t_VEC.";
static char __pyx_k_PariInstance_getrand_line_9765[] = "PariInstance.getrand (line 9765)";
static char __pyx_k_PariInstance_setrand_line_9725[] = "PariInstance.setrand (line 9725)";
static char __pyx_k_Return_Euler_s_constant_to_the[] = "\n        Return Euler's constant to the requested real precision (in bits).\n        \n        EXAMPLES::\n        \n            >>> pari.euler()\n            0.577215664901533\n            >>> oldprec = pari.set_real_precision(50)\n            >>> pari.euler(precision=100)\n            0.57721566490153286060651209008240243104\n            >>> pari.set_real_precision(oldprec)\n            50\n        ";
static char __pyx_k_Return_a_primitive_root_modulo[] = "\n        Return a primitive root modulo self, whenever it exists.\n        \n        This is a generator of the group `(\\ZZ/n\\ZZ)^*`, whenever\n        this group is cyclic, i.e. if `n=4` or `n=p^k` or\n        `n=2p^k`, where `p` is an odd prime and `k`\n        is a natural number.\n        \n        INPUT:\n        \n        \n        -  ``self`` - positive integer equal to 4, or a power\n           of an odd prime, or twice a power of an odd prime\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari(4).znprimroot()\n            Mod(3, 4)\n            >>> pari('10007^3').znprimroot()\n            Mod(5, 1002101470343)\n            >>> pari('2*109^10').znprimroot()\n            Mod(236736367459211723407, 473472734918423446802)\n        ";
static char __pyx_k_Return_a_string_containing_the[] = "\n        Return a string containing the hexadecimal digits of self, with sign.\n        \n        EXAMPLES::\n        \n            >>> print( pari(0).hex() )\n            0\n            >>> print( pari(15).hex() )\n            f\n            >>> print( pari(16).hex() )\n            10\n            >>> print( pari(16938402384092843092843098243).hex() )\n            36bb1e3929d1a8fe2802f083\n            >>> print( hex(16938402384092843092843098243) )\n            0x36bb1e3929d1a8fe2802f083\n            >>> print( pari(-16938402384092843092843098243).hex() )\n            -36bb1e3929d1a8fe2802f083\n        ";
static char __pyx_k_Return_the_Fibonacci_number_of[] = "\n        Return the Fibonacci number of index x.\n        \n        EXAMPLES::\n        \n            >>> pari(18).fibonacci()\n            2584\n            >>> [pari(n).fibonacci() for n in range(10)]\n            [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]\n        ";
static char __pyx_k_Return_the_PARI_elliptic_curve[] = "\n        Return the PARI elliptic curve object with Weierstrass coefficients\n        given by self, a list with 5 elements.\n        \n        INPUT:\n        \n        \n        -  ``self`` - a list of 5 coefficients\n        \n        -  ``flag (optional, default: 0)`` - if 0, ask for a\n           PARI ell structure with 19 components; if 1, ask for a PARI sell\n           structure with only the first 13 components\n        \n        -  ``precision (optional, default: 0)`` - the real\n           precision to be used in the computation of the components of the\n           PARI (s)ell structure; if 0, use the default 53 bits.\n        \n           .. note::\n\n              the parameter precision in :meth:`.ellinit` controls not only\n              the real precision of the resulting (s)ell structure,\n              but also the precision of most subsequent computations\n              with this elliptic curve.  You should therefore set it\n              from the start to the value you require.\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - either a PARI ell structure with 19\n           components (if flag=0), or a PARI sell structure with 13 components\n           (if flag=1)\n        \n        \n        EXAMPLES: An elliptic curve with integer coefficients::\n        \n            >>> e = pari([0,1,0,1,0]).ellinit(); e  # Different answer for 32-bit\n            [0, 1, 0, 1, 0, 4, 2, 0, -1, -32, 224, -48, 2048/3, [0.E-38, -0.500000000000000 - 0.866025403784439*I, -0.500000000000000 + 0.866025403784439*I]~, 3.37150070962519, -1.68575035481260 - 2.15651564749964*I, 1.37451455785745 - 5.42101086242752 E-19*I, -0.687257278928726 + 0.984434956803824*I, 7.27069403586288]\n        \n        Its inexact components have the default precision of 53 bits::\n        \n            >>> e[14]\n            3.37150070962519\n        \n        We can compute this to higher precision::\n        \n            >>> old_prec = pari.set_real_precision""(45)\n            >>> e = pari([0,1,0,1,0]).ellinit(precision=150)\n            >>> e[14]\n            3.37150070962519208574240731559815397900160179\n            >>> pari.set_real_precision(old_prec)\n            45\n            \n        Using flag=1 returns a short elliptic curve PARI object::\n        \n            >>> pari([0,1,0,1,0]).ellinit(flag=1)\n            [0, 1, 0, 1, 0, 4, 2, 0, -1, -32, 224, -48, 2048/3]\n        \n        The coefficients can be any ring elements that convert to Pari::\n        \n            >>> pari('[0,1/2,0,-3/4,0]').ellinit(flag=1)\n            [0, 1/2, 0, -3/4, 0, 2, -3/2, 0, -9/16, 40, -116, 117/4, 256000/117]\n            >>> pari([0,0.5,0,-0.75,0]).ellinit(flag=1)\n            [0, 0.500000000000000, 0, -0.750000000000000, 0, 2.00000000000000, -1.50000000000000, 0, -0.562500000000000, 40.0000000000000, -116.000000000000, 29.2500000000000, 2188.03418803419]\n            >>> pari('[0,I,0,1,0]').ellinit(flag=1)\n            [0, I, 0, 1, 0, 4*I, 2, 0, -1, -64, 352*I, -80, 16384/5]\n            >>> pari('[0,x,0,2*x,1]').ellinit(flag=1)\n            [0, x, 0, 2*x, 1, 4*x, 4*x, 4, -4*x^2 + 4*x, 16*x^2 - 96*x, -64*x^3 + 576*x^2 - 864, 64*x^4 - 576*x^3 + 576*x^2 - 432, (256*x^6 - 4608*x^5 + 27648*x^4 - 55296*x^3)/(4*x^4 - 36*x^3 + 36*x^2 - 27)]\n        ";
static char __pyx_k_Return_the_complementary_error[] = "\n        Return the complementary error function:\n        \n        .. math::\n        \n            (2/\\sqrt{\\pi}) \\int_{x}^{\\infty} e^{-t^2} dt.\n        \n        \n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).erfc()\n            0.157299207050285\n        ";
static char __pyx_k_Return_the_determinant_of_this[] = "\n        Return the determinant of this matrix.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - (optional) flag 0: using Gauss-Bareiss.\n           1: use classical Gaussian elimination (slightly better for integer\n           entries)\n        \n        \n        EXAMPLES::\n        \n            >>> pari('[1,2; 3,4]').matdet(0)\n            -2\n            >>> pari('[1,2; 3,4]').matdet(1)\n            -2\n        ";
static char __pyx_k_Return_the_integer_kernel_of_a[] = "\n        Return the integer kernel of a matrix.\n        \n        This is the LLL-reduced Z-basis of the kernel of the matrix x with\n        integral entries.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - optional, and may be set to 0: default,\n           uses a modified LLL, 1: uses matrixqz.\n        \n        \n        EXAMPLES::\n        \n            >>> pari('[2,1;2,1]').matker()\n            [-1/2; 1]\n            >>> pari('[2,1;2,1]').matkerint()\n            [1; -2]\n            >>> pari('[2,1;2,1]').matkerint(1)\n            [1; -2]\n        ";
static char __pyx_k_Return_the_length_of_self_as_a[] = "\n        Return the length of self as a PARI object, *including*\n        codewords.\n        \n        EXAMPLES::\n        \n            >>> n = pari(30)\n            >>> n.length()\n            1\n            >>> n._gen_length()\n            3\n        ";
static char __pyx_k_Return_the_sum_of_the_divisors[] = "\n        Return the sum of the divisors of `n`.\n        \n        EXAMPLES::\n        \n            >>> pari(10).sumdiv()\n            18\n        ";
static char __pyx_k_Return_the_value_or_the_series[] = "\n        Return the value or the series expansion of the Weierstrass\n        `P`-function at `z` on the lattice `self` (or the lattice\n        defined by the elliptic curve `self`).\n        \n        INPUT:\n        \n        -  ``self`` -- an elliptic curve created using ``ellinit`` or a\n           list ``[om1, om2]`` representing generators for a lattice.\n        \n        -  ``z`` -- (default: 'z') a complex number or a variable name\n           (as string or PARI variable).\n        \n        -  ``n`` -- (default: 20) if 'z' is a variable, compute the\n           series expansion up to at least `O(z^n)`.\n        \n        -  ``flag`` -- (default = 0): If ``flag`` is 0, compute only\n           `P(z)`.  If ``flag`` is 1, compute `[P(z), P'(z)]`.\n        \n        OUTPUT:\n        \n        - `P(z)` (if ``flag`` is 0) or `[P(z), P'(z)]` (if ``flag`` is 1).\n           numbers\n        \n        EXAMPLES:\n        \n        We first define the elliptic curve X_0(11)::\n        \n            >>> E = pari([0,-1,1,-10,-20]).ellinit()\n        \n        Compute P(1)::\n        \n            >>> E.ellwp(1)\n            13.9658695257485 + 0.E-18*I\n        \n        Compute P(1+i), where i = sqrt(-1)::\n        \n            >>> E.ellwp(pari('1+I'))\n            -1.11510682565555 + 2.33419052307470*I\n            >>> E.ellwp(1+1j)\n            -1.11510682565555 + 2.33419052307470*I\n        \n        The series expansion, to the default `O(z^20)` precision::\n        \n            >>> E.ellwp()\n            z^-2 + 31/15*z^2 + 2501/756*z^4 + 961/675*z^6 + 77531/41580*z^8 + 1202285717/928746000*z^10 + 2403461/2806650*z^12 + 30211462703/43418875500*z^14 + 3539374016033/7723451736000*z^16 + 413306031683977/1289540602350000*z^18 + O(z^20)\n        \n        Compute the series for wp to lower precision::\n        \n            >>> E.ellwp(n=4)\n            z^-2 + 31/15*z^2 + O(z^4)\n        \n        Next we use the version where the input is generators for a\n        ""lattice::\n        \n            >>> pari('[1.2692, 0.63 + 1.45*I]').ellwp(1)\n            13.9656146936689 + 0.000644829272810...*I\n        \n        With flag=1, compute the pair P(z) and P'(z)::\n        \n            >>> E.ellwp(1, flag=1)\n            [13.9658695257485 + 0.E-18*I, 50.5619300880073 ... E-18*I]\n        ";
static char __pyx_k_Returns_a_vector_of_generators[] = "\n        Returns a vector of generators of the class group of this\n        number field.\n        \n        NOTE: ``self`` must be a \"big number field\" (``bnf``).\n        \n        EXAMPLES::\n            \n            >>> K = pari('bnfinit(x^2+65)')\n            >>> G = K.bnf_get_gen(); G\n            [[3, 2; 0, 1], [2, 1; 0, 1]]\n        ";
static char __pyx_k_Returns_the_ramification_index[] = "\n        Returns the ramification index (over `\\QQ`) of this prime ideal.\n        \n        NOTE: ``self`` must be a PARI prime ideal (as returned by\n        ``idealfactor`` for example).\n        \n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^2+1)')\n            >>> K.idealfactor(2)[0,0].pr_get_e()\n            2\n            >>> K.idealfactor(3)[0,0].pr_get_e()\n            1\n            >>> K.idealfactor(5)[0,0].pr_get_e()\n            1\n        ";
static char __pyx_k_Set_x_convert_x_into_a_set_i_e[] = "\n        Set(x): convert x into a set, i.e. a row vector of strings in\n        increasing lexicographic order.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - a vector of strings in increasing\n           lexicographic order.\n        \n        \n        EXAMPLES::\n        \n            >>> pari([1,5,2]).Set()\n            [\"1\", \"2\", \"5\"]\n            >>> pari([]).Set()     # the empty set\n            []\n            >>> pari([1,1,-1,-1,3,3]).Set()\n            [\"-1\", \"1\", \"3\"]\n            >>> pari(1).Set()\n            [\"1\"]\n            >>> pari('1/(x*y)').Set()\n            [\"1/(y*x)\"]\n        ";
static char __pyx_k_Show_the_internal_structure_of[] = "\n        Show the internal structure of self (like the ``\\x`` command in gp).\n\n        EXAMPLE::\n\n            >>> pari('[1/2, 1.0*I]').debug()  # doctest: +SKIP\n            [&=0000000004c5f010] VEC(lg=3):2200000000000003 0000000004c5eff8 0000000004c5efb0\n              1st component = [&=0000000004c5eff8] FRAC(lg=3):0800000000000003 0000000004c5efe0 0000000004c5efc8\n                num = [&=0000000004c5efe0] INT(lg=3):0200000000000003 (+,lgefint=3):4000000000000003 0000000000000001\n                den = [&=0000000004c5efc8] INT(lg=3):0200000000000003 (+,lgefint=3):4000000000000003 0000000000000002\n              2nd component = [&=0000000004c5efb0] COMPLEX(lg=3):0c00000000000003 00007fae8a2eb840 0000000004c5ef90\n                real = gen_0\n                imag = [&=0000000004c5ef90] REAL(lg=4):0400000000000004 (+,expo=0):6000000000000000 8000000000000000 0000000000000000\n        ";
static char __pyx_k_Strtex_x_Translates_the_vector[] = "\n        Strtex(x): Translates the vector x of PARI gens to TeX format and\n        returns the resulting concatenated strings as a PARI t_STR.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - PARI t_STR (string)\n        \n        \n        EXAMPLES::\n        \n            >>> v=pari('x^2')\n            >>> v.Strtex()\n            \"x^2\"\n            >>> v=pari(['1/x^2','x'])\n            >>> v.Strtex()\n            \"\\\\frac{1}{x^2}x\"\n            >>> v=pari(['1 + 1/x + 1/(y+1)','x-1'])\n            >>> v.Strtex()\n            \"\\\\frac{ \\\\left(y\\n + 2\\\\right)  x\\n + \\\\left(y\\n + 1\\\\right) }{ \\\\left(y\\n + 1\\\\right)  x}x\\n - 1\"\n        ";
static char __pyx_k_The_Bernoulli_number_B_x_where[] = "\n        The Bernoulli number `B_x`, where `B_0 = 1`,\n        `B_1 = -1/2`, `B_2 = 1/6,\\ldots,` expressed as a\n        rational number. The argument `x` should be of type\n        integer.\n        \n        EXAMPLES::\n        \n            >>> pari(18).bernfrac()\n            43867/798\n            >>> [pari(n).bernfrac() for n in range(10)]\n            [1, -1/2, 1/6, 0, -1/30, 0, 1/42, 0, -1/30, 0]\n        ";
static char __pyx_k_The_cosine_function_If_x_is_an[] = "\n        The cosine function.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1.5).cos()\n            0.0707372016677029\n            >>> pari('1+I').cos()\n            0.833730025131149 - 0.988897705762865*I\n            >>> pari('x+O(x^8)').cos()\n            1 - 1/2*x^2 + 1/24*x^4 - 1/720*x^6 + 1/40320*x^8 + O(x^9)\n        ";
static char __pyx_k_The_hyperbolic_cosine_function[] = "\n        The hyperbolic cosine function.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1.5).cosh()\n            2.35240961524325\n            >>> pari('1+I').cosh()\n            0.833730025131149 + 0.988897705762865*I\n            >>> pari('x+O(x^8)').cosh()\n            1 + 1/2*x^2 + 1/24*x^4 + 1/720*x^6 + O(x^8)\n        ";
static char __pyx_k_The_principal_branch_of_cosh_1[] = "\n        The principal branch of `\\cosh^{-1}(x)`, so that\n        `\\Im(\\mathrm{acosh}(x))` belongs to `[0,Pi]`. If\n        `x` is real and `x < 1`, then\n        `\\mathrm{acosh}(x)` is complex.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).acosh()\n            1.31695789692482\n            >>> pari(0).acosh()\n            1.57079632679490*I\n            >>> pari('I').acosh()\n            0.881373587019543 + 1.57079632679490*I\n        ";
static char __pyx_k_The_principal_branch_of_sinh_1[] = "\n        The principal branch of `\\sinh^{-1}(x)`, so that\n        `\\Im(\\mathrm{asinh}(x))` belongs to `[-\\pi/2,\\pi/2]`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).asinh()\n            1.44363547517881\n            >>> pari('2+I').asinh()\n            1.52857091948100 + 0.427078586392476*I\n        ";
static char __pyx_k_The_principal_branch_of_tanh_1[] = "\n        The principal branch of `\\tanh^{-1}(x)`, so that\n        `\\Im(\\mathrm{atanh}(x))` belongs to `]-\\pi/2,\\pi/2]`. If\n        `x` is real and `|x| > 1` then `\\mathrm{atanh}(x)`\n        is complex.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0).atanh()\n            0.E-19\n            >>> pari(2).atanh()\n            0.549306144334055 - 1.57079632679490*I\n        ";
static char __pyx_k_Transforms_the_column_vector_x[] = "\n        Transforms the column vector ``x`` on the integral basis into an\n        algebraic number.\n        \n        INPUT:\n        \n         - ``nf`` -- a number field\n         - ``x`` -- a column of rational numbers of length equal to the\n           degree of ``nf`` or a single rational number\n        \n        OUTPUT:\n        \n         - A POLMOD representing the element of ``nf`` whose coordinates\n           are ``x`` in the Z-basis of ``nf``.\n        \n        EXAMPLES::\n        \n            >>> K = pari('nfinit(x^3 - 17)')\n            >>> K.getattr('zk')\n            [1, 1/3*x^2 - 1/3*x + 1/3, x]\n            >>> K.nfbasistoalg(42)\n            Mod(42, x^3 - 17)\n            >>> K.nfbasistoalg(\"[3/2, -5, 0]~\")\n            Mod(-5/3*x^2 + 5/3*x - 1/6, x^3 - 17)\n            >>> K.getattr('zk') * pari(\"[3/2, -5, 0]~\")\n            -5/3*x^2 + 5/3*x - 1/6\n        ";
static char __pyx_k_component_x_long_n_Return_n_th[] = "\n        component(x, long n): Return n'th component of the internal\n        representation of x. This function is 1-based instead of 0-based.\n        \n        .. note::\n\n           For vectors or matrices, it is simpler to use x[n-1]. For\n           list objects such as is output by nfinit, it is easier to\n           use member functions.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``n`` - C long (coercible to)\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari([0,1,2,3,4]).component(1)\n            0\n            >>> pari([0,1,2,3,4]).component(2)\n            1\n            >>> pari([0,1,2,3,4]).component(4)\n            3\n            >>> pari('x^3 + 2').component(1)\n            2\n            >>> pari('x^3 + 2').component(2)\n            0\n            >>> pari('x^3 + 2').component(4)\n            1\n        \n        ::\n        \n            >>> pari('x').component(0)\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n        ";
static char __pyx_k_e_disc_return_the_discriminant[] = "\n        e.disc(): return the discriminant of the elliptic curve e.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.disc()\n            -161051\n            >>> _.factor()\n            [-1, 1; 11, 5]\n        ";
static char __pyx_k_e_ellchangecurve_ch_return_the[] = "\n        e.ellchangecurve(ch): return the new model (equation) for the\n        elliptic curve e given by the change of coordinates ch.\n        \n        The change of coordinates is specified by a vector ch=[u,r,s,t]; if\n        `x'` and `y'` are the new coordinates, then\n        `x = u^2 x' + r` and `y = u^3 y' + su^2 x' + t`.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve\n        \n        -  ``ch`` - change of coordinates vector with 4\n           entries\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([1,2,3,4,5]).ellinit()\n            >>> e.ellglobalred()\n            [10351, [1, -1, 0, -1], 1]\n            >>> f = e.ellchangecurve([1,-1,0,-1])\n            >>> f[:5]\n            [1, -1, 0, 4, 3]\n        ";
static char __pyx_k_e_ellheightmatrix_x_return_the[] = "\n        e.ellheightmatrix(x): return the height matrix for the vector x of\n        points on the elliptic curve e.\n        \n        In other words, it returns the Gram matrix of x with respect to the\n        height bilinear form on e (see ellbil).\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve over `\\QQ`,\n           assumed to be in a standard minimal integral model (as given by\n           ellminimalmodel)\n        \n        -  ``x`` - vector of rational points on e\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit().ellminimalmodel()[0]\n            >>> e.ellheightmatrix([[1,0], [-1,1]])\n            [0.476711659343740, 0.418188984498861; 0.418188984498861, 0.686667083305587]\n        ";
static char __pyx_k_e_ellrootno_p_return_the_local[] = "\n        e.ellrootno(p): return the (local or global) root number of the\n        `L`-series of the elliptic curve e\n        \n        If p is a prime number, the local root number at p is returned. If\n        p is 1, the global root number is returned. Note that the global\n        root number is the sign of the functional equation of the\n        `L`-series, and therefore conjecturally equal to the parity\n        of the rank of e.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve over `\\QQ`\n        \n        -  ``p (default = 1)`` - 1 or a prime number\n        \n        \n        OUTPUT: 1 or -1\n        \n        EXAMPLES: Here is a curve of rank 3::\n        \n            >>> e = pari([0,0,0,-82,0]).ellinit()\n            >>> e.ellrootno()\n            -1\n            >>> e.ellrootno(2)\n            1\n            >>> e.ellrootno(1009)\n            1\n        ";
static char __pyx_k_e_ellsigma_z_flag_0_return_the[] = "\n        e.ellsigma(z, flag=0): return the value at the complex point z of\n        the Weierstrass `\\sigma` function associated to the\n        elliptic curve e.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,0,0,1,0]).ellinit()\n            >>> e.ellsigma('2+I')\n            1.43490215804166 + 1.80307856719256*I\n        ";
static char __pyx_k_e_ellsub_z0_z1_return_z0_z1_on[] = "\n        e.ellsub(z0, z1): return z0-z1 on this elliptic curve.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve E\n        \n        -  ``z0`` - point on E\n        \n        -  ``z1`` - point on E\n        \n        \n        OUTPUT: point on E\n        \n        EXAMPLES::\n        \n            >>> e = pari([0, 1, 1, -2, 0]).ellinit()\n            >>> e.ellsub([1,0], [-1,1])\n            [0, 0]\n        ";
static char __pyx_k_gen_must_be_of_PARI_type_t_VEC[] = "gen must be of PARI type t_VEC";
static char __pyx_k_ispseudoprime_x_flag_0_Returns[] = "\n        ispseudoprime(x, flag=0): Returns True if x is a pseudo-prime\n        number, and False otherwise.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - int 0 (default): checks whether x is a\n           Baillie-Pomerance-Selfridge-Wagstaff pseudo prime (strong\n           Rabin-Miller pseudo prime for base 2, followed by strong Lucas test\n           for the sequence (P,-1), P smallest positive integer such that\n           `P^2 - 4` is not a square mod x). 0: checks whether x is a\n           strong Miller-Rabin pseudo prime for flag randomly chosen bases\n           (with end-matching to catch square roots of -1).\n        \n        \n        OUTPUT:\n        \n        \n        -  ``bool`` - True or False\n        \n        \n        EXAMPLES::\n        \n            >>> pari(9).ispseudoprime()\n            False\n            >>> pari(17).ispseudoprime()\n            True\n            >>> n = pari(561)     # smallest Carmichael number\n            >>> n.ispseudoprime(2)\n            False\n        ";
static char __pyx_k_len_of_entries_s_must_be_s_s_s[] = "len of entries (=%s) must be %s*%s=%s";
static char __pyx_k_matadjoint_x_adjoint_matrix_of[] = "\n        matadjoint(x): adjoint matrix of x.\n        \n        EXAMPLES::\n        \n            >>> pari('[1,2,3; 4,5,6;  7,8,9]').matadjoint()\n            [-3, 6, -3; 6, -12, 6; -3, 6, -3]\n            >>> pari('[a,b,c; d,e,f; g,h,i]').matadjoint()\n            [(i*e - h*f), (-i*b + h*c), (f*b - e*c); (-i*d + g*f), i*a - g*c, -f*a + d*c; (h*d - g*e), -h*a + g*b, e*a - d*b]\n        ";
static char __pyx_k_nu_besseln_x_Bessel_N_function[] = "\n        nu.besseln(x): Bessel N function (Spherical Bessel function of the\n        second kind) of index nu and argument x.\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari('2+I').besseln(3)\n            -0.280775566958244 - 0.486708533223726*I\n        ";
static char __pyx_k_polsubcyclo_n_d_v_x_return_the[] = "\n        polsubcyclo(n, d, v=x): return the pari list of polynomial(s)\n        defining the sub-abelian extensions of degree `d` of the\n        cyclotomic field `\\QQ(\\zeta_n)`, where `d`\n        divides `\\phi(n)`.\n        \n        EXAMPLES::\n        \n            >>> pari.polsubcyclo(8, 4)\n            [x^4 + 1]\n            >>> pari.polsubcyclo(8, 2, 'z')\n            [z^2 - 2, z^2 + 1, z^2 + 2]\n            >>> pari.polsubcyclo(8, 1)\n            [x - 1]\n            >>> pari.polsubcyclo(8, 3)\n            []\n        ";
static char __pyx_k_q_thetanullk_k_return_the_k_th[] = "\n        q.thetanullk(k): return the k-th derivative at z=0 of theta(q,z).\n        \n        If `q` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `q` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0.5).thetanullk(1)\n            0.548978532560341\n        ";
static char __pyx_k_round_x_estimate_False_If_x_is[] = "\n        round(x,estimate=False): If x is a real number, returns x rounded\n        to the nearest integer (rounding up). If the optional argument\n        estimate is True, also returns the binary exponent e of the\n        difference between the original and the rounded value (the\n        \"fractional part\") (this is the integer ceiling of log_2(error)).\n        \n        When x is a general PARI object, this function returns the result\n        of rounding every coefficient at every level of PARI object. Note\n        that this is different than what the truncate function does (see\n        the example below).\n        \n        One use of round is to get exact results after a long approximate\n        computation, when theory tells you that the coefficients must be\n        integers.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``estimate`` - (optional) bool, False by default\n        \n        \n        OUTPUT:\n\n        - if estimate is False, return a single gen.\n\n        - if estimate is True, return rounded version of x and error\n          estimate in bits, both as gens.\n        \n        EXAMPLES::\n        \n            >>> pari('1.5').round()\n            2\n            >>> pari('1.5').round(True)\n            (2, -1)\n            >>> pari('1.5 + 2.1*I').round()\n            2 + 2*I\n            >>> pari('1.0001').round(True)\n            (1, -14)\n            >>> pari('(2.4*x^2 - 1.7)/x').round()\n            (2*x^2 - 2)/x\n            >>> pari('(2.4*x^2 - 1.7)/x').truncate()\n            2.40000000000000*x\n        ";
static char __pyx_k_simplify_x_Simplify_the_object[] = "\n        simplify(x): Simplify the object x as much as possible, and return\n        the result.\n        \n        A complex or quadratic number whose imaginary part is an exact 0\n        (i.e., not an approximate one such as O(3) or 0.E-28) is converted\n        to its real part, and a a polynomial of degree 0 is converted to\n        its constant term. Simplification occurs recursively.\n        \n        This function is useful before using arithmetic functions, which\n        expect integer arguments:\n        \n        EXAMPLES::\n        \n            >>> y = pari('y')\n            >>> x = pari('9') + y - y\n            >>> x\n            9\n            >>> x.type()\n            't_POL'\n            >>> x.factor()\n            matrix(0,2)\n            >>> pari('9').factor()\n            Mat([3, 2])\n            >>> x.simplify()\n            9\n            >>> x.simplify().factor()\n            Mat([3, 2])\n            >>> x = pari('1.5 + 0*I')\n            >>> x.type()\n            't_REAL'\n            >>> x.simplify()\n            1.50000000000000\n            >>> y = x.simplify()\n            >>> y.type()\n            't_REAL'\n        ";
static char __pyx_k_x_exp_exponential_of_x_If_x_is[] = "\n        x.exp(): exponential of x.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0).exp()\n            1.00000000000000\n            >>> pari(1).exp()\n            2.71828182845905\n            >>> pari('x+O(x^8)').exp()\n            1 + x + 1/2*x^2 + 1/6*x^3 + 1/24*x^4 + 1/120*x^5 + 1/720*x^6 + 1/5040*x^7 + O(x^8)\n        ";
static char __pyx_k_x_psi_psi_function_at_x_Return[] = "\n        x.psi(): psi-function at x.\n        \n        Return the `\\psi`-function of `x`, i.e., the\n        logarithmic derivative `\\Gamma'(x)/\\Gamma(x)`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).psi()\n            -0.577215664901533\n        ";
static char __pyx_k_x_sin_The_sine_of_x_If_x_is_an[] = "\n        x.sin(): The sine of x.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).sin() \n            0.841470984807897\n            >>> pari('1+I').sin()\n            1.29845758141598 + 0.634963914784736*I\n        ";
static char __pyx_k_x_sqrtn_n_return_the_principal[] = "\n        x.sqrtn(n): return the principal branch of the n-th root of x,\n        i.e., the one such that\n        `\\arg(\\sqrt(x)) \\in ]-\\pi/n, \\pi/n]`. Also returns a second\n        argument which is a suitable root of unity allowing one to recover\n        all the other roots. If it was not possible to find such a number,\n        then this second return value is 0. If the argument is present and\n        no square root exists, return 0 instead of raising an error.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        .. note::\n\n           intmods (modulo a prime) and `p`-adic numbers are\n           allowed as arguments.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``n`` - integer\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - principal n-th root of x\n        \n        -  ``gen`` - root of unity z that gives the other\n           roots\n        \n        \n        EXAMPLES::\n        \n            >>> s, z = pari(2).sqrtn(5)\n            >>> z\n            0.309016994374947 + 0.951056516295154*I\n            >>> s\n            1.14869835499704\n            >>> s**5\n            2.00000000000000\n            >>> z**5    # 32-bit: 1.00000000000000 + 5.42101086 E-19*I \n            1.00000000000000 + 5.96311194867027 E-19*I\n            >>> (s*z)**5   # 32-bit  2.00000000000000 + 1.409462824 E-18*I       \n            2.00000000000000 + 9.21571846612679 E-19*I\n        ";
static char __pyx_k_x_tanh_hyperbolic_tangent_of_x[] = "\n        x.tanh() - hyperbolic tangent of x\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).tanh()\n            0.761594155955765\n            >>> z = pari(1j); z\n            0.E-307 + 1.00000000000000*I\n            >>> result = z.tanh()\n            >>> result.real() <= 1e-18\n            True\n            >>> result.imag()\n            1.55740772465490\n        ";
static char __pyx_k_zeta_s_zeta_function_at_s_with[] = "\n        zeta(s): zeta function at s with s a complex or a p-adic number.\n        \n        If `s` is a complex number, this is the Riemann zeta\n        function `\\zeta(s)=\\sum_{n\\geq 1} n^{-s}`, computed either\n        using the Euler-Maclaurin summation formula (if `s` is not\n        an integer), or using Bernoulli numbers (if `s` is a\n        negative integer or an even nonnegative integer), or using modular\n        forms (if `s` is an odd nonnegative integer).\n        \n        If `s` is a `p`-adic number, this is the\n        Kubota-Leopoldt zeta function, i.e. the unique continuous\n        `p`-adic function on the `p`-adic integers that\n        interpolates the values of `(1-p^{-k})\\zeta(k)` at negative\n        integers `k` such that `k\\equiv 1\\pmod{p-1}` if\n        `p` is odd, and at odd `k` if `p=2`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        INPUT:\n        \n        \n        -  ``s`` - gen (real, complex, or p-adic number)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - value of zeta at s.\n        \n        \n        EXAMPLES::\n        \n            >>> pari(2).zeta()\n            1.64493406684823\n            >>> x = pari.pi()**2/6\n            >>> pari(x)\n            1.64493406684823\n            >>> pari(3).zeta()\n            1.20205690315959\n            >>> pari('1+5*7+2*7^2+O(7^3)').zeta()\n            4*7^-2 + 5*7^-1 + O(7^0)\n        ";
static char __pyx_k_A_mathnf_flag_0_upper_triangula[] = "\n        A.mathnf(flag=0): (upper triangular) Hermite normal form of A,\n        basis for the lattice formed by the columns of A.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - optional, value range from 0 to 4 (0 if\n           omitted), meaning : 0: naive algorithm\n        \n        -  ``1: Use Batut's algorithm`` - output 2-component\n           vector [H,U] such that H is the HNF of A, and U is a unimodular\n           matrix such that xU=H. 3: Use Batut's algorithm. Output [H,U,P]\n           where P is a permutation matrix such that P A U = H. 4: As 1, using\n           a heuristic variant of LLL reduction along the way.\n        \n        \n        EXAMPLES::\n        \n            >>> pari('[1,2,3; 4,5,6;  7,8,9]').mathnf()\n            [6, 1; 3, 1; 0, 1]\n        ";
static char __pyx_k_BIG_WARNING_The_number_s_wasn_t[] = "BIG WARNING: The number %s wasn't split at all by PARI,but it's definitely composite.";
static char __pyx_k_Bessel_I_function_Bessel_functi[] = "\n        Bessel I function (Bessel function of the second kind), with index\n        `\\nu` and argument `x`. If `x` converts to\n        a power series, the initial factor\n        `(x/2)^{\\nu}/\\Gamma(\\nu+1)` is omitted (since it cannot be\n        represented in PARI when `\\nu` is not integral).\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).besseli(3)\n            2.24521244092995\n            >>> pari(2).besseli('3+I')\n            1.12539407613913 + 2.08313822670661*I\n        ";
static char __pyx_k_Bessel_J_function_Bessel_functi[] = "\n        Bessel J function (Bessel function of the first kind), with index\n        `\\nu` and argument `x`. If `x` converts to\n        a power series, the initial factor\n        `(x/2)^{\\nu}/\\Gamma(\\nu+1)` is omitted (since it cannot be\n        represented in PARI when `\\nu` is not integral).\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).besselj(3)\n            0.486091260585891\n        ";
static char __pyx_k_Check_whether_a_and_b_are_equal[] = "\n        Check whether `a` and `b` are equal using PARI's ``gequal``.\n        \n        EXAMPLES::\n            \n            >>> a = pari(1); b = pari(1.0); c = pari('\"some_string\"')\n            >>> a.gequal(a)\n            True\n            >>> b.gequal(b)\n            True\n            >>> c.gequal(c)\n            True\n            >>> a.gequal(b)\n            True\n            >>> a.gequal(c)\n            False\n        \n        WARNING: this relation is not transitive::\n            \n            >>> a = pari('[0]'); b = pari(0); c = pari('[0,0]')\n            >>> a.gequal(b)\n            True\n            >>> b.gequal(c)\n            True\n            >>> a.gequal(c)\n            False\n        ";
static char __pyx_k_Check_whether_a_is_equal_to_the[] = "\n        Check whether `a` is equal to the ``long int`` `b` using PARI's ``gequalsg``.\n        \n        EXAMPLES::\n            \n            >>> a = pari(1); b = pari(2.0); c = pari('3*matid(3)')\n            >>> a.gequal_long(1)\n            True\n            >>> a.gequal_long(-1)\n            False\n            >>> a.gequal_long(0)\n            False\n            >>> b.gequal_long(2)\n            True\n            >>> b.gequal_long(-2)\n            False\n            >>> c.gequal_long(3)\n            True\n            >>> c.gequal_long(-3)\n            False\n        ";
static char __pyx_k_Check_whether_a_is_equal_to_zer[] = "\n        Check whether `a` is equal to zero.\n        \n        EXAMPLES::\n            \n            >>> pari(0).gequal0()\n            True\n            >>> pari(1).gequal0()\n            False\n            >>> pari(1e-100).gequal0()\n            False\n            >>> pari(\"0.0 + 0.0*I\").gequal0()\n            True\n        ";
static char __pyx_k_Convert_from_pari_real_precisio[] = "\n    Convert from pari real precision expressed in words to precision\n    expressed in bits. Note: this adjusts for the two codewords of a\n    pari real, and is architecture-dependent.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_words_to_bits(10)   # 32-bit: 256\n        512\n\n        # 32-bit: [(3, 32), (4, 64), (5, 96), (6, 128), (7, 160), (8, 192), (9, 224)]\n        >>> [(n,gen.prec_words_to_bits(n)) for n in range(3,10)]\n        [(3, 64), (4, 128), (5, 192), (6, 256), (7, 320), (8, 384), (9, 448)]\n    \n    ";
static char __pyx_k_Convert_from_precision_expresse[] = "\n    Convert from precision expressed in bits to precision expressed in\n    decimal.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_bits_to_dec(53)\n        15\n        >>> [(32*n,gen.prec_bits_to_dec(32*n)) for n in range(1,9)]\n        [(32, 9), (64, 19), (96, 28), (128, 38), (160, 48), (192, 57), (224, 67), (256, 77)]\n        ";
static char __pyx_k_Create_the_PARI_object_obtained[] = "\n        Create the PARI object obtained by evaluating s using PARI.\n        \n        EXAMPLES::\n        \n            >>> pari([2,3,5])\n            [2, 3, 5]\n            >>> pari('[0,1;2,3]')\n            [0, 1; 2, 3]\n            >>> pari('x^2-3')\n            x^2 - 3\n        \n        ::\n        \n            >>> a = pari(1); a, a.type()\n            (1, 't_INT')\n            >>> a = pari('1/2'); a, a.type()\n            (1/2, 't_FRAC')\n\n        See :func:`pari` for more examples.\n        ";
static char __pyx_k_Creates_a_PARI_t_REAL_with_valu[] = " \n        Creates a PARI t_REAL with value given by the float x, coerced\n        to at least the given precision.  The resulting gen object\n        will have word length (not including codewords) which is large\n        enough to provide the requested number of bits, but no larger.\n        >>> old_precision = pari.set_real_precision(64)\n        >>> x = pari._real_coerced_to_bits_prec(1.23456789012345678, 100)\n        >>> x\n        1.23456789012345669043213547411141917110\n        >>> x.length()\n        2\n        >>> pari.set_real_precision(old_precision)\n\t64\n\n        Here the pari gen uses two 64 bit words to provide at least\n        100 bits of precision.  This can be used, for example, to convert\n        quad-double numbers to pari numbers.\n        ";
static char __pyx_k_Determine_whether_or_not_self_i[] = "\n        Determine whether or not self is a perfect k-th power. If k is not\n        specified, find the largest k so that self is a k-th power.\n        \n        .. note:::\n\n           There is a BUG in the PARI C-library function (at least in\n           PARI 2.2.12-beta) that is used to implement this function! This is\n           in GP::\n        \n              ? p=nextprime(10^100); n=p^100; m=p^2; m^50==n; ispower(n,50)\n                    \n        \n        INPUT:\n        \n        \n        -  ``k`` - int (optional)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``power`` - int, what power it is\n        \n        -  ``g`` - what it is a power of\n        \n        \n        EXAMPLES::\n        \n            >>> pari(9).ispower()\n            (2, 3)\n            >>> pari(17).ispower()\n            (1, 17)\n            >>> pari(17).ispower(2)\n            (False, None)\n            >>> pari(17).ispower(1)\n            (1, 17)\n            >>> pari(2).ispower()\n            (1, 2)\n        ";
static char __pyx_k_EXAMPLES_We_construct_a_relativ[] = "\n        EXAMPLES: We construct a relative number field.\n        \n        ::\n        \n            >>> f = pari('y^3+y+1')\n            >>> K = f.nfinit()\n            >>> x = pari('x'); y = pari('y')\n            >>> g = pari('x^5 - x^2 + y')\n            >>> L = K.rnfinit(g)\n        ";
static char __pyx_k_EXAMPLES_f_pari_x_2_y_3_x_y_f_x[] = "\n        EXAMPLES::\n        \n            >>> f = pari(\"x^2 + y^3 + x*y\")\n            >>> f\n            x^2 + y*x + y^3\n            >>> f.polcoeff(1)\n            y\n            >>> f.polcoeff(3)\n            0\n            >>> f.polcoeff(3, \"y\")\n            1\n            >>> f.polcoeff(1, \"y\")\n            x\n        ";
static char __pyx_k_EXAMPLES_n_pari_set_real_precis[] = "\n        EXAMPLES::\n        \n            >>> n = pari.set_real_precision(210)\n            >>> w1 = pari('z1=2-sqrt(26); (z1+I)/(z1-I)')\n            >>> f = w1.algdep(12); f\n            545*x^11 - 297*x^10 - 281*x^9 + 48*x^8 - 168*x^7 + 690*x^6 - 168*x^5 + 48*x^4 - 281*x^3 - 297*x^2 + 545*x\n            >>> f(w1).abs() < 1.0e-200\n            True\n            >>> f.factor()\n            [x, 1; x + 1, 2; x^2 + 1, 1; x^2 + x + 1, 1; 545*x^4 - 1932*x^3 + 2790*x^2 - 1932*x + 545, 1]\n            >>> pari.set_real_precision(n)\n            210\n        ";
static char __pyx_k_EXAMPLES_pari_10_issquarefree_T[] = "\n        EXAMPLES::\n        \n            >>> pari(10).issquarefree()\n            True\n            >>> pari(20).issquarefree()\n            False\n        ";
static char __pyx_k_Edited_from_the_pari_documentat[] = "\n        Edited from the pari documentation:\n\n        nfgaloisconj(nf): list of conjugates of a root of the\n        polynomial x=nf.pol in the same number field.\n\n        Uses a combination of Allombert's algorithm and nfroots.\n\n        EXAMPLES::\n\n            >>> nf = pari('x^2 + 2').nfinit()\n            >>> nf.nfgaloisconj()\n            [-x, x]~\n            >>> nf = pari('x^3 + 2').nfinit()\n            >>> nf.nfgaloisconj()\n            [x]~\n            >>> nf = pari('x^4 + 2').nfinit()\n            >>> nf.nfgaloisconj()\n            [-x, x]~\n        ";
static char __pyx_k_Factorization_of_the_polynomial[] = "\n        Factorization of the polynomial ``self`` over the number field\n        defined by the polynomial ``t``.  This does not require that `t`\n        is integral, nor that the discriminant of the number field can be\n        factored.\n\n        EXAMPLES::\n\n            >>> pari('x^2-2').factornf(pari('a^2 - 1/8'))\n            [x + Mod(-4*a, 8*a^2 - 1), 1; x + Mod(4*a, 8*a^2 - 1), 1]\n        ";
static char __pyx_k_For_real_x_return_the_largest_i[] = "\n        For real x: return the largest integer = x. For rational functions:\n        the quotient of numerator by denominator. For lists: apply\n        componentwise.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('5/9').floor()\n            0\n            >>> pari('11/9').floor()\n            1\n            >>> pari(1.17).floor()\n            1\n            >>> pari([1.5,2.3,4.99]).floor()\n            [1, 2, 4]\n            >>> pari([[1.1,2.2],[3.3,4.4]]).floor()\n            [[1, 2], [3, 4]]\n            >>> pari('x').floor()\n            x\n            >>> pari('(x^2+x+1)/x').floor()\n            x + 1\n            >>> pari('x^2+5*x+2.5').floor()\n            x^2 + 5*x + 2.50000000000000\n        \n        ::\n        \n            >>> pari('\"hello world\"').floor()\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
static char __pyx_k_Given_an_INTMOD_or_POLMOD_Mod_a[] = "\n        Given an INTMOD or POLMOD ``Mod(a,m)``, return the modulus `m`.\n\n        EXAMPLES::\n\n            >>> pari(4).Mod(5).mod()\n            5\n            >>> pari(\"Mod(x, x*y)\").mod()\n            y*x\n            >>> pari(\"[Mod(4,5)]\").mod()\n            Traceback (most recent call last):\n            ...\n            TypeError: Not an INTMOD or POLMOD in mod()\n        ";
static char __pyx_k_Given_an_ideal_I_in_Hermite_nor[] = "\n        Given an ideal I in Hermite normal form and an element x of the pari \n        number field self, finds an element r in self such that x-r belongs \n        to the ideal and r is small.\n        \n        EXAMPLES::\n\n            >>> k = pari('x^2 + 5').nfinit()\n            >>> x = pari('x')\n            >>> I = k.idealhnf(x)\n            >>> k.nfeltreduce(12, I)\n            [2, 0]~\n        ";
static char __pyx_k_Given_two_integral_ideals_x_and[] = "\n        Given two integral ideals x and y of a pari number field self,\n        return an element a of the field (expressed in the integral\n        basis of self) such that a*x is an integral ideal coprime to\n        y.\n        \n        EXAMPLES::\n\n            >>> nf = pari('x^3-2').nfinit()\n            >>> x = pari('[1, -1, 2]~')\n            >>> y = pari('[1, -1, 3]~')\n            >>> nf.idealcoprime(x, y)\n            [1, 0, 0]~\n\n            >>> y = pari('[2, -2, 4]~')\n            >>> nf.idealcoprime(x, y)\n            [5/43, 9/43, -1/43]~\n        ";
static char __pyx_k_In_self_replace_the_variable_va[] = "\n        In ``self``, replace the variable ``var`` by the expression `z`.\n\n        EXAMPLES::\n        \n            >>> x = pari(\"x\"); y = pari(\"y\")\n            >>> f = pari('x^3 + 17*x + 3')\n            >>> f.subst(x, y)\n            y^3 + 17*y + 3\n            >>> f.subst(x, \"z\")\n            z^3 + 17*z + 3\n            >>> f.subst(x, \"z\")**2\n            z^6 + 34*z^4 + 6*z^3 + 289*z^2 + 102*z + 9\n            >>> f.subst(x, \"x+1\")\n            x^3 + 3*x^2 + 20*x + 21\n            >>> f.subst(x, \"xyz\")\n            xyz^3 + 17*xyz + 3\n            >>> f.subst(x, \"xyz\")**2\n            xyz^6 + 34*xyz^4 + 6*xyz^3 + 289*xyz^2 + 102*xyz + 9\n        ";
static char __pyx_k_In_self_which_must_be_a_t_POL_o[] = "\n        In ``self``, which must be a ``t_POL`` or ``t_SER``, set the\n        variable to ``var``.  If the variable of ``self`` is already\n        ``var``, then return ``self``.\n\n        .. WARNING::\n\n            You should be careful with variable priorities when\n            applying this on a polynomial or series of which the\n            coefficients have polynomial components.  To be safe, only\n            use this function on polynomials with integer or rational\n            coefficients.  For a safer alternative, use :meth:`subst`.\n\n        EXAMPLES::\n        \n            >>> f = pari('x^3 + 17*x + 3')\n            >>> f.change_variable_name(\"y\")\n            y^3 + 17*y + 3\n            >>> f = pari('1 + 2*y + O(y^10)')\n            >>> f.change_variable_name(\"q\")\n            1 + 2*q + O(q^10)\n            >>> f.change_variable_name(\"y\") is f\n            True\n\n        In PARI, ``I`` refers to the square root of -1, so it cannot be\n        used as variable name.  Note the difference with :meth:`subst`::\n\n            >>> f = pari('x^2 + 1')\n            >>> f.change_variable_name(\"I\")\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n            >>> f.subst(\"x\", \"I\")\n            0\n        ";
static char __pyx_k_Interface_to_the_PARI_C_library[] = "Interface to the PARI C library";
static char __pyx_k_J_Bessel_function_of_half_integ[] = "\n        J-Bessel function of half integral index (Spherical Bessel\n        function of the first kind). More precisely, besseljh(n,x) computes\n        `J_{n+1/2}(x)` where n must an integer, and x is any\n        complex value. In the current implementation (PARI, version\n        2.2.11), this function is not very accurate when `x` is\n        small.\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).besseljh(3)   #32-bit: 0.4127100324\n            0.412710032209716\n        ";
static char __pyx_k_List_x_transforms_the_PARI_vect[] = "\n        List(x): transforms the PARI vector or list x into a list.\n        \n        EXAMPLES::\n        \n            >>> v = pari([1,2,3])\n            >>> v\n            [1, 2, 3]\n            >>> v.type()\n            't_VEC'\n            >>> w = v.List()\n            >>> w\n            List([1, 2, 3])\n            >>> w.type()\n            't_LIST'\n        ";
static char __pyx_k_Logarithm_of_the_gamma_function[] = "\n        Logarithm of the gamma function of x.\n        \n        This function returns the principal branch of the logarithm of the\n        gamma function of `x`. The function\n        `\\log(\\Gamma(x))` is analytic on the complex plane with\n        non-positive integers removed. This function can have much larger\n        inputs than `\\Gamma` itself.\n        \n        The `p`-adic analogue of this function is unfortunately not\n        implemented.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(100).log_gamma()\n            359.134205369575\n        ";
static char __pyx_k_M_matfrobenius_flag_0_Return_th[] = "\n        M.matfrobenius(flag=0): Return the Frobenius form of the square\n        matrix M. If flag is 1, return only the elementary divisors (a list\n        of polynomials). If flag is 2, return a two-components vector [F,B]\n        where F is the Frobenius form and B is the basis change so that\n        `M=B^{-1} F B`.\n        \n        EXAMPLES::\n        \n            >>> a = pari('[1,2;3,4]')\n            >>> a.matfrobenius()\n            [0, 2; 1, 5]\n            >>> a.matfrobenius(flag=1)\n            [x^2 - 5*x - 2]\n            >>> a.matfrobenius(2)\n            [[0, 2; 1, 5], [1, -1/3; 0, 1/3]]\n            >>> v = a.matfrobenius(2)\n            >>> v[0]\n            [0, 2; 1, 5]\n            >>> v[1]**(-1)*v[0]*v[1]\n            [1, 2; 3, 4]\n        \n        We let t be the matrix of `T_2` acting on modular symbols\n        of level 43, which was computed using\n        ``ModularSymbols(43,sign=1).T(2).matrix()``::\n        \n            >>> t = pari('[3, -2, 0, 0; 0, -2, 0, 1; 0, -1, -2, 2; 0, -2, 0, 2]')\n            >>> t.matfrobenius()\n            [0, 0, 0, -12; 1, 0, 0, -2; 0, 1, 0, 8; 0, 0, 1, 1]\n            >>> t.charpoly('x')\n            x^4 - x^3 - 8*x^2 + 2*x + 12\n            >>> t.matfrobenius(1)\n            [x^4 - x^3 - 8*x^2 + 2*x + 12]\n        \n        AUTHORS:\n\n        - Martin Albrect (2006-04-02)\n        ";
static char __pyx_k_Mat_x_Returns_the_matrix_define[] = "\n        Mat(x): Returns the matrix defined by x.\n        \n        - If x is already a matrix, a copy of x is created and returned.\n        \n        - If x is not a vector or a matrix, this function returns a 1x1\n          matrix.\n        \n        - If x is a row (resp. column) vector, this functions returns\n          a 1-row (resp. 1-column) matrix, *unless* all elements are\n          column (resp. row) vectors of the same length, in which case\n          the vectors are concatenated sideways and the associated big\n          matrix is returned.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - a PARI matrix\n        \n        \n        EXAMPLES::\n        \n            >>> x = pari(5)\n            >>> x.type()\n            't_INT'\n            >>> y = x.Mat()\n            >>> y\n            Mat(5)\n            >>> y.type()\n            't_MAT'\n            >>> x = pari('[1,2;3,4]')\n            >>> x.type()\n            't_MAT'\n            >>> x = pari('[1,2,3,4]')\n            >>> x.type()\n            't_VEC'\n            >>> y = x.Mat()\n            >>> y\n            Mat([1, 2, 3, 4])\n            >>> y.type()\n            't_MAT'\n        \n        ::\n        \n            >>> v = pari('[1,2;3,4]').Vec(); v\n            [[1, 3]~, [2, 4]~]\n            >>> v.Mat()\n            [1, 2; 3, 4]\n            >>> v = pari('[1,2;3,4]').Col(); v\n            [[1, 2], [3, 4]]~\n            >>> v.Mat()\n            [1, 2; 3, 4]\n        ";
static char __pyx_k_Mod_x_y_Returns_the_object_x_mo[] = "\n        Mod(x, y): Returns the object x modulo y, denoted Mod(x, y).\n        \n        The input y must be a an integer or a polynomial:\n        \n        - If y is an INTEGER, x must also be an integer, a rational\n          number, or a p-adic number compatible with the modulus y.\n        \n        - If y is a POLYNOMIAL, x must be a scalar (which is not a\n          polmod), a polynomial, a rational function, or a power\n          series.\n        \n        .. warning::\n\n           This function is not the same as ``x % y`` which is an\n           integer or a polynomial.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``y`` - integer or polynomial\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - intmod or polmod\n        \n        \n        EXAMPLES::\n        \n            >>> z = pari(3)\n            >>> x = z.Mod(pari(7))\n            >>> x\n            Mod(3, 7)\n            >>> x**2\n            Mod(2, 7)\n            >>> x**100\n            Mod(4, 7)\n            >>> x.type()\n            't_INTMOD'\n        \n        ::\n        \n            >>> f = pari(\"x^2 + x + 1\")\n            >>> g = pari(\"x\")\n            >>> a = g.Mod(f)\n            >>> a\n            Mod(x, x^2 + x + 1)\n            >>> a*a\n            Mod(-x - 1, x^2 + x + 1)\n            >>> a.type()\n            't_POLMOD'\n        ";
static char __pyx_k_PARI_C_library_interface_AUTHOR[] = "\nPARI C-library interface\n\nAUTHORS:\n\n- William Stein (2006-03-01): updated to work with PARI 2.2.12-beta\n\n- William Stein (2006-03-06): added newtonpoly\n\n- Justin Walker: contributed some of the function definitions\n\n- Gonzalo Tornaria: improvements to conversions; much better error\n  handling.\n\n- Robert Bradshaw, Jeroen Demeyer, William Stein (2010-08-15):\n  Upgrade to PARI 2.4.3 (#9343)\n\n- Jeroen Demeyer (2011-11-12): rewrite various conversion routines\n  (#11611, #11854, #11952)\n\n- Marc Culler and Nathan Dunfield (2012-06-12): converted to a standalone\n  python extension module, for use in SnapPy.\n  \nEXAMPLES::\n\n    >>> pari('5! + 10/x')\n    (120*x + 10)/x\n    >>> pari('intnum(x=0,13,sin(x)+sin(x^2) + x)')\n    85.1885681951527\n    >>> f = pari('x^3-1')\n    >>> v = f.factor(); v\n    [x - 1, 1; x^2 + x + 1, 1]\n    >>> v[0]   # indexing is 0-based unlike in GP.\n    [x - 1, x^2 + x + 1]~\n    >>> v[1]\n    [1, 1]~\n\nArithmetic obeys the usual coercion rules::\n\n    >>> isinstance((pari(1) + 1), gen)\n    True\n    >>> isinstance(1 + pari(1), gen)\n    True\n\nGUIDE TO REAL PRECISION AND THE PARI LIBRARY\n\nPARI stores all numeric values as arrays of so-called longwords, which\nmay be either 64 bits or 32 bits.  Usually the longword size is 32\nbits on 32 bit systems and 64 bits on 64 bit systems.  The PARI\nlibrary maintains an environment variable, referred to as the real\nprecision.  The meaning of this is as follows.  If the real precision\nis N then all PARI real numbers are printed to at most N\nsignificant decimal digits (even if the internal values are more\nprecise), and all new values are created with a binary precision which\nis the smallest multiple of the longword size which can provide a\nprecision of at least N decimal digits.\n\nA standard floating point number has a binary precision of 53 bits,\nwhich is approximately equivalent to 15 decimal digits.\nIn this package the default real precision is 15, which allows imp""orted\nfloating point values to be printed to their full decimal precision.\nHowever, this means that the default PARI representation has a\nprecision of 64 bits.\nThe default real precision for floating point numbers is\n53 bits.  Inexact PARI objects are therefore printed by default to 15\ndecimal digits (even if they are actually more precise).  In fact, the\ndefault real precision in PARI is 64 bits.\n\nDefault precision example (53 bits, 15 significant decimals)::\n\n    >>> a = pari(1.23); a\n    1.23000000000000\n    >>> a.sin()\n    0.942488801931698\n\nIt is possible to change the real precision.\n\n    >>> old_prec = pari.set_real_precision(60)  # 60 decimals printed\n    >>> a = pari(1.23); a  # PARI imports the float with 64 bits of precision.\n    1.2299999999999999823\n    >>> a.length() # It occupies 1 PARI longword (on 64 bit systems)\n    1\n    >>> a = pari('1.23'); a  # Now PARI will generate a 60 digit value\n    1.23000000000000000000000000000000000000000000000000000000000\n    >>> a.length() # It has 256 bits of precision in PARI.\n    4\n    >>> a.sin()\n    0.942488801931697510023823565389244541461287405627650302135039\n    >>> b = pari('2.870198234701928740192874091287401928740129874');b\n    2.87019823470192874019287409128740192874012987400000000000000\n    >>> pari.set_real_precision(old_prec)  # restore the default behavior\n    60\n\nUnless otherwise indicated in the docstring, most PARI functions\nthat return inexact objects use the precision of their arguments to\ndecide the precision of the computation. However, if some of these\narguments happen to be exact numbers (integers, rationals, etc.),\nan optional parameter indicates the precision (in bits) to which\nthese arguments should be converted before the computation. If this\nprecision parameter is missing, the default precision of 64 bits is\nused. The following first converts 2 into a real with 64-bit\nprecision::\n\n    >>> pari(2).sin()\n    0.909297426825682\n\nWe can ask for a"" higher precision using the optional parameter::\n\n    >>> old_prec = pari.set_real_precision(60)\n    >>> pari(2).sin(precision=150)\n    0.9092974268256816953960198659117448427022549714478902683790\n    >>> pari.set_real_precision(old_prec)\n    60\n    \nElliptic curves and precision: If you are working with elliptic\ncurves and want to compute with a precision other than the default,\nyou should use the precision parameter of ellinit()::\n\n    >>> e = pari([0,0,0,-82,0]).ellinit(precision=150)\n    >>> eta1 = e.elleta()[0]\n    >>> eta1\n    3.60546360143265\n    >>> old_prec = pari.set_real_precision(45)\n    >>> eta1\n    3.60546360143265208591582056420772677481026900\n    >>> pari.set_real_precision(old_prec)\n    45\n    \nNumber fields and precision: TODO\n\nTESTS:\n\nCheck that output from PARI's print command is actually seen::\n\n    >>> pari('print(\"test\")')\n    test\n\n";
static char __pyx_k_PariInstance___call___line_9300[] = "PariInstance.__call__ (line 9300)";
static char __pyx_k_PariInstance_polcyclo_line_9677[] = "PariInstance.polcyclo (line 9677)";
static char __pyx_k_Pol_x_v_convert_x_into_a_polyno[] = "\n        Pol(x, v): convert x into a polynomial with main variable v and\n        return the result.\n        \n        - If x is a scalar, returns a constant polynomial.\n        \n        - If x is a power series, the effect is identical to\n          ``truncate``, i.e. it chops off the `O(X^k)`.\n        \n        - If x is a vector, this function creates the polynomial whose\n          coefficients are given in x, with x[0] being the leading\n          coefficient (which can be zero).\n        \n        .. warning::\n\n           This is *not* a substitution function. It will not\n           transform an object containing variables of higher priority\n           than v::\n        \n               >>>\n               Traceback (most recent call last):\n               ...\n               PariError:  (5)\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``v`` - (optional) which variable, defaults to 'x'\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - a polynomial\n        \n        \n        EXAMPLES::\n        \n            >>> v = pari(\"[1,2,3,4]\")\n            >>> f = v.Pol()\n            >>> f\n            x^3 + 2*x^2 + 3*x + 4\n            >>> f*f\n            x^6 + 4*x^5 + 10*x^4 + 20*x^3 + 25*x^2 + 24*x + 16\n        \n        ::\n        \n            >>> v = pari(\"[1,2;3,4]\")\n            >>> v.Pol()\n            [1, 3]~*x + [2, 4]~\n        ";
static char __pyx_k_Polrev_x_v_Convert_x_into_a_pol[] = "\n        Polrev(x, v): Convert x into a polynomial with main variable v and\n        return the result. This is the reverse of Pol if x is a vector,\n        otherwise it is identical to Pol. By \"reverse\" we mean that the\n        coefficients are reversed.\n        \n        INPUT:\n        \n        -  ``x`` - gen\n        \n        OUTPUT:\n        \n        -  ``gen`` - a polynomial\n        \n        EXAMPLES::\n        \n            >>> v = pari(\"[1,2,3,4]\")\n            >>> f = v.Polrev()\n            >>> f\n            4*x^3 + 3*x^2 + 2*x + 1\n            >>> v.Pol()\n            x^3 + 2*x^2 + 3*x + 4\n            >>> v.Polrev('y')\n            4*y^3 + 3*y^2 + 2*y + 1\n        \n        Note that Polrev does *not* reverse the coefficients of a\n        polynomial! ::\n        \n            >>> f\n            4*x^3 + 3*x^2 + 2*x + 1\n            >>> f.Polrev()\n            4*x^3 + 3*x^2 + 2*x + 1\n            >>> v = pari(\"[1,2;3,4]\")\n            >>> v.Polrev()\n            [2, 4]~*x + [1, 3]~\n        ";
static char __pyx_k_Prime_ideal_decomposition_of_th[] = "\n        Prime ideal decomposition of the prime number `p` in the number\n        field `nf` as a vector of 5 component vectors `[p,a,e,f,b]`\n        representing the prime ideals `p O_K + a O_K`, `e` ,`f` as usual,\n        `a` as vector of components on the integral basis, `b` Lenstra's\n        constant.\n        \n        EXAMPLES::\n            \n            >>> K = pari('x^2+1').nfinit()\n            >>> F = K.idealprimedec(5); F\n            [[5, [-2, 1]~, 1, 1, [2, 1]~], [5, [2, 1]~, 1, 1, [-2, 1]~]]\n            >>> F[0].pr_get_p()\n            5\n        ";
static char __pyx_k_Qfb_a_b_c_D_0_Returns_the_binar[] = "\n        Qfb(a,b,c,D=0.): Returns the binary quadratic form\n        \n        .. math::\n        \n                                ax^2 + bxy + cy^2.         \n        \n        \n        The optional D is 0 by default and initializes Shank's distance if\n        `b^2 - 4ac > 0`.  The discriminant of the quadratic form must not\n        be a perfect square.\n        \n        .. note::\n\n           Negative definite forms are not implemented, so use their\n           positive definite counterparts instead. (I.e., if f is a\n           negative definite quadratic form, then -f is positive\n           definite.)\n        \n        INPUT:\n        \n        \n        -  ``a`` - gen\n        \n        -  ``b`` - gen\n        \n        -  ``c`` - gen\n        \n        -  ``D`` - gen (optional, defaults to 0)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - binary quadratic form\n        \n        \n        EXAMPLES::\n        \n            >>> pari(3).Qfb(7, 1)\n            Qfb(3, 7, 1, 0.E-19)\n            >>> pari(3).Qfb(7, 2)  # discriminant is 25\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n        ";
static char __pyx_k_Read_a_script_from_the_named_fi[] = "\n        Read a script from the named filename into the interpreter.  The\n        functions defined in the script are then available for use from\n        Sage/PARI.  The result of the last command in ``filename`` is\n        returned.\n        \n        EXAMPLES:\n        \n        Create a gp file::\n        \n            >>> import tempfile\n            >>> gpfile = tempfile.NamedTemporaryFile(mode=\"w\")\n            >>> n = gpfile.file.write(\"mysquare(n) = {\\n\")\n            >>> n = gpfile.file.write(\"    n^2;\\n\")\n            >>> n = gpfile.file.write(\"}\\n\")\n            >>> n = gpfile.file.write(\"polcyclo(5)\\n\")\n            >>> gpfile.file.flush()\n        \n        Reading it in, we get the result of the last line::\n\n            >>> pari.read(gpfile.name)\n            x^4 + x^3 + x^2 + x + 1\n\n        Call the function defined in the gp file::\n\n            >>> pari('mysquare(12)')\n            144\n        ";
static char __pyx_k_Recompute_the_primes_table_incl[] = "\n        Recompute the primes table including at least all primes up to M\n        (but possibly more).\n        \n        EXAMPLES::\n        \n            >>> pari.init_primes(200000)\n\n        We make sure that ticket #11741 has been fixed, and double check to\n        make sure that diffptr has not been freed::\n\n            >>> pari.init_primes(2**62)\n            Traceback (most recent call last):\n            ...\n            PariError: not enough memory (28)            # 64-bit\n            OverflowError: long int too large to convert # 32-bit\n            >>> pari.init_primes(200000)\n        ";
static char __pyx_k_Return_Python_int_Very_fast_and[] = "\n        Return Python int. Very fast, and if the number is too large to fit\n        into a C int, a Python long is returned instead.\n        \n        EXAMPLES::\n        \n            >>> int(pari(0))\n            0\n            >>> int(pari(10))\n            10\n            >>> int(pari(-10))\n            -10\n            >>> print( int(pari(123456789012345678901234567890)) )\n            123456789012345678901234567890\n            >>> print( int(pari(-123456789012345678901234567890)) )\n            -123456789012345678901234567890\n            >>> int(pari('2^31-1'))\n            2147483647\n            >>> int(pari('-2^31'))\n            -2147483648\n            >>> int(pari(\"Pol(10)\"))\n            10\n        ";
static char __pyx_k_Return_a_Python_list_of_the_PAR[] = "\n        Return a Python list of the PARI gens. This object must be of type\n        t_VECSMALL, and the resulting list contains python 'int's\n        \n        EXAMPLES::\n        \n            >>> v=pari([1,2,3,10,102,10]).Vecsmall()\n            >>> w = v.python_list_small()\n            >>> w\n            [1, 2, 3, 10, 102, 10]\n            >>> isinstance(w[0], int)\n            True\n        ";
static char __pyx_k_Return_a_basis_of_the_kernel_of[] = "\n        Return a basis of the kernel of this matrix.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - optional; may be set to 0: default;\n           non-zero: x is known to have integral entries.\n        \n        \n        EXAMPLES::\n        \n            >>> pari('[1,2,3;4,5,6;7,8,9]').matker()\n            [1; -2; 1]\n        \n        With algorithm 1, even if the matrix has integer entries the kernel\n        need not be saturated (which is weird)::\n        \n            >>> pari('[1,2,3;4,5,6;7,8,9]').matker(1)\n            [3; -6; 3]\n            >>> pari('matrix(3,3,i,j,i)').matker()\n            [-1, -1; 1, 0; 0, 1]\n            >>> pari('[1,2,3;4,5,6;7,8,9]*Mod(1,2)').matker()\n            [Mod(1, 2); Mod(0, 2); Mod(1, 2)]\n        ";
static char __pyx_k_Return_a_python_integer_represe[] = "\n        Return a python integer representing self.  Used by the hex builtin.\n        \n        EXAMPLES::\n        \n            >>> print( hex(pari(0)) )\n            0x0\n            >>> print( hex(pari(15)) )\n            0xf\n            >>> print( hex(pari(16)) )\n            0x10\n            >>> print( hex(pari(16938402384092843092843098243)) )\n            0x36bb1e3929d1a8fe2802f083\n            >>> print( hex(pari(-16938402384092843092843098243)) )\n            -0x36bb1e3929d1a8fe2802f083\n        ";
static char __pyx_k_Return_self_1_OUTPUT_pari_gen_E[] = "\n        Return self + 1.\n        \n        OUTPUT: pari gen\n        \n        EXAMPLES::\n        \n            >>> n = pari(5)\n            >>> n._add_one()\n            6\n            >>> n = pari('x^3')\n            >>> n._add_one()\n            x^3 + 1\n        ";
static char __pyx_k_Return_self_as_a_Python_complex[] = "\n        Return ``self`` as a Python ``complex``\n        value.\n        \n        EXAMPLES::\n        \n            >>> g = pari('(-1.0)^(1/5)'); g\n            0.809016994374947 + 0.587785252292473*I\n            >>> g.__complex__()\n            (0.8090169943749475+0.5877852522924731j)\n            >>> complex(g)            \n            (0.8090169943749475+0.5877852522924731j)\n        \n        ::\n        \n            >>> g = pari('Mod(3,5)'); g\n            Mod(3, 5)\n            >>> complex(g)\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
static char __pyx_k_Return_the_Euler_phi_function_o[] = "\n        Return the Euler phi function of n. EXAMPLES::\n        \n            >>> pari(10).phi()\n            4\n        ";
static char __pyx_k_Return_the_PARI_type_of_self_as[] = "\n        Return the PARI type of self as a string.\n        \n        .. note::\n\n           In Cython, it is much faster to simply use typ(self.g) for\n           checking PARI types.\n        \n        EXAMPLES::\n        \n            >>> pari(7).type()\n            't_INT'\n            >>> pari('x').type()\n            't_POL'\n        ";
static char __pyx_k_Return_the_big_ideal_bid_struct[] = "\n        Return the big ideal (bid) structure of modulus I.\n\n        INPUT:\n            \n        - ``self`` - a pari number field\n\n        - ``I`` -- an ideal of self, or a row vector whose first\n          component is an ideal and whose second component \n          is a row vector of r_1 0 or 1. \n           \n        - ``flag`` - determines the amount of computation and the shape\n          of the output:\n          \n          - ``1`` (default): return a bid structure without\n            generators \n                    \n          - ``2``: return a bid structure with generators (slower)\n                    \n          - ``0`` (deprecated): only outputs units of (ring of integers/I)\n            as an abelian group, i.e as a 3-component\n            vector [h,d,g]: h is the order, d is the vector\n            of SNF cyclic components and g the corresponding \n            generators. This flag is deprecated: it is in\n            fact slightly faster to compute a true bid\n            structure, which contains much more information.        \n\n        EXAMPLE::\n\n            >>> nf = pari('x^3-2').nfinit()\n            >>> I = pari('[1, -1, 2]~')\n            >>> nf.idealstar(I)\n            [[[43, 9, 5; 0, 1, 0; 0, 0, 1], [0]], [42, [42]], Mat([[43, [9, 1, 0]~, 1, 1, [-5, -9, 1]~], 1]), [[[[42], [[3, 0, 0]~], [[3, 0, 0]~], [Vecsmall([])], 1]], [[], [], []]], Mat(1)]\n        ";
static char __pyx_k_Return_the_discrete_logarithm_o[] = "\n        Return the discrete logarithm of the unit x in (ring of integers)/bid.\n\n        INPUT:\n            \n        - ``self`` - a pari number field\n\n        - ``bid``  - a big ideal structure (corresponding to an ideal I\n          of self) output by idealstar\n\n        - ``x``  - an element of self with valuation zero at all\n          primes dividing I\n        \n        OUTPUT:\n            \n        - the discrete logarithm of x on the generators given in bid[2]\n\n        EXAMPLE::\n\n            >>> nf = pari('x^3-2').nfinit()\n            >>> I = pari('[1, -1, 2]~')\n            >>> bid = nf.idealstar(I)\n            >>> x = pari('5')\n            >>> nf.ideallog(x, bid)\n            [25]~\n        ";
static char __pyx_k_Return_the_factorial_of_the_int[] = "\n        Return the factorial of the integer n as a PARI gen.\n        \n        EXAMPLES::\n        \n            >>> pari.factorial(0)\n            1\n            >>> pari.factorial(1)\n            1\n            >>> pari.factorial(5)\n            120\n            >>> pari.factorial(25)\n            15511210043330985984000000\n        ";
static char __pyx_k_Return_the_factorization_of_x_I[] = "\n        Return the factorization of x.\n        \n        INPUT:\n        \n        \n        -  ``limit`` - (default: -1) is optional and can be set\n           whenever x is of (possibly recursive) rational type. If limit is\n           set return partial factorization, using primes up to limit (up to\n           primelimit if limit=0).\n        \n        \n        proof - (default: True) optional. If False (not the default),\n        returned factors `<10^{15}` may only be pseudoprimes.\n        \n        .. note::\n\n           In the standard PARI/GP interpreter and C-library the\n           factor command *always* has proof=False, so beware!\n        \n        EXAMPLES::\n        \n            >>> pari('x^10-1').factor()\n            [x - 1, 1; x + 1, 1; x^4 - x^3 + x^2 - x + 1, 1; x^4 + x^3 + x^2 + x + 1, 1]\n            >>> pari('2^100-1').factor()\n            [3, 1; 5, 3; 11, 1; 31, 1; 41, 1; 101, 1; 251, 1; 601, 1; 1801, 1; 4051, 1; 8101, 1; 268501, 1]\n            >>> pari('2^100-1').factor(proof=False)\n            [3, 1; 5, 3; 11, 1; 31, 1; 41, 1; 101, 1; 251, 1; 601, 1; 1801, 1; 4051, 1; 8101, 1; 268501, 1]\n        \n        We illustrate setting a limit::\n        \n            >>> (pari(10**50).nextprime()*pari(10**60).nextprime()*pari(10**4).nextprime()).factor(10**5)\n            [10007, 1; 100000000000000000000000000000000000000000000000151000000000700000000000000000000000000000000000000000000001057, 1]\n        \n        PARI doesn't have an algorithm for factoring multivariate\n        polynomials::\n        \n            >>> pari('x^3 - y^3').factor()\n            Traceback (most recent call last):\n            ...\n            PariError:  (7)\n        ";
static char __pyx_k_Return_the_first_n_Fourier_coef[] = "\n        Return the first `n` Fourier coefficients of the modular\n        form attached to this elliptic curve. See ellak for more details.\n        \n        INPUT:\n        \n        \n        -  ``n`` - a long integer\n        \n        -  ``python_ints`` - bool (default is False); if True,\n           return a list of Python ints instead of a PARI gen wrapper.\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.ellan(3)\n            [1, -2, -1]\n            >>> e.ellan(20)\n            [1, -2, -1, 2, 1, 2, -2, 0, -2, -2, 1, -2, 4, 4, -1, -4, -2, 4, 0, 2]\n            >>> e.ellan(-1)\n            []\n            >>> v = e.ellan(10, python_ints=True); v\n            [1, -2, -1, 2, 1, 2, -2, 0, -2, -2]\n            >>> isinstance(v, list)\n            True\n            >>> isinstance(v[0], int)\n            True\n        ";
static char __pyx_k_Return_the_hash_of_self_compute[] = "\n        Return the hash of self, computed using PARI's hash_GEN().\n        \n        TESTS::\n        \n            >>> isinstance( pari('1 + 2.0*I').__hash__(), int )\n            True\n        ";
static char __pyx_k_Return_the_least_common_multipl[] = "\n        Return the least common multiple of x and y. EXAMPLES::\n        \n            >>> pari(10).lcm(15)\n            30\n        ";
static char __pyx_k_Return_the_nth_entry_of_self_Th[] = "\n        Return the nth entry of self. The indexing is 0-based, like in\n        Python. Note that this is *different* than the default behavior\n        of the PARI/GP interpreter.\n        \n        EXAMPLES::\n        \n            >>> p = pari('1 + 2*x + 3*x^2')\n            >>> p[0]\n            1\n            >>> p[2]\n            3\n            >>> p[100]\n            0\n            >>> p[-1]\n            0\n            >>> q = pari('x^2 + 3*x^3 + O(x^6)')\n            >>> q[3]\n            3\n            >>> q[5]\n            0\n            >>> q[6]\n            Traceback (most recent call last):\n            ...\n            IndexError: index out of bounds\n            >>> m = pari('[1,2;3,4]')\n            >>> m[0]\n            [1, 3]~\n            >>> m[1,0]\n            3\n            >>> l = pari('List([1,2,3])')\n            >>> l[1]\n            2\n            >>> s = pari('\"hello, world!\"')\n            >>> s[0]\n            'h'\n            >>> s[4]\n            'o'\n            >>> s[12]\n            '!'\n            >>> s[13]\n            Traceback (most recent call last):\n            ...\n            IndexError: index out of bounds\n            >>> v = pari('[1,2,3]')\n            >>> v[0]\n            1\n            >>> c = pari('Col([1,2,3])')\n            >>> c[1]\n            2\n            >>> sv = pari('Vecsmall([1,2,3])')\n            >>> sv[2]\n            3\n            >>> isinstance(sv[2], int)\n            True\n            >>> tuple(pari('3/5'))\n            (3, 5)\n            >>> tuple(pari('1 + 5*I'))\n            (1, 5)\n            >>> tuple(pari('Qfb(1, 2, 3)'))\n            (1, 2, 3)\n            >>> pari(57)[0]\n            Traceback (most recent call last):\n            ...\n            TypeError: unindexable object\n            >>> m = pari(\"[[1,2;3,4],5]\") ; m[0][1,0]\n            3\n            >>> v = pari(xrange(20))\n            >>> v[2:5]\n            [2, 3, 4]\n            >>> v[:]\n            [0, 1, 2, 3, 4, ""5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> v[10:]\n            [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> v[:5]\n            [0, 1, 2, 3, 4]\n            >>> v\n            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> v[-1]\n            Traceback (most recent call last):\n            ...\n            IndexError: index out of bounds\n            >>> v[:-3]\n            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]\n            >>> v[5:]\n            [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> pari([])[::]\n            []\n        ";
static char __pyx_k_Return_the_number_of_columns_of[] = "\n        Return the number of columns of self.\n        \n        EXAMPLES::\n        \n            >>> pari('matrix(19,8)').ncols()\n            8\n        ";
static char __pyx_k_Return_the_number_of_divisors_o[] = "\n        Return the number of divisors of the integer n.\n        \n        EXAMPLES::\n        \n            >>> pari(10).numdiv()\n            4\n        ";
static char __pyx_k_Return_the_number_of_primes_alr[] = "\n        Return the number of primes already computed\n        in this PARI instance.\n\n        EXAMPLES:\n            >>> print( pari._primelimit() )\n            500000\n            >>> pari.init_primes(600000)\n            >>> print( pari._primelimit() )\n            600000\n        ";
static char __pyx_k_Return_the_number_of_primes_les[] = "\n        Return the number of primes less than or equal to self.\n        \n        EXAMPLES::\n        \n            >>> pari(7).primepi()\n            4\n            >>> pari(100).primepi()\n            25\n            >>> pari(1000).primepi()\n            168\n            >>> pari(100000).primepi()\n            9592\n            >>> pari(0).primepi()\n            0\n            >>> pari(-15).primepi()\n            0\n            >>> pari(500509).primepi()\n            41581\n        ";
static char __pyx_k_Return_the_number_of_rows_of_se[] = "\n        Return the number of rows of self.\n        \n        EXAMPLES::\n        \n            >>> pari('matrix(19,8)').nrows()\n            19\n        ";
static char __pyx_k_Return_the_primes_n_as_a_pari_l[] = "\n        Return the primes <= n as a pari list.\n        \n        EXAMPLES::\n        \n            >>> pari.primes_up_to_n(1)\n            []\n            >>> pari.primes_up_to_n(20)\n            [2, 3, 5, 7, 11, 13, 17, 19]\n        ";
static char __pyx_k_Return_the_roots_of_poly_in_the[] = "\n        Return the roots of `poly` in the number field self without\n        multiplicity. \n\n        EXAMPLES::\n\n            >>> y = pari('y'); x = pari('x')\n            >>> nf = pari('y^2 + 2').nfinit()\n            >>> nf.nfroots(x**2 + 2)\n            [Mod(-y, y^2 + 2), Mod(y, y^2 + 2)]\n            >>> nf = pari(y**3 + 2).nfinit()\n            >>> nf.nfroots(x**3 + 2)\n            [Mod(y, y^3 + 2)]\n            >>> nf = pari('y^4 + 2').nfinit()\n            >>> nf.nfroots(x**4 + 2)\n            [Mod(-y, y^4 + 2), Mod(y, y^4 + 2)]\n        ";
static char __pyx_k_Return_the_sum_of_the_k_th_powe[] = "\n        Return the sum of the k-th powers of the divisors of n.\n        \n        EXAMPLES::\n        \n            >>> pari(10).sumdivk(2)\n            130\n        ";
static char __pyx_k_Return_the_total_number_of_byte[] = "\n        Return the total number of bytes occupied by the complete tree\n        of the object x. Note that this number depends on whether the\n        computer is 32-bit or 64-bit.\n        \n        INPUT:\n        \n        -  ``x`` - gen\n        \n        OUTPUT: int (a Python int)\n        \n        EXAMPLE::\n        \n            >>> pari('1').sizebyte()  # 32-bit: 12\n            24\n        ";
static char __pyx_k_Return_the_total_number_of_mach[] = "\n        Return the total number of machine words occupied by the\n        complete tree of the object x.  A machine word is 32 or\n        64 bits, depending on the computer.\n        \n        INPUT:\n        \n        -  ``x`` - gen\n        \n        OUTPUT: int (a Python int)\n        \n        EXAMPLES::\n        \n            >>> pari('0').sizeword()\n            2\n            >>> pari('1').sizeword()\n            3\n            >>> pari('1000000').sizeword()\n            3\n            >>> pari('10^100').sizeword()  # 32-bit: 12\n            8\n            >>> pari(1.0).sizeword()    # 32-bit: 4\n            3\n            >>> pari('x').sizeword()\n            9\n            >>> pari('x^20').sizeword()\n            66\n            >>> pari('[x, I]').sizeword()\n            20\n        ";
static char __pyx_k_Return_the_trace_of_this_PARI_o[] = "\n        Return the trace of this PARI object.\n        \n        EXAMPLES::\n        \n            >>> pari('[1,2; 3,4]').trace()  \n            5\n        ";
static char __pyx_k_Return_the_valuation_of_x_where[] = "\n        Return the valuation of x where x is a p-adic number (t_PADIC)\n        or a laurent series (t_SER).  If x is a different type, this\n        will give a bogus number.\n        \n        EXAMPLES::\n            \n            >>> pari('1/x^2 + O(x^10)')._valp()\n            -2\n            >>> pari('O(x^10)')._valp()\n            10\n            >>> pari('(1145234796 + O(3^10))/771966234')._valp()\n            -2\n            >>> pari('O(2^10)')._valp()\n            10\n            >>> pari('x')._valp()   # random\n            -35184372088832\n        ";
static char __pyx_k_Return_the_value_of_the_constan[] = "\n        Return the value of the constant pi to the requested real precision\n        (in bits).\n        \n        EXAMPLES::\n        \n            >>> pari.pi()\n            3.14159265358979\n            >>> oldprec = pari.set_real_precision(50)\n            >>> pari.pi(precision=100)\n            3.14159265358979323846264338327950288420\n            >>> pari.set_real_precision(oldprec)\n            50\n        ";
static char __pyx_k_Returns_PARI_s_current_random_n[] = "\n        Returns PARI's current random number seed.\n\n        OUTPUT:\n\n        GEN of type t_VECSMALL\n        \n        EXAMPLES::\n        \n            >>> pari.setrand(50)\n            >>> a = pari.getrand(); a\n            Vecsmall([...])\n            >>> pari.setrand(a)\n            >>> a == pari.getrand()\n            True\n        ";
static char __pyx_k_Returns_Python_int_list_form_of[] = "\n        Returns Python int list form of entries of self, but raises an\n        exception if int does not fit into a long integer. Here self must\n        be a vector.\n        \n        EXAMPLES::\n        \n            >>> pari('[3,4,5]').type()\n            't_VEC'\n            >>> pari('[3,4,5]').intvec_unsafe()\n            [3, 4, 5]\n            >>> isinstance(pari('[3,4,5]').intvec_unsafe()[0], int)\n            True\n        \n        TESTS::\n        \n            >>> pari(3).intvec_unsafe()\n            Traceback (most recent call last):\n            ...\n            TypeError: gen must be of PARI type t_VEC\n            >>> pari('[2^150,1]').intvec_unsafe()\n            Traceback (most recent call last):\n            ...\n            PariError:  (15)\n        ";
static char __pyx_k_Returns_a_2_component_vector_wi[] = "\n        Returns a 2-component vector with the order of vanishing at\n        `s = 1` of the L-function of the elliptic curve and the value\n        of the first non-zero derivative.\n        \n        EXAMPLE::\n            \n            >>> E = pari([0, 0, 1, -7, 6]).ellinit()\n            >>> E.ellanalyticrank()\n            [3, 10.3910994007158]\n        ";
static char __pyx_k_Returns_a_Python_list_r1_r2_whe[] = "\n        Returns a Python list ``[r1, r2]``, where ``r1`` and ``r2`` are\n        Python ints representing the number of real embeddings and pairs\n        of complex embeddings of this number field, respectively.\n        \n        INPUT:\n\n        - ``self`` -- A PARI number field being the output of ``nfinit()``,\n                      ``bnfinit()`` or ``bnrinit()``.\n\n        EXAMPLES::\n            \n            >>> K = pari('x^4 - 4*x^2 + 1').nfinit()\n            >>> s = K.nf_get_sign(); s\n            [4, 0]\n            >>> isinstance(s, list); isinstance(s[0], int)\n            True\n            True\n            >>> pari.polcyclo(15).nfinit().nf_get_sign()\n            [0, 4]\n        ";
static char __pyx_k_Returns_a_polynomial_over_QQ_wh[] = "\n        Returns a polynomial over `\\QQ` whose roots generate the\n        Hilbert class field of the quadratic field of discriminant\n        ``self`` (which must be fundamental).\n        \n        EXAMPLES::\n            \n            >>> pari(-23).quadhilbert()\n            x^3 - x^2 + 1\n            >>> pari(145).quadhilbert()\n            x^4 - x^3 - 3*x^2 + x + 1\n            >>> pari(-12).quadhilbert()   # Not fundamental\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n        ";
static char __pyx_k_Returns_a_vector_with_a_ZZ_basi[] = "\n        Returns a vector with a `\\ZZ`-basis for the ring of integers of\n        this number field. The first element is always `1`.\n        \n        INPUT:\n\n        - ``self`` -- A PARI number field being the output of ``nfinit()``,\n                      ``bnfinit()`` or ``bnrinit()``.\n\n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^4 - 4*x^2 + 1)')\n            >>> K.nf_get_zk()\n            [1, x, x^3 - 4*x, x^2 - 2]\n        ";
static char __pyx_k_Returns_the_Hermite_Normal_Form[] = "\n        Returns the Hermite Normal Form of M concatenated with d\\*Identity\n        \n        Beware that PARI's concept of a Hermite normal form is a maximal\n        rank upper triangular matrix with the same column space as the\n        input matrix.\n        \n        INPUT:\n        \n        \n        -  ``d`` - Determines\n        \n        \n        EXAMPLES::\n        \n            >>> M=pari('[1,0,0; 0,2,0; 0,0,6]')\n            >>> pari(M).mathnfmodid(6)\n            [1, 0, 0; 0, 2, 0; 0, 0, 6]\n        \n        This routine is not completely equivalent to mathnfmod::\n        \n            >>> pari(M).mathnfmod(6)\n            [1, 0, 0; 0, 1, 0; 0, 0, 6]\n        ";
static char __pyx_k_Returns_the_Hermite_normal_form[] = "\n        Returns the Hermite normal form if d is a multiple of the\n        determinant\n        \n        Beware that PARI's concept of a Hermite normal form is an upper\n        triangular matrix with the same column space as the input matrix.\n        \n        INPUT:\n        \n        \n        -  ``d`` - multiple of the determinant of self\n        \n        \n        EXAMPLES::\n        \n            >>> M = pari('[1,2,3; 4,5,6; 7,8,11]')\n            >>> d = M.matdet()\n            >>> M.mathnfmod(d)\n            [6, 4, 3; 0, 1, 0; 0, 0, 1]\n        \n        Note that d really needs to be a multiple of the discriminant, not\n        just of the exponent of the cokernel::\n        \n            >>> M=pari('[1,0,0; 0,2,0; 0,0,6]')\n            >>> M.mathnfmod(6)\n            [1, 0, 0; 0, 1, 0; 0, 0, 6]\n            >>> M.mathnfmod(12)\n            [1, 0, 0; 0, 2, 0; 0, 0, 6]\n        ";
static char __pyx_k_Returns_the_absolute_value_of_x[] = "\n        Returns the absolute value of x (its modulus, if x is complex).\n        Rational functions are not allowed. Contrary to most transcendental\n        functions, an exact argument is not converted to a real number\n        before applying abs and an exact result is returned if possible.\n        \n        EXAMPLES::\n        \n            >>> x = pari(\"-27.1\")\n            >>> x.abs()\n            27.1000000000000\n        \n        If x is a polynomial, returns -x if the leading coefficient is real\n        and negative else returns x. For a power series, the constant\n        coefficient is considered instead.\n        \n        EXAMPLES::\n        \n            >>> pari('x-1.2*x^2').abs()\n            1.20000000000000*x^2 - x\n        ";
static char __pyx_k_Returns_the_class_number_of_sel[] = "\n        Returns the class number of ``self``, a \"big number field\" (``bnf``).\n        \n        EXAMPLES::\n            \n            >>> K = pari('bnfinit(x^2+65)')\n            >>> K.bnf_get_no()\n            8\n        ";
static char __pyx_k_Returns_the_defining_polynomial[] = "\n        Returns the defining polynomial of this number field.\n\n        INPUT:\n\n        - ``self`` -- A PARI number field being the output of ``nfinit()``,\n                      ``bnfinit()`` or ``bnrinit()``.\n\n        EXAMPLES::\n            \n            >>> K = pari('y^4 - 4*y^2 + 1').nfinit()\n            >>> K.nf_get_pol()\n            y^4 - 4*y^2 + 1\n            >>> bnr = pari('K = bnfinit(y^4 - 4*y^2 + 1); bnrinit(K, 2*y)')\n            >>> bnr.nf_get_pol()\n            y^4 - 4*y^2 + 1\n\n        For relative extensions, we can only get the absolute polynomial,\n        not the relative one::\n\n            >>> K.rnfequation(pari('x^2 - 5'))   # Absolute polynomial\n            x^8 - 28*x^6 + 208*x^4 - 408*x^2 + 36\n            >>> L = K.rnfinit(pari('x^2 - 5'))\n            >>> L.nf_get_pol()\n            Traceback (most recent call last):\n            ...\n            TypeError: Not a PARI number field\n        ";
static char __pyx_k_Returns_the_different_of_this_n[] = "\n        Returns the different of this number field as a PARI ideal.\n        \n        INPUT:\n\n        - ``self`` -- A PARI number field being the output of ``nfinit()``,\n                      ``bnfinit()`` or ``bnrinit()``.\n\n        EXAMPLES::\n            \n            >>> K = pari('x^4 - 4*x^2 + 1').nfinit()\n            >>> K.nf_get_diff()\n            [12, 0, 0, 0; 0, 12, 8, 0; 0, 0, 4, 0; 0, 0, 0, 4]\n        ";
static char __pyx_k_Returns_the_prime_of_ZZ_lying_b[] = "\n        Returns the prime of `\\ZZ` lying below this prime ideal.\n        \n        NOTE: ``self`` must be a PARI prime ideal (as returned by\n        ``idealfactor`` for example).\n        \n        EXAMPLES::\n            XXX\n            >>> K = pari('nfinit(x^2+1)')\n            >>> F = K.idealfactor(5); F\n            [[5, [-2, 1]~, 1, 1, [2, 1]~], 1; [5, [2, 1]~, 1, 1, [-2, 1]~], 1]\n            >>> F[0,0].pr_get_p()\n            5\n        ";
static char __pyx_k_Returns_the_regulator_of_this_n[] = "\n        Returns the regulator of this number field.\n        \n        NOTE: ``self`` must be a \"big number field\" (``bnf``).\n        \n        EXAMPLES::\n            \n            >>> K = pari('bnfinit(x^4 - 4*x^2 + 1)')\n            >>> K.bnf_get_reg()\n            2.66089858019037...\n        ";
static char __pyx_k_Returns_the_residue_class_degre[] = "\n        Returns the residue class degree (over `\\QQ`) of this prime ideal.\n        \n        NOTE: ``self`` must be a PARI prime ideal (as returned by\n        ``idealfactor`` for example).\n        \n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^2+1)')\n            >>> K.idealfactor(2)[0,0].pr_get_f()\n            1\n            >>> K.idealfactor(3)[0,0].pr_get_f()\n            2\n            >>> K.idealfactor(5)[0,0].pr_get_f()\n            1\n        ";
static char __pyx_k_Returns_the_second_generator_of[] = "\n        Returns the second generator of this PARI prime ideal, where the\n        first generator is ``self.pr_get_p()``.\n        \n        NOTE: ``self`` must be a PARI prime ideal (as returned by\n        ``idealfactor`` for example).\n        \n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^2+1)')\n            >>> g = K.idealfactor(2)[0,0].pr_get_gen(); g\n            [1, 1]~\n            >>> g = K.idealfactor(3)[0,0].pr_get_gen(); g\n            [3, 0]~\n            >>> g = K.idealfactor(5)[0,0].pr_get_gen(); g\n            [-2, 1]~\n        ";
static char __pyx_k_Returns_the_structure_of_the_cl[] = "\n        Returns the structure of the class group of this number field as\n        a vector of SNF invariants.\n        \n        NOTE: ``self`` must be a \"big number field\" (``bnf``).\n        \n        EXAMPLES::\n            \n            >>> K = pari('bnfinit(x^2+65)')\n            >>> K.bnf_get_cyc()\n            [4, 2]\n        ";
static char __pyx_k_Returns_the_structure_of_the_gr[] = "\n        Returns the structure of the group `(O_K/I)^*`, where `I` is the\n        ideal represented by ``self``.\n        \n        NOTE: ``self`` must be a \"big ideal\" (``bid``) as returned by\n        ``idealstar`` for example.\n        \n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^2+1)')\n            >>> J = K.idealstar(pari('4*x+2'))\n            >>> J.bid_get_cyc()\n            [4, 2]\n        ";
static char __pyx_k_Returns_u_v_d_such_that_d_gcd_x[] = "\n        Returns u,v,d such that d=gcd(x,y) and u\\*x+v\\*y=d.\n        \n        EXAMPLES::\n        \n            >>> pari(10).xgcd(15)\n            (5, -1, 1)\n        ";
static char __pyx_k_Ser_x_v_x_Create_a_power_series[] = "\n        Ser(x,v=x): Create a power series from x with main variable v and\n        return the result.\n        \n        - If x is a scalar, this gives a constant power series with\n          precision given by the default series precision, as returned\n          by get_series_precision().\n        \n        - If x is a polynomial, the precision is the greatest of\n          get_series_precision() and the degree of the polynomial.\n        \n        - If x is a vector, the precision is similarly given, and the\n          coefficients of the vector are understood to be the\n          coefficients of the power series starting from the constant\n          term (i.e. the reverse of the function Pol).\n        \n        .. warning::\n\n           This is *not* a substitution function. It will not\n           transform an object containing variables of higher priority\n           than v.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``v`` - PARI variable (default: x)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - PARI object of PARI type t_SER\n        \n        \n        EXAMPLES::\n        \n            >>> pari(2).Ser()\n            2 + O(x^16)\n            >>> x = pari([1,2,3,4,5])\n            >>> x.Ser()\n            1 + 2*x + 3*x^2 + 4*x^3 + 5*x^4 + O(x^5)\n            >>> f = x.Ser('v'); print(f)\n            1 + 2*v + 3*v^2 + 4*v^3 + 5*v^4 + O(v^5)\n            >>> pari(1)/f\n            1 - 2*v + v^2 + O(v^5)\n            >>> pari('x^5').Ser(seriesprecision = 20)\n            x^5 + O(x^25)\n            >>> pari('1/x').Ser(seriesprecision = 1)\n            x^-1 + O(x^0)\n        ";
static char __pyx_k_Set_the_nth_entry_to_a_referenc[] = "\n        Set the nth entry to a reference to y.\n        \n            \n            -  The indexing is 0-based, like everywhere else in Python, but\n               *unlike* in PARI/GP.\n        \n            -  Assignment sets the nth entry to a reference to y, assuming y is\n               an object of type gen. This is the same as in Python, but\n               *different* than what happens in the gp interpreter, where\n               assignment makes a copy of y.\n        \n            -  Because setting creates references it is *possible* to make\n               circular references, unlike in GP. Do *not* do this (see the\n               example below). If you need circular references, work at the Python\n               level (where they work well), not the PARI object level.\n        \n        \n        \n        EXAMPLES::\n        \n            >>> v = pari(range(10))\n            >>> v\n            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> v[0] = 10\n            >>> w = pari([5,8,-20])\n            >>> v\n            [10, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> v[1] = w\n            >>> v\n            [10, [5, 8, -20], 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> w[0] = -30\n            >>> v\n            [10, [-30, 8, -20], 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> t = v[1]; t[1] = 10 ; v  \n            [10, [-30, 10, -20], 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> v[1][0] = 54321 ; v\n            [10, [54321, 10, -20], 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> w\n            [54321, 10, -20]\n            >>> v = pari([[[[0,1],2],3],4]) ; v[0][0][0][1] = 12 ; v\n            [[[[0, 12], 2], 3], 4]\n            >>> m = pari('[0,1;2,3]') ; l = pari('[5,6]') ; n = pari('[7,8;9,0]') ; m[1,0] = l ; l[1] = n ; m[1,0][1][1,1] = 1111 ; m\n            [0, 1; [5, [7, 8; 9, 1111]], 3]\n            >>> m = pari('[[1,2;3,4],5,6]') ; m[0][1,1] = 11 ; m\n            [[1, 2; 3, 11], 5, 6]\n            \n        Finally, we create a circular reference::\n        \n     ""       >>> v = pari([0])\n            >>> w = pari([v])\n            >>> v\n            [0]\n            >>> w\n            [[0]]\n            >>> v[0] = w\n        \n        Now there is a circular reference. Accessing v[0] will cause a crash.\n        \n        ::\n        \n            >>> s=pari.vector(2,[0,0])\n            >>> s[:1]\n            [0]\n            >>> s[:1]=[1]\n            >>> s\n            [1, 0]\n            >>> isinstance(s[0], gen)\n            True\n            >>> s = pari(range(20)) ; s\n            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> s[0:10:2] = range(50,55) ; s\n            [50, 1, 51, 3, 52, 5, 53, 7, 54, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> s[10:20:3] = range(100,150) ; s\n            [50, 1, 51, 3, 52, 5, 53, 7, 54, 9, 100, 11, 12, 101, 14, 15, 102, 17, 18, 103]\n        \n        TESTS::\n        \n            >>> v = pari(xrange(10)) ; v\n            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> v[:] = xrange(20,30)\n            >>> v\n            [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]\n            >>> isinstance(v[0], gen)\n            True\n        ";
static char __pyx_k_Sets_PARI_s_current_random_numb[] = "\n        Sets PARI's current random number seed.\n\n        INPUT:\n\n        - ``seed`` -- either a strictly positive integer or a GEN of\n          type ``t_VECSMALL`` as output by ``getrand()``\n        \n        This should not be called directly; instead, use Sage's global\n        random number seed handling in ``sage.misc.randstate``\n        and call ``current_randstate().set_seed_pari()``.\n        \n        EXAMPLES::\n        \n            >>> pari.setrand(50)\n            >>> a = pari.getrand(); a\n            Vecsmall([...])\n            >>> pari.setrand(a)\n            >>> a == pari.getrand()\n            True\n\n        TESTS:\n\n        Check that invalid inputs are handled properly (#11825)::\n\n            >>> pari.setrand(0)\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n            >>> pari.setrand(\"foobar\")\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
static char __pyx_k_Str_self_Return_the_print_repre[] = "\n        Str(self): Return the print representation of self as a PARI\n        object.\n        \n        INPUT:\n        \n        \n        -  ``self`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - a PARI gen of type t_STR, i.e., a PARI\n           string\n        \n        \n        EXAMPLES::\n        \n            >>> pari([1,2,['abc',1]]).Str()\n            \"[1, 2, [abc, 1]]\"\n            >>> pari([1,1, 1.54]).Str()\n            \"[1, 1, 1.54000000000000]\"\n            >>> pari(1).Str()       # 1 is automatically converted to string rep\n            \"1\"\n            >>> x = pari('x')       # PARI variable \"x\"\n            >>> x.Str()             # is converted to string rep.\n            \"x\"\n            >>> x.Str().type()\n            't_STR'\n        ";
static char __pyx_k_Strchr_x_converts_x_to_a_string[] = "\n        Strchr(x): converts x to a string, translating each integer into a\n        character (in ASCII).\n        \n        .. note::\n\n           :meth:`.Vecsmall` is (essentially) the inverse to :meth:`.Strchr`.\n        \n        INPUT:\n        \n        \n        -  ``x`` - PARI vector of integers\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - a PARI string\n        \n        \n        EXAMPLES::\n        \n            >>> pari([65,66,123]).Strchr()\n            \"AB{\"\n            >>> pari('\"Sage\"').Vecsmall()   # pari('\"Sage\"') --> PARI t_STR\n            Vecsmall([83, 97, 103, 101])\n            >>> _.Strchr()\n            \"Sage\"\n            >>> pari([83, 97, 103, 101]).Strchr()\n            \"Sage\"\n        ";
  static char __pyx_k_TESTS_PariError_11_PariError_11[] = "\n        TESTS::\n            \n            >>> PariError(11)\n            PariError(11)\n        ";
  static char __pyx_k_The_Bernoulli_number_B_x_as_for[] = "\n        The Bernoulli number `B_x`, as for the function bernfrac,\n        but `B_x` is returned as a real number (with the current\n        precision).\n        \n        EXAMPLES::\n        \n            >>> pari(18).bernreal()\n            54.9711779448622\n        ";
  static char __pyx_k_The_H_1_Bessel_function_of_inde[] = "\n        The `H^1`-Bessel function of index `\\nu` and\n        argument `x`.\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).besselh1(3)\n            0.486091260585891 - 0.160400393484924*I\n        ";
  static char __pyx_k_The_H_2_Bessel_function_of_inde[] = "\n        The `H^2`-Bessel function of index `\\nu` and\n        argument `x`.\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).besselh2(3)\n            0.486091260585891 + 0.160400393484924*I\n        ";
  static char __pyx_k_The_arithmetic_geometric_mean_o[] = "\n        The arithmetic-geometric mean of x and y. In the case of complex or\n        negative numbers, the principal square root is always chosen.\n        p-adic or power series arguments are also allowed. Note that a\n        p-adic AGM exists only if x/y is congruent to 1 modulo p (modulo 16\n        for p=2). x and y cannot both be vectors or matrices.\n        \n        If any of `x` or `y` is an exact argument, it is\n        first converted to a real or complex number using the optional\n        parameter precision (in bits). If the arguments are inexact (e.g.\n        real), the smallest of their two precisions is used in the\n        computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).agm(2)                  \n            2.00000000000000\n            >>> pari(0).agm(1)\n            0\n            >>> pari(1).agm(2)\n            1.45679103104691\n            >>> pari('1+I').agm(-3)\n            -0.964731722290876 + 1.15700282952632*I\n        ";
  static char __pyx_k_The_cotangent_of_x_If_x_is_an_e[] = "\n        The cotangent of x.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(5).cotan()\n            -0.295812915532746\n        \n        Computing the cotangent of `\\pi` doesn't raise an error,\n        but instead just returns a very large (positive or negative)\n        number.\n        \n        ::\n        \n            >>> x = pari.pi()\n            >>> x.cotan()         # random\n            4.61168601842739 E18\n        ";
  static char __pyx_k_The_hyperbolic_sine_function_If[] = "\n        The hyperbolic sine function.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0).sinh()\n            0.E-19\n            >>> pari('1+I').sinh()\n            0.634963914784736 + 1.29845758141598*I\n        ";
  static char __pyx_k_The_principal_branch_of_cos_1_x[] = "\n        The principal branch of `\\cos^{-1}(x)`, so that\n        `\\RR e(\\mathrm{acos}(x))` belongs to `[0,Pi]`. If `x`\n        is real and `|x| > 1`, then `\\mathrm{acos}(x)` is complex.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0.5).acos()\n            1.04719755119660\n            >>> pari('1/2').acos()\n            1.04719755119660\n            >>> pari(1.1).acos()\n            0.443568254385115*I\n            >>> pari('1.1+I').acos()\n            0.849343054245252 - 1.09770986682533*I\n        ";
  static char __pyx_k_The_principal_branch_of_sin_1_x[] = "\n        The principal branch of `\\sin^{-1}(x)`, so that\n        `\\RR e(\\mathrm{asin}(x))` belongs to `[-\\pi/2,\\pi/2]`. If\n        `x` is real and `|x| > 1` then `\\mathrm{asin}(x)`\n        is complex.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(pari(0.5).sin()).asin()\n            0.500000000000000\n            >>> pari(2).asin()\n            1.57079632679490 - 1.31695789692482*I\n        ";
  static char __pyx_k_The_principal_branch_of_tan_1_x[] = "\n        The principal branch of `\\tan^{-1}(x)`, so that\n        `\\RR e(\\mathrm{atan}(x))` belongs to `]-\\pi/2, \\pi/2[`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).atan()\n            0.785398163397448\n            >>> pari('1.5+I').atan()\n            1.10714871779409 + 0.255412811882995*I\n        ";
  static char __pyx_k_The_principal_branch_of_the_dil[] = "\n        The principal branch of the dilogarithm of `x`, i.e. the\n        analytic continuation of the power series\n        `\\log_2(x) = \\sum_{n>=1} x^n/n^2`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).dilog()\n            1.64493406684823\n            >>> pari('1+I').dilog()\n            0.616850275068085 + 1.46036211675312*I\n        ";
  static char __pyx_k_The_uniformizer_of_the_p_adic_r[] = "\n        The uniformizer of the p-adic ring this element lies in, as a t_INT.\n\n        INPUT:\n\n        - ``x`` - gen, of type t_PADIC\n\n        OUTPUT:\n\n        - ``p`` - gen, of type t_INT\n\n        EXAMPLES::\n\n            >>> x = pari('11^-10 + 5*11^-7 + 11^-6 + O(11^-5)')\n            >>> x.padicprime()\n            11\n            >>> x.padicprime().type()\n            't_INT'\n        ";
  static char __pyx_k_Transform_the_object_x_into_a_c[] = "\n        Transform the object `x` into a column vector with minimal size `|n|`.\n        \n        INPUT:\n        \n        - ``x`` -- gen\n        \n        - ``n`` -- Make the column vector of minimal length `|n|`. If `n > 0`,\n          append zeros; if `n < 0`, prepend zeros.\n        \n        OUTPUT:\n        \n        A PARI column vector (type ``t_COL``)\n        \n        EXAMPLES::\n        \n            >>> pari(1.5).Col()\n            [1.50000000000000]~\n            >>> pari([1,2,3,4]).Col()\n            [1, 2, 3, 4]~\n            >>> pari('[1,2; 3,4]').Col()\n            [[1, 2], [3, 4]]~\n            >>> pari('\"Sage\"').Col()\n            [\"S\", \"a\", \"g\", \"e\"]~\n            >>> pari('x + 3*x^3').Col()\n            [3, 0, 1, 0]~\n            >>> pari('x + 3*x^3 + O(x^5)').Col()\n            [1, 0, 3, 0]~\n\n        We demonstate the `n` argument::\n\n            >>> pari([1,2,3,4]).Col(2)\n            [1, 2, 3, 4]~\n            >>> pari([1,2,3,4]).Col(-2)\n            [1, 2, 3, 4]~\n            >>> pari([1,2,3,4]).Col(6)\n            [1, 2, 3, 4, 0, 0]~\n            >>> pari([1,2,3,4]).Col(-6)\n            [0, 0, 1, 2, 3, 4]~\n\n        See also :meth:`Vec` (create a row vector) for more examples\n        and :meth:`Colrev` (create a column in reversed order).\n        ";
  static char __pyx_k_Transform_the_object_x_into_a_t[] = "\n        Transform the object `x` into a ``t_VECSMALL`` with minimal size `|n|`.\n        \n        INPUT:\n        \n        - ``x`` -- gen\n        \n        - ``n`` -- Make the vector of minimal length `|n|`. If `n > 0`,\n          append zeros; if `n < 0`, prepend zeros.\n        \n        OUTPUT:\n        \n        A PARI vector of small integers (type ``t_VECSMALL``)\n        \n        EXAMPLES::\n        \n            >>> pari([1,2,3]).Vecsmall()\n            Vecsmall([1, 2, 3])\n            >>> pari('\"Sage\"').Vecsmall()\n            Vecsmall([83, 97, 103, 101])\n            >>> pari(1234).Vecsmall()\n            Vecsmall([1234])\n            >>> pari('x^2 + 2*x + 3').Vecsmall()\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n\n        We demonstate the `n` argument::\n\n            >>> pari([1,2,3]).Vecsmall(2)\n            Vecsmall([1, 2, 3])\n            >>> pari([1,2,3]).Vecsmall(-2)\n            Vecsmall([1, 2, 3])\n            >>> pari([1,2,3]).Vecsmall(6)\n            Vecsmall([1, 2, 3, 0, 0, 0])\n            >>> pari([1,2,3]).Vecsmall(-6)\n            Vecsmall([0, 0, 0, 1, 2, 3])\n        ";
  static char __pyx_k_Transform_the_object_x_into_a_v[] = "\n        Transform the object `x` into a vector with minimal size `|n|`.\n        \n        INPUT:\n        \n        - ``x`` -- gen\n        \n        - ``n`` -- Make the vector of minimal length `|n|`. If `n > 0`,\n          append zeros; if `n < 0`, prepend zeros.\n        \n        OUTPUT:\n        \n        A PARI vector (type ``t_VEC``)\n        \n        EXAMPLES::\n        \n            >>> pari(1).Vec()\n            [1]\n            >>> pari('x^3').Vec()\n            [1, 0, 0, 0]\n            >>> pari('x^3 + 3*x - 2').Vec()\n            [1, 0, 3, -2]\n            >>> pari([1,2,3]).Vec()\n            [1, 2, 3]\n            >>> pari('[1, 2; 3, 4]').Vec()\n            [[1, 3]~, [2, 4]~]\n            >>> pari('\"Sage\"').Vec()\n            [\"S\", \"a\", \"g\", \"e\"]\n            >>> pari('2*x^2 + 3*x^3 + O(x^5)').Vec()\n            [2, 3, 0]\n            >>> pari('2*x^-2 + 3*x^3 + O(x^5)').Vec()\n            [2, 0, 0, 0, 0, 3, 0]\n\n        Note the different term ordering for polynomials and series::\n\n            >>> pari('1 + x + 3*x^3 + O(x^5)').Vec()\n            [1, 1, 0, 3, 0]\n            >>> pari('1 + x + 3*x^3').Vec()\n            [3, 0, 1, 1]\n\n        We demonstate the `n` argument::\n\n            >>> pari([1,2,3,4]).Vec(2)\n            [1, 2, 3, 4]\n            >>> pari([1,2,3,4]).Vec(-2)\n            [1, 2, 3, 4]\n            >>> pari([1,2,3,4]).Vec(6)\n            [1, 2, 3, 4, 0, 0]\n            >>> pari([1,2,3,4]).Vec(-6)\n            [0, 0, 1, 2, 3, 4]\n\n        See also :meth:`Col` (create a column vector) and :meth:`Vecrev`\n        (create a vector in reversed order).\n        ";
  static char __pyx_k_Transpose_of_the_matrix_self_EX[] = "\n        Transpose of the matrix self.\n        \n        EXAMPLES::\n        \n            >>> pari('[1,2,3; 4,5,6;  7,8,9]').mattranspose()\n            [1, 4, 7; 2, 5, 8; 3, 6, 9]\n        ";
  static char __pyx_k_Users_dunfield_work_CyPari_cypa[] = "/Users/dunfield/work/CyPari/cypari_src/gen.pyx";
  static char __pyx_k_Vector_of_vectors_L_of_all_idea[] = "\n        Vector of vectors `L` of all idealstar of all ideals of `norm <= bound`.\n        \n        The binary digits of flag mean:\n        \n         - 1: give generators;\n         - 2: add units;\n         - 4: (default) give only the ideals and not the bid.\n        \n        EXAMPLES::\n            \n            >>> K = pari('x^2 + 1').nfinit()\n            >>> L = K.ideallist(100)\n        \n        Now we have our list `L`. Entry `L[n-1]` contains all ideals of\n        norm `n`::\n            \n            >>> L[0]   # One ideal of norm 1.\n            [[1, 0; 0, 1]]\n            >>> L[64]  # 4 ideals of norm 65.\n            [[65, 8; 0, 1], [65, 47; 0, 1], [65, 18; 0, 1], [65, 57; 0, 1]]\n        ";
  static char __pyx_k_a_hyperu_b_x_U_confluent_hyperg[] = "\n        a.hyperu(b,x): U-confluent hypergeometric function.\n        \n        If `a`, `b`, or `x` is an exact argument,\n        it is first converted to a real or complex number using the\n        optional parameter precision (in bits). If the arguments are\n        inexact (e.g. real), the smallest of their precisions is used in\n        the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).hyperu(2,3)\n            0.333333333333333\n        ";
  static char __pyx_k_arg_x_argument_of_x_such_that_p[] = "\n        arg(x): argument of x,such that `-\\pi < \\arg(x) \\leq \\pi`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari('2+I').arg()               \n            0.463647609000806\n        ";
  static char __pyx_k_binary_x_gives_the_vector_forme[] = "\n        binary(x): gives the vector formed by the binary digits of abs(x),\n        where x is of type t_INT.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen of type t_INT\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - of type t_VEC\n        \n        \n        EXAMPLES::\n        \n            >>> pari(0).binary()\n            [0]\n            >>> pari(-5).binary()\n            [1, 0, 1]\n            >>> pari(5).binary()\n            [1, 0, 1]\n            >>> pari(2005).binary()\n            [1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1]\n        \n        ::\n        \n            >>> pari('\"2\"').binary()\n            Traceback (most recent call last):\n            ...\n            TypeError: x (=\"2\") must be of type t_INT, but is of type t_STR.\n        ";
  static char __pyx_k_binomial_x_k_return_the_binomia[] = "\n        binomial(x, k): return the binomial coefficient \"x choose k\".\n        \n        INPUT:\n        \n        \n        -  ``x`` - any PARI object (gen)\n        \n        -  ``k`` - integer\n        \n        \n        EXAMPLES::\n        \n            >>> pari(6).binomial(2)\n            15\n            >>> pari('x+1').binomial(3)\n            1/6*x^3 - 1/6*x\n            >>> pari('2+x+O(x^2)').binomial(3)\n            1/3*x + O(x^2)\n        ";
  static char __pyx_k_bitand_x_y_Bitwise_and_of_two_i[] = "\n        bitand(x,y): Bitwise and of two integers x and y. Negative numbers\n        behave as if modulo some large power of 2.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (of type t_INT)\n        \n        -  ``y`` - coercible to gen (of type t_INT)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - of type type t_INT\n        \n        \n        EXAMPLES::\n        \n            >>> pari(8).bitand(4)\n            0\n            >>> pari(8).bitand(8)\n            8\n            >>> pari(6).binary()\n            [1, 1, 0]\n            >>> pari(7).binary()\n            [1, 1, 1]\n            >>> pari(6).bitand(7)\n            6\n            >>> pari(19).bitand(-1)\n            19\n            >>> pari(-1).bitand(-1)\n            -1\n        ";
  static char __pyx_k_bitneg_x_n_1_Bitwise_negation_o[] = "\n        bitneg(x,n=-1): Bitwise negation of the integer x truncated to n\n        bits. n=-1 (the default) represents an infinite sequence of the bit\n        1. Negative numbers behave as if modulo some large power of 2.\n        \n        With n=-1, this function returns -n-1. With n = 0, it returns a\n        number a such that `a\\cong -n-1 \\pmod{2^n}`.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (t_INT)\n        \n        -  ``n`` - long, default = -1\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - t_INT\n        \n        \n        EXAMPLES::\n        \n            >>> pari(10).bitneg()\n            -11\n            >>> pari(1).bitneg()\n            -2\n            >>> pari(-2).bitneg()\n            1\n            >>> pari(-1).bitneg()\n            0\n            >>> pari(569).bitneg()\n            -570\n            >>> pari(569).bitneg(10)\n            454\n            >>> 454 % 2**10\n            454\n            >>> -570 % 2**10\n            454\n        ";
  static char __pyx_k_bitnegimply_x_y_Bitwise_negated[] = "\n        bitnegimply(x,y): Bitwise negated imply of two integers x and y, in\n        other words, x BITAND BITNEG(y). Negative numbers behave as if\n        modulo big power of 2.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (of type t_INT)\n        \n        -  ``y`` - coercible to gen (of type t_INT)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - of type type t_INT\n        \n        \n        EXAMPLES::\n        \n            >>> pari(14).bitnegimply(0)    \n            14\n            >>> pari(8).bitnegimply(8)\n            0\n            >>> pari(8+4).bitnegimply(8)\n            4\n        ";
  static char __pyx_k_bitor_x_y_Bitwise_or_of_two_int[] = "\n        bitor(x,y): Bitwise or of two integers x and y. Negative numbers\n        behave as if modulo big power of 2.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (of type t_INT)\n        \n        -  ``y`` - coercible to gen (of type t_INT)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - of type type t_INT\n        \n        \n        EXAMPLES::\n        \n            >>> pari(14).bitor(0)\n            14\n            >>> pari(8).bitor(4)\n            12\n            >>> pari(12).bitor(1)\n            13\n            >>> pari(13).bitor(1)\n            13\n        ";
  static char __pyx_k_bittest_x_long_n_Returns_bit_nu[] = "\n        bittest(x, long n): Returns bit number n (coefficient of\n        `2^n` in binary) of the integer x. Negative numbers behave\n        as if modulo a big power of 2.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (pari integer)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``bool`` - a Python bool\n        \n        \n        EXAMPLES::\n        \n            >>> x = pari(6)\n            >>> x.bittest(0)\n            False\n            >>> x.bittest(1)\n            True\n            >>> x.bittest(2)\n            True\n            >>> x.bittest(3)\n            False\n            >>> pari(-3).bittest(0)\n            True\n            >>> pari(-3).bittest(1)\n            False\n            >>> [pari(-3).bittest(n) for n in range(10)]\n            [True, False, True, True, True, True, True, True, True, True]\n        ";
  static char __pyx_k_bitxor_x_y_Bitwise_exclusive_or[] = "\n        bitxor(x,y): Bitwise exclusive or of two integers x and y. Negative\n        numbers behave as if modulo big power of 2.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (of type t_INT)\n        \n        -  ``y`` - coercible to gen (of type t_INT)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - of type type t_INT\n        \n        \n        EXAMPLES::\n        \n            >>> pari(6).bitxor(4)\n            2\n            >>> pari(0).bitxor(4)\n            4\n            >>> pari(6).bitxor(0)\n            6\n        ";
  static char __pyx_k_centerlift_x_v_Centered_lift_of[] = "\n        centerlift(x,v): Centered lift of x. This function returns exactly\n        the same thing as lift, except if x is an integer mod.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``v`` - var (default: x)\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> x = pari(-2).Mod(5)\n            >>> x.centerlift()\n            -2\n            >>> x.lift()\n            3\n            >>> f = pari('x-1').Mod('x^2 + 1')\n            >>> f.centerlift()\n            x - 1\n            >>> f.lift()\n            x - 1\n            >>> f = pari('x-y').Mod('x^2+1')\n            >>> f\n            Mod(x - y, x^2 + 1)\n            >>> f.centerlift('x')\n            x - y\n            >>> f.centerlift('y')\n            Mod(x - y, x^2 + 1)\n        ";
  static char __pyx_k_change_variable_name_only_works[] = "change_variable_name() only works for polynomials or power series";
  static char __pyx_k_conj_x_Return_the_algebraic_con[] = "\n        conj(x): Return the algebraic conjugate of x.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('x+1').conj()\n            x + 1\n            >>> pari('x+I').conj()\n            x - I\n            >>> pari('1/(2*x+3*I)').conj()\n            1/(2*x - 3*I)\n            >>> pari([1,2,'2-I','Mod(x,x^2+1)', 'Mod(x,x^2-2)']).conj()\n            [1, 2, 2 + I, Mod(-x, x^2 + 1), Mod(-x, x^2 - 2)]\n            >>> pari('Mod(x,x^2-2)').conj()\n            Mod(-x, x^2 - 2)\n            >>> pari('Mod(x,x^3-3)').conj()\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
  static char __pyx_k_conjvec_x_Returns_the_vector_of[] = "\n        conjvec(x): Returns the vector of all conjugates of the algebraic\n        number x. An algebraic number is a polynomial over Q modulo an\n        irreducible polynomial.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('Mod(1+x,x^2-2)').conjvec()\n            [-0.414213562373095, 2.41421356237310]~\n            >>> pari('Mod(x,x^3-3)').conjvec()\n            [1.44224957030741, -0.721124785153704 + 1.24902476648341*I, -0.721124785153704 - 1.24902476648341*I]~\n        ";
  static char __pyx_k_denominator_x_Return_the_denomi[] = "\n        denominator(x): Return the denominator of x. When x is a vector,\n        this is the least common multiple of the denominators of the\n        components of x.\n        \n        what about poly? INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('5/9').denominator()\n            9\n            >>> pari('(x+1)/(x-2)').denominator()\n            x - 2\n            >>> pari('2/3 + 5/8*x + 7/3*x^2 + 1/5*y').denominator()\n            1\n            >>> pari('2/3*x').denominator()\n            1\n            >>> pari('[2/3, 5/8, 7/3, 1/5]').denominator()\n            120\n        ";
  static char __pyx_k_e_elladd_z0_z1_return_the_sum_o[] = "\n        e.elladd(z0, z1): return the sum of the points z0 and z1 on this\n        elliptic curve.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve E\n        \n        -  ``z0`` - point on E\n        \n        -  ``z1`` - point on E\n        \n        \n        OUTPUT: point on E\n        \n        EXAMPLES: First we create an elliptic curve::\n        \n            >>> e = pari([0, 1, 1, -2, 0]).ellinit()\n            >>> str(e)[:65]   # first part of output\n            '[0, 1, 1, -2, 0, 4, -4, 1, -3, 112, -856, 389, 1404928/389, [0.90'\n        \n        Next we add two points on the elliptic curve. Notice that the\n        Python lists are automatically converted to PARI objects so you\n        don't have to do that explicitly in your code.\n        \n        ::\n        \n            >>> e.elladd([1,0], [-1,1])\n            [-3/4, -15/8]\n        ";
  static char __pyx_k_e_ellak_n_Returns_the_coefficie[] = "\n        e.ellak(n): Returns the coefficient `a_n` of the\n        `L`-function of the elliptic curve e, i.e. the\n        `n`-th Fourier coefficient of the weight 2 newform\n        associated to e (according to Shimura-Taniyama).\n        \n            The curve `e` *must* be a medium or long vector of the type\n            given by ellinit. For this function to work for every n and not\n            just those prime to the conductor, e must be a minimal Weierstrass\n            equation. If this is not the case, use the function ellminimalmodel\n            first before using ellak (or you will get INCORRECT RESULTS!)\n        \n        \n        INPUT:\n        \n        \n        -  ``e`` - a PARI elliptic curve.\n        \n        -  ``n`` - integer.\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.ellak(6)\n            2\n            >>> e.ellak(2005)        \n            2\n            >>> e.ellak(-1)\n            0\n            >>> e.ellak(0)\n            0\n        ";
  static char __pyx_k_e_ellap_p_Returns_the_prime_ind[] = "\n        e.ellap(p): Returns the prime-indexed coefficient `a_p` of the\n        `L`-function of the elliptic curve `e`, i.e. the `p`-th Fourier\n        coefficient of the newform attached to e.\n        \n        The computation uses the Shanks--Mestre method, or the SEA\n        algorithm.\n        \n        .. WARNING::\n            \n            For this function to work for every n and not just those prime\n            to the conductor, e must be a minimal Weierstrass equation.\n            If this is not the case, use the function ellminimalmodel first\n            before using ellap (or you will get INCORRECT RESULTS!)\n        \n        \n        INPUT:\n        \n        \n        -  ``e`` - a PARI elliptic curve.\n        \n        -  ``p`` - prime integer\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.ellap(2)\n            -2\n            >>> e.ellap(2003)\n            4\n            >>> e.ellak(-1)\n            0\n        ";
  static char __pyx_k_e_ellaplist_n_Returns_a_PARI_li[] = "\n        e.ellaplist(n): Returns a PARI list of all the prime-indexed\n        coefficients `a_p` (up to n) of the `L`-function\n        of the elliptic curve `e`, i.e. the Fourier coefficients of\n        the newform attached to `e`.\n        \n        INPUT:\n        \n        \n        -  ``n`` - a long integer\n        \n        -  ``python_ints`` - bool (default is False); if True,\n           return a list of Python ints instead of a PARI gen wrapper.\n        \n        \n            The curve e must be a medium or long vector of the type given by\n            ellinit. For this function to work for every n and not just those\n            prime to the conductor, e must be a minimal Weierstrass equation.\n            If this is not the case, use the function ellminimalmodel first\n            before using ellaplist (or you will get INCORRECT RESULTS!)\n        \n        \n        INPUT:\n        \n        \n        -  ``e`` - a PARI elliptic curve.\n        \n        -  ``n`` - an integer\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> v = e.ellaplist(10); v\n            [-2, -1, 1, -2]\n            >>> isinstance(v, gen)\n            True\n            >>> v.type()\n            't_VEC'\n            >>> e.ellan(10)\n            [1, -2, -1, 2, 1, 2, -2, 0, -2, -2]\n            >>> v = e.ellaplist(10, python_ints=True); v\n            [-2, -1, 1, -2]\n            >>> isinstance(v, list)\n            True\n            >>> isinstance(v[0], int)\n            True\n        ";
  static char __pyx_k_e_ellbil_z0_z1_return_the_value[] = "\n        e.ellbil(z0, z1): return the value of the canonical bilinear form\n        on z0 and z1.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve (assumed integral given by a\n           minimal model, as returned by ellminimalmodel)\n        \n        -  ``z0, z1`` - rational points on e\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit().ellminimalmodel()[0]\n            >>> e.ellbil([1, 0], [-1, 1])\n            0.418188984498861\n        ";
  static char __pyx_k_e_elleta_return_the_vector_eta1[] = "\n        e.elleta(): return the vector [eta1,eta2] of quasi-periods\n        associated with the period lattice e.omega() of the elliptic curve\n        e.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,0,0,-82,0]).ellinit()\n            >>> e.elleta()\n            [3.60546360143265, 3.60546360143265*I]\n            >>> w1,w2 = e.omega()\n            >>> eta1, eta2 = e.elleta()\n            >>> w1*eta2-w2*eta1\n            6.28318530717959*I\n            >>> w1*eta2-w2*eta1 == 2*pari.pi()*pari('I')\n            True\n        ";
  static char __pyx_k_e_ellglobalred_return_informati[] = "\n        e.ellglobalred(): return information related to the global minimal\n        model of the elliptic curve e.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve (returned by ellinit)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - the (arithmetic) conductor of e\n        \n        -  ``gen`` - a vector giving the coordinate change over\n           Q from e to its minimal integral model (see also ellminimalmodel)\n        \n        -  ``gen`` - the product of the local Tamagawa numbers\n           of e\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0, 5, 2, -1, 1]).ellinit()\n            >>> e.ellglobalred()\n            [20144, [1, -2, 0, -1], 1]\n            >>> e = pari([1, -1, 1, -1, -14]).ellinit()\n            >>> e.ellglobalred()\n            [17, [1, 0, 0, 0], 4]\n        ";
  static char __pyx_k_e_ellheight_a_flag_2_return_the[] = "\n        e.ellheight(a, flag=2): return the global Neron-Tate height of the\n        point a on the elliptic curve e.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve over `\\QQ`,\n           assumed to be in a standard minimal integral model (as given by\n           ellminimalmodel)\n        \n        -  ``a`` - rational point on e\n        \n        -  ``flag (optional)`` - specifies which algorithm to\n           be used for computing the archimedean local height:\n        \n           -  ``0`` - uses sigma- and theta-functions and a trick\n               due to J. Silverman\n\n           -  ``1`` - uses Tate's `4^n` algorithm\n\n           -  ``2`` - uses Mestre's AGM algorithm (this is the\n              default, being faster than the other two)\n        \n        -  ``precision (optional)`` - the precision of the\n           result, in bits.\n        \n        \n        Note that in order to achieve the desired precision, the\n        elliptic curve must have been created using ellinit with the\n        desired precision.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit().ellminimalmodel()[0]\n            >>> e.ellheight([1,0])\n            0.476711659343740\n            >>> e.ellheight([1,0], flag=0)\n            0.476711659343740\n            >>> e.ellheight([1,0], flag=1)\n            0.476711659343740\n        ";
  static char __pyx_k_e_ellisoncurve_x_return_True_if[] = "\n        e.ellisoncurve(x): return True if the point x is on the elliptic\n        curve e, False otherwise.\n        \n        If the point or the curve have inexact coefficients, an attempt is\n        made to take this into account.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit()\n            >>> e.ellisoncurve([1,0])\n            True\n            >>> e.ellisoncurve([1,1])\n            False\n            >>> e.ellisoncurve([1,0.00000000000000001])\n            False\n            >>> e.ellisoncurve([1,0.000000000000000001])\n            True\n            >>> e.ellisoncurve([0])\n            True\n        ";
  static char __pyx_k_e_elllocalred_p_computes_the_da[] = "\n        e.elllocalred(p): computes the data of local reduction at the prime\n        p on the elliptic curve e\n        \n        For more details on local reduction and Kodaira types, see IV.8 and\n        IV.9 in J. Silverman's book \"Advanced topics in the arithmetic of\n        elliptic curves\".\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve with coefficients in `\\ZZ`\n        \n        -  ``p`` - prime number\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - the exponent of p in the arithmetic\n           conductor of e\n        \n        -  ``gen`` - the Kodaira type of e at p, encoded as an\n           integer:\n        \n        -  ``1`` - type `I_0`: good reduction,\n           nonsingular curve of genus 1\n        \n        -  ``2`` - type `II`: rational curve with a\n           cusp\n        \n        -  ``3`` - type `III`: two nonsingular rational\n           curves intersecting tangentially at one point\n        \n        -  ``4`` - type `IV`: three nonsingular\n           rational curves intersecting at one point\n        \n        -  ``5`` - type `I_1`: rational curve with a\n           node\n        \n        -  ``6 or larger`` - think of it as `4+v`, then\n           it is type `I_v`: `v` nonsingular rational curves\n           arranged as a `v`-gon\n        \n        -  ``-1`` - type `I_0^*`: nonsingular rational\n           curve of multiplicity two with four nonsingular rational curves of\n           multiplicity one attached\n        \n        -  ``-2`` - type `II^*`: nine nonsingular\n           rational curves in a special configuration\n        \n        -  ``-3`` - type `III^*`: eight nonsingular\n           rational curves in a special configuration\n        \n        -  ``-4`` - type `IV^*`: seven nonsingular\n           rational curves in a special configuration\n        \n        -  ``-5 or smaller`` - think of it as `-4-v`,\n           then it is type `I_v^*`: chain of `""v+1`\n           nonsingular rational curves of multiplicity two, with two\n           nonsingular rational curves of multiplicity one attached at either\n           end\n        \n        -  ``gen`` - a vector with 4 components, giving the\n           coordinate changes done during the local reduction; if the first\n           component is 1, then the equation for e was already minimal at p\n        \n        -  ``gen`` - the local Tamagawa number `c_p`\n        \n        \n        EXAMPLES:\n        \n        Type `I_0`::\n        \n            >>> e = pari([0,0,0,0,1]).ellinit()\n            >>> e.elllocalred(7)\n            [0, 1, [1, 0, 0, 0], 1]\n        \n        Type `II`::\n        \n            >>> e = pari([0, 0, 1, 0, 0]).ellinit()\n            >>> e.elllocalred(3)\n            [3, 2, [1, -1, 0, 1], 1]\n        \n        Type `III`::\n        \n            >>> e = pari([0, -1, 0, 1, 0]).ellinit()\n            >>> e.elllocalred(2)\n            [3, 3, [1, 1, 0, 1], 2]\n        \n        Type `IV`::\n        \n            >>> e = pari([0, 1, 0, -1, 0]).ellinit()\n            >>> e.elllocalred(2)\n            [2, 4, [1, 1, 0, 1], 3]\n        \n        Type `I_1`::\n        \n            >>> e = pari([0, -1, 1, -7820, -263580]).ellinit()\n            >>> e.elllocalred(11)\n            [1, 5, [1, 0, 0, 0], 1]\n        \n        Type `I_2`::\n        \n            >>> e = pari([1, 0, 1, -1, 0]).ellinit()\n            >>> e.elllocalred(2)\n            [1, 6, [1, 0, 0, 0], 2]\n        \n        Type `I_6`::\n        \n            >>> e = pari([1, 0, 1, 4, -6]).ellinit()\n            >>> e.elllocalred(2)\n            [1, 10, [1, 0, 0, 0], 2]\n        \n        Type `I_0^*`::\n        \n            >>> e = pari([0, 0, 0, -11, -14]).ellinit()\n            >>> e.elllocalred(2)\n            [5, -1, [1, 1, 1, 0], 1]\n        \n        Type `II^*`::\n        \n            >>> e = pari([0, -1, 0, -384, -2772]).ellinit()\n            >>> e.elllocalred(2)\n            [3, ""-2, [1, 2, 1, 4], 1]\n        \n        Type `III^*`::\n        \n            >>> e = pari([0, -1, 0, -24, -36]).ellinit()\n            >>> e.elllocalred(2)\n            [3, -3, [1, 2, 1, 4], 2]\n        \n        Type `IV^*`::\n        \n            >>> e = pari([0, 1, 0, 4, 4]).ellinit()\n            >>> e.elllocalred(2)\n            [2, -4, [1, 0, 1, 2], 3]\n        \n        Type `I_1^*`::\n        \n            >>> e = pari([0, -1, 0, -4, 4]).ellinit()\n            >>> e.elllocalred(2)\n            [3, -5, [1, 0, 1, 2], 4]\n        \n        Type `I_6^*`::\n        \n            >>> e = pari([1, -1, 1, -167, -709]).ellinit()\n            >>> e.elllocalred(3)\n            [2, -10, [1, 96, 1, 316], 4]\n        ";
  static char __pyx_k_e_elllseries_s_A_1_return_the_v[] = "\n        e.elllseries(s, A=1): return the value of the `L`-series of\n        the elliptic curve e at the complex number s.\n        \n        This uses an `O(N^{1/2})` algorithm in the conductor N of\n        e, so it is impractical for large conductors (say greater than\n        `10^{12}`).\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve defined over `\\QQ`\n        \n        -  ``s`` - complex number\n        \n        -  ``A (optional)`` - cutoff point for the integral,\n           which must be chosen close to 1 for best speed.\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit()\n            >>> e.elllseries(2.1)\n            0.402838047956646\n            >>> e.elllseries(1)   # random, close to 0\n            -5.24750372566629 E-19\n            >>> e.elllseries(-2)\n            0\n        \n        The following example differs for the last digit on 32 vs. 64 bit\n        systems\n        \n        ::\n        \n            >>> e.elllseries(2.1, A=1.1)\n            0.402838047956646\n        ";
  static char __pyx_k_e_ellorder_x_return_the_order_o[] = "\n        e.ellorder(x): return the order of the point x on the elliptic\n        curve e (return 0 if x is not a torsion point)\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve defined over `\\QQ`\n        \n        -  ``x`` - point on e\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([1, 0, 0, -1, 0]).ellinit()\n        \n        A point of order two::\n        \n            >>> e.ellorder([0,0])\n            2\n        \n        And a point of infinite order::\n        \n            >>> e.ellorder([1,0])\n            0\n        ";
  static char __pyx_k_e_ellordinate_x_return_the_y_co[] = "\n        e.ellordinate(x): return the `y`-coordinates of the points\n        on the elliptic curve e having x as `x`-coordinate.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve\n        \n        -  ``x`` - x-coordinate (can be a complex or p-adic\n           number, or a more complicated object like a power series)\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit()\n            >>> e.ellordinate(0)\n            [0, -1]\n            >>> e.ellordinate('I')\n            [0.582203589721741 - 1.38606082464177*I, -1.58220358972174 + 1.38606082464177*I]\n            >>> e.ellordinate('1+3*5^1+O(5^3)')\n            [4*5 + 5^2 + O(5^3), 4 + 3*5^2 + O(5^3)]\n            >>> e.ellordinate('z+2*z^2+O(z^4)')\n            [-2*z - 7*z^2 - 23*z^3 + O(z^4), -1 + 2*z + 7*z^2 + 23*z^3 + O(z^4)]\n        ";
  static char __pyx_k_e_ellpointtoz_P_return_the_comp[] = "\n        e.ellpointtoz(P): return the complex number (in the fundamental\n        parallelogram) corresponding to the point P on the elliptic curve\n        e, under the complex uniformization of e given by the Weierstrass\n        p-function.\n        \n        The complex number z returned by this function lies in the\n        parallelogram formed by the real and complex periods of e, as given\n        by e.omega().\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,0,0,1,0]).ellinit()\n            >>> e.ellpointtoz([0,0])\n            1.85407467730137\n        \n        The point at infinity is sent to the complex number 0::\n        \n            >>> e.ellpointtoz([0])\n            0\n        ";
  static char __pyx_k_e_ellpow_z_n_return_n_times_the[] = "\n        e.ellpow(z, n): return `n` times the point `z` on the elliptic\n        curve `e`.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve\n        \n        -  ``z`` - point on `e`\n        \n        -  ``n`` - integer, or a complex quadratic integer of complex\n           multiplication for `e`. Complex multiplication currently\n           only works if `e` is defined over `Q`.\n        \n        \n        EXAMPLES: We consider a curve with CM by `Z[i]`::\n        \n            >>> e = pari([0,0,0,3,0]).ellinit()\n            >>> p = [1,2]  # Point of infinite order\n        \n        Multiplication by two::\n        \n            >>> e.ellpow([0,0], 2)\n            [0]\n            >>> e.ellpow(p, 2)\n            [1/4, -7/8]\n        \n        Complex multiplication::\n        \n            >>> q = e.ellpow(p, '1+I'); q\n            [-2*I, 1 + I]\n            >>> e.ellpow(q, '1-I')\n            [1/4, -7/8]\n        \n        # TESTS::\n        #\n        # Removed tests that require hilbert_class_polynomial\n        #\n        #sage: for D in [-7, -8, -11, -12, -16, -19, -27, -28]: # long time (1s)\n        #    ...       hcpol = hilbert_class_polynomial(D)\n        #    ...       j = hcpol.roots(multiplicities=False)[0]\n        #    ...       t = (1728-j)/(27*j)\n        #    ...       E = EllipticCurve([4*t,16*t^2])\n        #    ...       P = E.point([0, 4*t])\n        #    ...       assert(E.j_invariant() == j)\n        #    ...       #\n        #    ...       # Compute some CM number and its minimal polynomial\n        #    ...       #\n        #    ...       cm = pari('cm = (3*quadgen(%s)+2)'%D)\n        #    ...       cm_minpoly = pari('minpoly(cm)')\n        #    ...       #\n        #    ...       # Evaluate cm_minpoly(cm)(P), which should be zero\n        #    ...       #\n        #    ...       e = pari(E)  # Convert E to PARI\n        #    ...       P2 = e.ellpow(P, cm_minpoly[2]*cm + cm_minpoly[1])\n        #    .."".       P0 = e.elladd(e.ellpow(P, cm_minpoly[0]), e.ellpow(P2, cm)\n        ";
  static char __pyx_k_e_elltors_flag_0_return_informa[] = "\n        e.elltors(flag = 0): return information about the torsion subgroup\n        of the elliptic curve e\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve over `\\QQ`\n        \n        -  ``flag (optional)`` - specify which algorithm to\n           use:\n        \n        -  ``0 (default)`` - use Doud's algorithm: bound\n           torsion by computing the cardinality of e(GF(p)) for small primes\n           of good reduction, then look for torsion points using Weierstrass\n           parametrization and Mazur's classification\n        \n        -  ``1`` - use algorithm given by the Nagell-Lutz\n           theorem (this is much slower)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - the order of the torsion subgroup, a.k.a.\n           the number of points of finite order\n        \n        -  ``gen`` - vector giving the structure of the torsion\n           subgroup as a product of cyclic groups, sorted in non-increasing\n           order\n        \n        -  ``gen`` - vector giving points on e generating these\n           cyclic groups\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([1,0,1,-19,26]).ellinit()\n            >>> e.elltors()\n            [12, [6, 2], [[-2, 8], [3, -2]]]\n        ";
  static char __pyx_k_e_ellzeta_z_return_the_value_at[] = "\n        e.ellzeta(z): return the value at the complex point z of the\n        Weierstrass `\\zeta` function associated with the elliptic\n        curve e.\n        \n        .. note::\n\n           This function has infinitely many poles (one of which is at\n           z=0); attempting to evaluate it too close to one of the\n           poles will result in a PariError.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve\n        \n        -  ``z`` - complex number\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,0,0,1,0]).ellinit()\n            >>> e.ellzeta(1)     # 32-bit: 1.06479841295883 + 0.E-19*I \n            1.06479841295883 + 5.42101086242752 E-20*I\n            >>> e.ellzeta('I-1')\n            -0.350122658523049 - 0.350122658523049*I\n        ";
  static char __pyx_k_e_ellztopoint_z_return_the_poin[] = "\n        e.ellztopoint(z): return the point on the elliptic curve e\n        corresponding to the complex number z, under the usual complex\n        uniformization of e by the Weierstrass p-function.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve\n        \n        -  ``z`` - complex number\n        \n        \n        OUTPUT point on e\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,0,0,1,0]).ellinit()\n\n            # 32-bit:  [0.E-19 - 1.02152286795670*I, -0.149072813701096 - 0.149072813701096*I]\n            >>> e.ellztopoint('1+I')  # doctest: +ELLIPSIS\n            [... - 1.02152286795670*I, -0.149072813701096 - 0.149072813701096*I]\n        \n        Complex numbers belonging to the period lattice of e are of course\n        sent to the point at infinity on e::\n        \n            >>> e.ellztopoint(0)\n            [0]\n        ";
  static char __pyx_k_e_j_return_the_j_invariant_of_t[] = "\n        e.j(): return the j-invariant of the elliptic curve e.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.j()\n            -122023936/161051\n            >>> _.factor()\n            [-1, 1; 2, 12; 11, -5; 31, 3]\n        ";
  static char __pyx_k_e_omega_return_basis_for_the_pe[] = "\n        e.omega(): return basis for the period lattice of the elliptic\n        curve e.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.omega()\n            [1.26920930427955, -0.634604652139777 - 1.45881661693850*I]\n        ";
  static char __pyx_k_ellminimalmodel_e_return_the_st[] = "\n        ellminimalmodel(e): return the standard minimal integral model of\n        the rational elliptic curve e and the corresponding change of\n        variables. INPUT:\n        \n        \n        -  ``e`` - gen (that defines an elliptic curve)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - minimal model\n        \n        -  ``gen`` - change of coordinates\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([1,2,3,4,5]).ellinit()\n            >>> F, ch = e.ellminimalmodel()\n            >>> F[:5]\n            [1, -1, 0, 4, 3]\n            >>> ch\n            [1, -1, 0, -1]\n            >>> e.ellchangecurve(ch)[:5]\n            [1, -1, 0, 4, 3]\n        ";
  static char __pyx_k_frac_x_Return_the_fractional_pa[] = "\n        frac(x): Return the fractional part of x, which is x - floor(x).\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari(1.75).frac()\n            0.750000000000000\n            >>> pari('sqrt(2)').frac()\n            0.414213562373095\n            >>> pari('sqrt(-2)').frac()\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
  static char __pyx_k_gen_nfbasistoalg_lift_line_7066[] = "gen.nfbasistoalg_lift (line 7066)";
  static char __pyx_k_gen_python_list_small_line_1604[] = "gen.python_list_small (line 1604)";
  static char __pyx_k_imag_x_Return_the_imaginary_par[] = "\n        imag(x): Return the imaginary part of x. This function also works\n        component-wise.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('1+2*I').imag()\n            2\n            >>> pari('sqrt(-2)').imag()\n            1.41421356237310\n            >>> pari('x+I').imag()\n            1\n            >>> pari('x+2*I').imag()\n            2\n            >>> pari('(1+I)*x^2+2*I').imag()\n            x^2 + 2\n            >>> pari('[1,2,3] + [4*I,5,6]').imag()\n            [4, 0, 0]\n        ";
  static char __pyx_k_index_must_be_an_integer_or_a_2[] = "index must be an integer or a 2-tuple (i,j)";
  static char __pyx_k_index_s_must_be_between_0_and_s[] = "index (%s) must be between 0 and %s";
  static char __pyx_k_isprime_x_flag_0_Returns_True_i[] = "\n        isprime(x, flag=0): Returns True if x is a PROVEN prime number, and\n        False otherwise.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - int 0 (default): use a combination of\n           algorithms. 1: certify primality using the Pocklington-Lehmer Test.\n           2: certify primality using the APRCL test.\n        \n        \n        OUTPUT:\n        \n        \n        -  ``bool`` - True or False\n        \n        \n        EXAMPLES::\n        \n            >>> pari(9).isprime()\n            False\n            >>> pari(17).isprime()\n            True\n            >>> n = pari(561)    # smallest Carmichael number\n            >>> n.isprime()      # not just a pseudo-primality test!\n            False\n            >>> n.isprime(1)\n            False\n            >>> n.isprime(2)\n            False\n        ";
  static char __pyx_k_lift_x_v_Returns_the_lift_of_an[] = "\n        lift(x,v): Returns the lift of an element of Z/nZ to Z or R[x]/(P)\n        to R[x] for a type R if v is omitted. If v is given, lift only\n        polymods with main variable v. If v does not occur in x, lift only\n        intmods.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``v`` - (optional) variable\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> x = pari(\"x\")\n            >>> a = x.Mod('x^3 + 17*x + 3')\n            >>> a\n            Mod(x, x^3 + 17*x + 3)\n            >>> b = a**4; b\n            Mod(-17*x^2 - 3*x, x^3 + 17*x + 3)\n            >>> b.lift()\n            -17*x^2 - 3*x\n        \n        \077\077? more examples\n        ";
  static char __pyx_k_matsolve_B_Solve_the_linear_sys[] = "\n        matsolve(B): Solve the linear system Mx=B for an invertible matrix\n        M\n        \n        matsolve(B) uses Gaussian elimination to solve Mx=B, where M is\n        invertible and B is a column vector.\n        \n        The corresponding pari library routine is gauss. The gp-interface\n        name matsolve has been given preference here.\n        \n        INPUT:\n        \n        \n        -  ``B`` - a column vector of the same dimension as the\n           square matrix self\n        \n        \n        EXAMPLES::\n        \n            >>> pari('[1,1;1,-1]').matsolve(pari('[1;0]'))\n            [1/2; 1/2]\n        ";
  static char __pyx_k_nextprime_x_smallest_pseudoprim[] = "\n        nextprime(x): smallest pseudoprime greater than or equal to `x`.\n        If ``add_one`` is non-zero, return the smallest pseudoprime\n        strictly greater than `x`.\n        \n        EXAMPLES::\n        \n            >>> pari(1).nextprime()\n            2\n            >>> pari(2).nextprime()\n            2\n            >>> pari(2).nextprime(add_one = 1)\n            3\n            >>> pari(2**100).nextprime()\n            1267650600228229401496703205653\n        ";
  static char __pyx_k_nf_nfrootsof1_number_of_roots_o[] = "\n        nf.nfrootsof1()\n        \n        number of roots of unity and primitive root of unity in the number\n        field nf.\n        \n        EXAMPLES::\n        \n            >>> nf = pari('x^2 + 1').nfinit()\n            >>> nf.nfrootsof1()\n            [4, -x]\n        ";
  static char __pyx_k_nfbasis_d_x_Return_a_basis_of_t[] = "\n        nfbasis_d(x): Return a basis of the number field defined over QQ\n        by x and its discriminant.\n        \n        EXAMPLES::\n        \n            >>> F = pari('x^3-2').nfinit()\n            >>> F[0].nfbasis_d()\n            ([1, x, x^2], -108)\n        \n        ::\n        \n            >>> G = pari('x^5-11').nfinit()\n            >>> G[0].nfbasis_d()\n            ([1, x, x^2, x^3, x^4], 45753125)\n        \n        ::\n        \n            >>> pari([-2,0,0,1]).Polrev().nfbasis_d()\n            ([1, x, x^2], -108)\n        ";
  static char __pyx_k_nfbasis_x_flag_fa_integral_basi[] = "\n        nfbasis(x, flag, fa): integral basis of the field QQ[a], where ``a`` is\n        a root of the polynomial x.\n        \n        Binary digits of ``flag`` mean:\n        \n         - 1: assume that no square of a prime > primelimit divides the\n              discriminant of ``x``.\n         - 2: use round 2 algorithm instead of round 4.\n        \n        If present, ``fa`` provides the matrix of a partial factorization of\n        the discriminant of ``x``, useful if one wants only an order maximal at\n        certain primes only.\n        \n        EXAMPLES::\n        \n            >>> pari('x^3 - 17').nfbasis()\n            [1, x, 1/3*x^2 - 1/3*x + 1/3]\n        \n        We test ``flag`` = 1, noting it gives a wrong result when the\n        discriminant (-4 * `p`^2 * `q` in the example below) has a big square\n        factor::\n        \n            >>> p = pari(10**10).nextprime(); q = (p+1).nextprime()\n            >>> f = pari('x^2') + p**2*q\n            >>> f.nfbasis(1)   # Wrong result\n            [1, x]\n            >>> f.nfbasis()    # Correct result\n            [1, 1/10000000019*x]\n            >>> f.nfbasis(fa = \"[2,2; %s,2]\"%p)    # Correct result and faster\n            [1, 1/10000000019*x]\n        \n        TESTS:\n        \n        ``flag`` = 2 should give the same result::\n            \n            >>> pari('x^3 - 17').nfbasis(flag = 2)\n            [1, x, 1/3*x^2 - 1/3*x + 1/3]\n        ";
  static char __pyx_k_nfdisc_x_Return_the_discriminan[] = "\n        nfdisc(x): Return the discriminant of the number field defined over\n        QQ by x.\n        \n        EXAMPLES::\n        \n            >>> F = pari('x^3-2').nfinit()\n            >>> F[0].nfdisc()\n            -108\n        \n        ::\n        \n            >>> G = pari('x^5-11').nfinit()\n            >>> G[0].nfdisc()\n            45753125\n        \n        ::\n        \n            >>> f = pari('x^3-2')\n            >>> f\n            x^3 - 2\n            >>> f.nfdisc()\n            -108\n        ";
  static char __pyx_k_nfhilbert_nf_a_b_p_if_p_is_omit[] = "\n        nfhilbert(nf,a,b,{p}): if p is omitted, global Hilbert symbol (a,b)\n        in nf, that is 1 if X^2-aY^2-bZ^2 has a non-trivial solution (X,Y,Z)\n        in nf, -1 otherwise. Otherwise compute the local symbol modulo the\n        prime ideal p.\n\n        EXAMPLES::\n\n            >>> K = pari('x^3 - x + 1').nfinit()\n            >>> x = pari('x')\n            >>> K.nfhilbert(x, x+2)\n            -1\n            >>> P = K.idealprimedec(5)[0] # Primed ideal above 5\n            >>> K.nfhilbert(x, x+2, P)\n            -1\n            >>> P = K.idealprimedec(23)[1] # Prime ideal above 23, ramified\n            >>> K.nfhilbert(x, x+2, P)\n            1\n        ";
  static char __pyx_k_nfinit_pol_flag_0_pol_being_a_n[] = "\n        nfinit(pol, {flag=0}): ``pol`` being a nonconstant irreducible\n        polynomial, gives a vector containing all the data necessary for PARI\n        to compute in this number field.\n        \n        ``flag`` is optional and can be set to:\n         - 0: default\n         - 1: do not compute different\n         - 2: first use polred to find a simpler polynomial\n         - 3: outputs a two-element vector [nf,Mod(a,P)], where nf is as in 2\n              and Mod(a,P) is a polmod equal to Mod(x,pol) and P=nf.pol\n        \n        EXAMPLES::\n            \n            >>> pari('x^3 - 17').nfinit()\n            [x^3 - 17, [1, 1], -867, 3, [[1, 1.68006..., 2.57128...; 1, -0.340034... + 2.65083...*I, -1.28564... - 2.22679...*I], [1, 1.68006..., 2.57128...; 1, 2.31080..., -3.51243...; 1, -2.99087..., 0.941154...], [1, 2, 3; 1, 2, -4; 1, -3, 1], [3, 1, 0; 1, -11, 17; 0, 17, 0], [51, 0, 16; 0, 17, 3; 0, 0, 1], [17, 0, -1; 0, 0, 3; -1, 3, 2], [51, [-17, 6, -1; 0, -18, 3; 1, 0, -16]]], [2.57128..., -1.28564... - 2.22679...*I], [1, 1/3*x^2 - 1/3*x + 1/3, x], [1, 0, -1; 0, 0, 3; 0, 1, 1], [1, 0, 0, 0, -4, 6, 0, 6, -1; 0, 1, 0, 1, 1, -1, 0, -1, 3; 0, 0, 1, 0, 2, 0, 1, 0, 1]]\n            \n        TESTS:\n        \n        This example only works after increasing precision::\n        \n            >>> pari('x^2 + 10^100 + 1').nfinit(precision=64)\n            Traceback (most recent call last):\n            ...\n            PariError: precision too low (10)\n            >>> pari('x^2 + 10^100 + 1').nfinit()\n            [...]\n\n        Throw a PARI error which is not precer::\n        \n            >>> pari('1.0').nfinit()\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
  static char __pyx_k_nfisisom_x_y_Determine_if_the_n[] = "\n        nfisisom(x, y): Determine if the number fields defined by x and y\n        are isomorphic. According to the PARI documentation, this is much\n        faster if at least one of x or y is a number field. If they are\n        isomorphic, it returns an embedding for the generators. If not,\n        returns 0.\n        \n        EXAMPLES::\n        \n            >>> F = pari('x^3-2').nfinit()\n            >>> G = pari('x^3-2').nfinit()\n            >>> F.nfisisom(G)\n            [x]\n        \n        ::\n        \n            >>> GG = pari('x^3-4').nfinit()\n            >>> F.nfisisom(GG)\n            [1/2*x^2]\n        \n        ::\n        \n            >>> F.nfisisom(GG)\n            [1/2*x^2]\n        \n        ::\n        \n            >>> F.nfisisom(GG[0])\n            [x^2]\n        \n        ::\n        \n            >>> H = pari('x^2-2').nfinit()\n            >>> F.nfisisom(H)\n            0\n        ";
  static char __pyx_k_not_the_same_prime_in_padicprec[] = "not the same prime in padicprec";
  static char __pyx_k_nu_besselk_x_flag_0_K_Bessel_fu[] = "\n        nu.besselk(x, flag=0): K-Bessel function (modified Bessel function\n        of the second kind) of index nu, which can be complex, and argument\n        x.\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        INPUT:\n        \n        \n        -  ``nu`` - a complex number\n        \n        -  ``x`` - real number (positive or negative)\n        \n        -  ``flag`` - default: 0 or 1: use hyperu (hyperu is\n           much slower for small x, and doesn't work for negative x).\n        \n        \n        EXAMPLES::\n        \n            >>> pari('2+I').besselk(3)\n            0.0455907718407551 + 0.0289192946582081*I\n        \n        ::\n        \n            >>> pari('2+I').besselk(-3)\n            -4.34870874986752 - 5.38744882697109*I\n        \n        ::\n        \n            >>> pari(2+1j).besselk(300, flag=1)\n            3.74224603319728 E-132 + 2.49071062641525 E-134*I\n        ";
  static char __pyx_k_numbpart_x_returns_the_number_o[] = "\n        numbpart(x): returns the number of partitions of x.\n        \n        EXAMPLES::\n        \n            >>> pari(20).numbpart()\n            627\n            >>> pari(100).numbpart()\n            190569292\n        ";
  static char __pyx_k_om_elleisnum_k_flag_0_om_om1_om[] = "\n        om.elleisnum(k, flag=0): om=[om1,om2] being a 2-component vector\n        giving a basis of a lattice L and k an even positive integer,\n        computes the numerical value of the Eisenstein series of weight k.\n        When flag is non-zero and k=4 or 6, this gives g2 or g3 with the\n        correct normalization.\n        \n        INPUT:\n        \n        \n        -  ``om`` - gen, 2-component vector giving a basis of a\n           lattice L\n        \n        -  ``k`` - int (even positive)\n        \n        -  ``flag`` - int (default 0)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - numerical value of E_k\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit()\n            >>> om = e.omega()\n            >>> om\n            [2.49021256085506, -1.97173770155165*I]\n            >>> om.elleisnum(2) # was:  -5.28864933965426\n            10.0672605281120\n            >>> om.elleisnum(4)\n            112.000000000000\n            >>> om.elleisnum(100)\n            2.15314248576078 E50\n        ";
  static char __pyx_k_padicprec_x_p_Return_the_absolu[] = "\n        padicprec(x,p): Return the absolute p-adic precision of the object\n        x.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: int\n        \n        EXAMPLES::\n\n            >>> y = pari('11^-10 + 5*11^-7 + 11^-6 +O(11^-5)')\n            >>> y.padicprec(11)\n            -5\n            >>> y.padicprec(17)\n            Traceback (most recent call last):\n            ...\n            ValueError: not the same prime in padicprec\n        ";
  static char __pyx_k_polcyclo_n_v_x_cyclotomic_polyn[] = "\n        polcyclo(n, v=x): cyclotomic polynomial of degree n, in variable\n        v.\n        \n        EXAMPLES::\n        \n            >>> pari.polcyclo(8)\n            x^4 + 1\n            >>> pari.polcyclo(7, 'z')\n            z^6 + z^5 + z^4 + z^3 + z^2 + z + 1\n            >>> pari.polcyclo(1)\n            x - 1\n        ";
  static char __pyx_k_pollegendre_n_v_x_Legendre_poly[] = "\n        pollegendre(n, v=x): Legendre polynomial of degree n (n C-integer),\n        in variable v.\n        \n        EXAMPLES::\n        \n            >>> pari.pollegendre(7)\n            429/16*x^7 - 693/16*x^5 + 315/16*x^3 - 35/16*x\n            >>> pari.pollegendre(7, 'z')\n            429/16*z^7 - 693/16*z^5 + 315/16*z^3 - 35/16*z\n            >>> pari.pollegendre(0)\n            1\n        ";
  static char __pyx_k_poltchebi_n_v_x_Chebyshev_polyn[] = "\n        poltchebi(n, v=x): Chebyshev polynomial of the first kind of degree\n        n, in variable v.\n        \n        EXAMPLES::\n        \n            >>> pari.poltchebi(7)\n            64*x^7 - 112*x^5 + 56*x^3 - 7*x\n            >>> pari.poltchebi(7, 'z')\n            64*z^7 - 112*z^5 + 56*z^3 - 7*z\n            >>> pari.poltchebi(0)\n            1\n        ";
  static char __pyx_k_prime_list_n_returns_list_of_th[] = "\n        prime_list(n): returns list of the first n primes\n        \n        To extend the table of primes use pari.init_primes(M).\n        \n        INPUT:\n        \n        \n        -  ``n`` - C long\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - PARI list of first n primes\n        \n        \n        EXAMPLES::\n        \n            >>> pari.prime_list(0)\n            []\n            >>> pari.prime_list(-1)\n            []\n            >>> pari.prime_list(3)\n            [2, 3, 5]\n            >>> pari.prime_list(10)\n            [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\n            >>> pari.prime_list(20)\n            [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]\n            >>> len(pari.prime_list(1000))\n            1000\n        ";
  static char __pyx_k_q_theta_z_Jacobi_sine_theta_fun[] = "\n        q.theta(z): Jacobi sine theta-function.\n        \n        If `q` or `z` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0.5).theta(2)\n            1.63202590295260\n        ";
  static char __pyx_k_rnfidealdown_rnf_x_finds_the_in[] = "\n        rnfidealdown(rnf,x): finds the intersection of the ideal x with the base field.\n\n        EXAMPLES:\n            >>> x = pari('x')\n            >>> y = pari('y')\n            >>> nf = pari(y**2 - 6*y + 24).nfinit()\n            >>> rnf = nf.rnfinit(x**2 - pari(y))\n\n        This is the relative HNF of the inert ideal (2) in rnf:\n\n            >>> P = pari('[[[1, 0]~, [0, 0]~; [0, 0]~, [1, 0]~], [[2, 0; 0, 2], [2, 0; 0, 1/2]]]')\n\n        And this is the HNF of the inert ideal (2) in nf:\n\n            >>> rnf.rnfidealdown(P)\n            [2, 0; 0, 2]\n        ";
  static char __pyx_k_row_i_s_must_be_between_0_and_s[] = "row i(=%s) must be between 0 and %s";
  static char __pyx_k_s_gamma_precision_Gamma_functio[] = "\n        s.gamma(precision): Gamma function at s.\n        \n        If `s` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `s` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).gamma()\n            1.00000000000000\n            >>> pari(5).gamma()\n            24.0000000000000\n            >>> pari('1+I').gamma()\n            0.498015668118356 - 0.154949828301811*I\n\n        TESTS::\n\n            >>> pari(-1).gamma()\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n        ";
  static char __pyx_k_s_gammah_Gamma_function_evaluat[] = "\n        s.gammah(): Gamma function evaluated at the argument x+1/2.\n        \n        If `s` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `s` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).gammah()\n            1.32934038817914\n            >>> pari(5).gammah()\n            52.3427777845535\n            >>> pari('1+I').gammah()\n            0.575315188063452 + 0.0882106775440939*I\n        ";
  static char __pyx_k_s_incgam_x_y_precision_incomple[] = "\n        s.incgam(x, y, precision): incomplete gamma function. y is optional\n        and is the precomputed value of gamma(s).\n        \n        If `s` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `s` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari('1+I').incgam('3-I')\n            -0.0458297859919946 + 0.0433696818726677*I\n        ";
  static char __pyx_k_s_incgamc_x_complementary_incom[] = "\n        s.incgamc(x): complementary incomplete gamma function.\n        \n        The arguments `x` and `s` are complex numbers such\n        that `s` is not a pole of `\\Gamma` and\n        `|x|/(|s|+1)` is not much larger than `1`\n        (otherwise, the convergence is very slow). The function returns the\n        value of the integral\n        `\\int_{0}^{x} e^{-t} t^{s-1} dt.`\n        \n        If `s` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).incgamc(2)\n            0.864664716763387\n        ";
  static char __pyx_k_self_ellchangepoint_y_change_da[] = "\n        self.ellchangepoint(y): change data on point or vector of points\n        self on an elliptic curve according to y=[u,r,s,t]\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit()\n            >>> x = pari([1,0])\n            >>> e.ellisoncurve([1,4])\n            False\n            >>> e.ellisoncurve(x)\n            True\n            >>> f = e.ellchangecurve([1,2,3,-1])\n            >>> f[:5]   # show only first five entries\n            [6, -2, -1, 17, 8]\n            >>> x.ellchangepoint([1,2,3,-1])\n            [-1, 4]\n            >>> f.ellisoncurve([-1,4])\n            True\n        ";
  static char __pyx_k_self_must_be_of_PARI_type_t_MAT[] = "self must be of PARI type t_MAT";
  static char __pyx_k_serreverse_f_reversion_of_the_p[] = "\n        serreverse(f): reversion of the power series f.\n        \n        If f(t) is a series in t with valuation 1, find the series g(t)\n        such that g(f(t)) = t.\n        \n        EXAMPLES::\n        \n            >>> f = pari('x+x^2+x^3+O(x^4)'); f\n            x + x^2 + x^3 + O(x^4)\n            >>> g = f.serreverse(); g\n            x - x^2 + x^3 + O(x^4)\n            >>> f.subst('x',g)\n            x + O(x^4)\n            >>> g.subst('x',f)\n            x + O(x^4)\n        ";
  static char __pyx_k_sizedigit_x_Return_a_quick_esti[] = "\n        sizedigit(x): Return a quick estimate for the maximal number of\n        decimal digits before the decimal point of any component of x.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``int`` - Python integer\n        \n        \n        EXAMPLES::\n        \n            >>> x = pari('10^100')\n            >>> x.Str().length()\n            101\n            >>> x.sizedigit()\n            101\n        \n        Note that digits after the decimal point are ignored.\n        \n        ::\n        \n            >>> x = pari('1.234')\n            >>> x\n            1.23400000000000\n            >>> x.sizedigit()\n            1\n        \n        The estimate can be one too big::\n        \n            >>> pari('7234.1').sizedigit()\n            4\n            >>> pari('9234.1').sizedigit()\n            5\n        ";
  static char __pyx_k_teichmuller_x_teichmuller_chara[] = "\n        teichmuller(x): teichmuller character of p-adic number x.\n        \n        This is the unique `(p-1)`-st root of unity congruent to\n        `x/p^{v_p(x)}` modulo `p`.\n        \n        EXAMPLES::\n        \n            >>> pari('2+O(7^5)').teichmuller()\n            2 + 4*7 + 6*7^2 + 3*7^3 + O(7^5)\n        ";
  static char __pyx_k_truncate_x_estimate_False_Retur[] = "\n        truncate(x,estimate=False): Return the truncation of x. If estimate\n        is True, also return the number of error bits.\n        \n        When x is in the real numbers, this means that the part after the\n        decimal point is chopped away, e is the binary exponent of the\n        difference between the original and truncated value (the\n        \"fractional part\"). If x is a rational function, the result is the\n        integer part (Euclidean quotient of numerator by denominator) and\n        if requested the error estimate is 0.\n        \n        When truncate is applied to a power series (in X), it transforms it\n        into a polynomial or a rational function with denominator a power\n        of X, by chopping away the `O(X^k)`. Similarly, when\n        applied to a p-adic number, it transforms it into an integer or a\n        rational number by chopping away the `O(p^k)`.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``estimate`` - (optional) bool, which is False by\n           default\n        \n        \n        OUTPUT: \n\n        - if estimate is False, return a single gen.\n\n        - if estimate is True, return rounded version of x and error\n          estimate in bits, both as gens.\n\n        EXAMPLES::\n        \n            >>> pari('(x^2+1)/x').round()\n            (x^2 + 1)/x\n            >>> pari('(x^2+1)/x').truncate()\n            x\n            >>> pari('1.043').truncate()\n            1\n            >>> pari('1.043').truncate(True)\n            (1, -5)\n            >>> pari('1.6').truncate()\n            1\n            >>> pari('1.6').round()\n            2\n            >>> pari('1/3 + 2 + 3^2 + O(3^3)').truncate()\n            34/3\n            >>> pari('sin(x+O(x^10))').truncate()\n            1/362880*x^9 - 1/5040*x^7 + 1/120*x^5 - 1/6*x^3 + x\n            >>> pari('sin(x+O(x^10))').round()   # each coefficient has abs < 1\n            x + O(x^10)\n        ";
  static char __pyx_k_valuation_x_p_Return_the_valuat[] = "\n        valuation(x,p): Return the valuation of x with respect to p.\n        \n        The valuation is the highest exponent of p dividing x.\n        \n        - If p is an integer, x must be an integer, an intmod whose\n          modulus is divisible by p, a rational number, a p-adic\n          number, or a polynomial or power series in which case the\n          valuation is the minimum of the valuations of the\n          coefficients.\n        \n        - If p is a polynomial, x must be a polynomial or a rational\n          function. If p is a monomial then x may also be a power\n          series.\n        \n        - If x is a vector, complex or quadratic number, then the\n          valuation is the minimum of the component valuations.\n        \n        - If x = 0, the result is `2^31-1` on 32-bit machines or\n          `2^63-1` on 64-bit machines if x is an exact\n          object. If x is a p-adic number or power series, the result\n          is the exponent of the zero.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``p`` - coercible to gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - integer\n        \n        \n        EXAMPLES::\n        \n            >>> pari(9).valuation(3)\n            2\n            >>> pari(9).valuation(9)\n            1\n            >>> x = pari(9).Mod(27); x.valuation(3)\n            2\n            >>> pari('5/3').valuation(3)\n            -1\n            >>> pari('9 + 3*x + 15*x^2').valuation(3)\n            1\n            >>> pari([9,3,15]).valuation(3)\n            1\n            >>> pari('9 + 3*x + 15*x^2 + O(x^5)').valuation(3)\n            1\n        \n        ::\n        \n            >>> pari('x^2*(x+1)^3').valuation(pari('x+1'))\n            3\n            >>> pari('x + O(x^5)').valuation('x')\n            1\n            >>> pari('2*x^2 + O(x^5)').valuation('x')\n            2\n        \n        ::\n        \n            >>> pari(0).valuation""(3)    # 32-bit:   2147483647\n            9223372036854775807\n        ";
  static char __pyx_k_variable_x_Return_the_main_vari[] = "\n        variable(x): Return the main variable of the object x, or p if x is\n        a p-adic number.\n        \n        This function raises a TypeError exception on scalars, i.e., on\n        objects with no variable associated to them.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('x^2 + x -2').variable()\n            x\n            >>> pari('1+2^3 + O(2^5)').variable()\n            2\n            >>> pari('x+y0').variable()\n            x\n            >>> pari('y0+z0').variable()\n            y0\n        ";
  static char __pyx_k_vector_long_n_entries_None_Crea[] = "\n        vector(long n, entries=None): Create and return the length n PARI\n        vector with given list of entries.\n        \n        EXAMPLES::\n        \n            >>> pari.vector(5, [1, 2, 5, 4, 3])\n            [1, 2, 5, 4, 3]\n            >>> pari.vector(2, ['x', 1])\n            [x, 1]\n            >>> pari.vector(2, ['x', 1, 5])\n            Traceback (most recent call last):\n            ...\n            IndexError: length of entries (=3) must equal n (=2)\n        ";
  static char __pyx_k_x_eta_flag_0_if_flag_0_eta_func[] = "\n        x.eta(flag=0): if flag=0, `\\eta` function without the\n        `q^{1/24}`; otherwise `\\eta` of the complex number\n        `x` in the upper half plane intelligently computed using\n        `\\mathrm{SL}(2,\\ZZ)` transformations.\n        \n        DETAILS: This functions computes the following. If the input\n        `x` is a complex number with positive imaginary part, the\n        result is `\\prod_{n=1}^{\\infty} (q-1^n)`, where\n        `q=e^{2 i \\pi x}`. If `x` is a power series\n        (or can be converted to a power series) with positive valuation,\n        the result is `\\prod_{n=1}^{\\infty} (1-x^n)`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari('I').eta()\n            0.998129069925959\n        ";
  static char __pyx_k_x_log_natural_logarithm_of_x_Th[] = "\n        x.log(): natural logarithm of x.\n        \n        This function returns the principal branch of the natural logarithm\n        of `x`, i.e., the branch such that\n        `\\Im(\\log(x)) \\in ]-\\pi, \\pi].` The result is\n        complex (with imaginary part equal to `\\pi`) if\n        `x\\in \\RR` and `x<0`. In general, the algorithm uses\n        the formula\n        \n        .. math::\n        \n                         \\log(x) \\simeq \\frac{\\pi}{2{\\rm agm}(1,4/s)} - m\\log(2),         \n        \n        \n        if `s=x 2^m` is large enough. (The result is exact to\n        `B` bits provided that `s>2^{B/2}`.) At low\n        accuracies, this function computes `\\log` using the series\n        expansion near `1`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        Note that `p`-adic arguments can also be given as input,\n        with the convention that `\\log(p)=0`. Hence, in particular,\n        `\\exp(\\log(x))/x` is not in general equal to `1`\n        but instead to a `(p-1)`-st root of unity (or\n        `\\pm 1` if `p=2`) times a power of `p`.\n        \n        EXAMPLES::\n        \n            >>> pari(5).log()\n            1.60943791243410\n            >>> pari(1j).log()\n            0.E-19 + 1.57079632679490*I\n        ";
  static char __pyx_k_x_matsnf_flag_0_Smith_normal_fo[] = "\n        x.matsnf(flag=0): Smith normal form (i.e. elementary divisors) of\n        the matrix x, expressed as a vector d. Binary digits of flag mean\n        1: returns [u,v,d] where d=u\\*x\\*v, otherwise only the diagonal d\n        is returned, 2: allow polynomial entries, otherwise assume x is\n        integral, 4: removes all information corresponding to entries equal\n        to 1 in d.\n        \n        EXAMPLES::\n        \n            >>> pari('[1,2,3; 4,5,6;  7,8,9]').matsnf()\n            [0, 3, 1]\n        ";
  static char __pyx_k_x_newtonpoly_p_Newton_polygon_o[] = "\n        x.newtonpoly(p): Newton polygon of polynomial x with respect to the\n        prime p.\n        \n        EXAMPLES::\n        \n            >>> x = pari('y^8+6*y^6-27*y^5+1/9*y^2-y+1')\n            >>> x.newtonpoly(3)\n            [1, 1, -1/3, -1/3, -1/3, -1/3, -1/3, -1/3]\n        ";
  static char __pyx_k_x_polylog_m_flag_0_m_th_polylog[] = "\n        x.polylog(m,flag=0): m-th polylogarithm of x. flag is optional, and\n        can be 0: default, 1: D_m -modified m-th polylog of x, 2:\n        D_m-modified m-th polylog of x, 3: P_m-modified m-th polylog of\n        x.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        TODO: Add more explanation, copied from the PARI manual.\n        \n        EXAMPLES::\n        \n            >>> pari(10).polylog(3)\n            5.64181141475134 - 8.32820207698027*I\n            >>> pari(10).polylog(3,0)\n            5.64181141475134 - 8.32820207698027*I\n            >>> pari(10).polylog(3,1)\n            0.523778453502411\n            >>> pari(10).polylog(3,2)\n            -0.400459056163451\n        ";
  static char __pyx_k_x_sqr_square_of_x_Faster_than_a[] = "\n        x.sqr(): square of x. Faster than, and most of the time (but not\n        always - see the examples) identical to x\\*x.\n        \n        EXAMPLES::\n        \n            >>> pari(2).sqr()\n            4\n        \n        For `2`-adic numbers, x.sqr() may not be identical to x\\*x\n        (squaring a `2`-adic number increases its precision)::\n        \n            >>> pari(\"1+O(2^5)\").sqr()\n            1 + O(2^6)\n            >>> pari(\"1+O(2^5)\")*pari(\"1+O(2^5)\")\n            1 + O(2^5)\n        \n        However::\n        \n            >>> x = pari(\"1+O(2^5)\"); x*x\n            1 + O(2^6)\n        ";
  static char __pyx_k_x_sqrt_precision_The_square_roo[] = "\n        x.sqrt(precision): The square root of x.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).sqrt()\n            1.41421356237310\n        ";
  static char __pyx_k_x_tan_tangent_of_x_If_x_is_an_e[] = "\n        x.tan() - tangent of x\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).tan()\n            -2.18503986326152\n            >>> pari(1j).tan()\n            0.E-308 + 0.761594155955765*I\n        ";
  static char __pyx_k_x_weber_flag_0_One_of_Weber_s_f[] = "\n        x.weber(flag=0): One of Weber's f functions of x. flag is optional,\n        and can be 0: default, function\n        f(x)=exp(-i\\*Pi/24)\\*eta((x+1)/2)/eta(x) such that\n        `j=(f^{24}-16)^3/f^{24}`, 1: function f1(x)=eta(x/2)/eta(x)\n        such that `j=(f1^24+16)^3/f2^{24}`, 2: function\n        f2(x)=sqrt(2)\\*eta(2\\*x)/eta(x) such that\n        `j=(f2^{24}+16)^3/f2^{24}`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        TODO: Add further explanation from PARI manual.\n        \n        EXAMPLES::\n        \n            >>> pari('I').weber()  # 32-bit: 1.18920711500272 + 0.E-19*I \n            1.18920711500272 + 2.71050543121376 E-20*I\n            >>> pari(1j).weber(1)    \n            1.09050773266526 + 0.E-308*I\n            >>> pari('I').weber(2)\n            1.09050773266526\n        ";
  static char __pyx_k_Object_s_must_be_of_type_t_VECSM[] = "Object (=%s) must be of type t_VECSMALL.";
  static char __pyx_k_PariInstance__primelimit_line_94[] = "PariInstance._primelimit (line 9491)";
  static char __pyx_k_PariInstance__real_coerced_to_bi[] = "PariInstance._real_coerced_to_bits_prec (line 9223)";
  static char __pyx_k_PariInstance_factorial_line_9659[] = "PariInstance.factorial (line 9659)";
  static char __pyx_k_PariInstance_init_primes_line_94[] = "PariInstance.init_primes (line 9418)";
  static char __pyx_k_PariInstance_pollegendre_line_96[] = "PariInstance.pollegendre (line 9625)";
  static char __pyx_k_PariInstance_polsubcyclo_line_96[] = "PariInstance.polsubcyclo (line 9694)";
  static char __pyx_k_PariInstance_poltchebi_line_9642[] = "PariInstance.poltchebi (line 9642)";
  static char __pyx_k_PariInstance_prime_list_line_950[] = "PariInstance.prime_list (line 9506)";
  static char __pyx_k_PariInstance_primes_up_to_n_line[] = "PariInstance.primes_up_to_n (line 9544)";
  static char __pyx_k_Returns_a_vector_of_generators_2[] = "\n        Returns a vector of generators of the group `(O_K/I)^*`, where\n        `I` is the ideal represented by ``self``.\n        \n        NOTE: ``self`` must be a \"big ideal\" (``bid``) with generators,\n        as returned by ``idealstar`` with ``flag`` = 2.\n        \n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^2+1)')\n            >>> J = K.idealstar(pari('4*x + 2'), 2)\n            >>> J.bid_get_gen()\n            [7, [-2, -1]~]\n        \n        We get an exception if we do not supply ``flag = 2`` to\n        ``idealstar``::\n            \n            >>> J = K.idealstar(3)\n            >>> J.bid_get_gen()\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n        ";
  static char __pyx_k_This_is_probably_an_infinite_loo[] = "This is probably an infinite loop...";
  static char __pyx_k_Transforms_the_column_vector_x_2[] = "\n        Transforms the column vector ``x`` on the integral basis into a\n        polynomial representing the algebraic number.\n        \n        INPUT:\n        \n         - ``nf`` -- a number field\n         - ``x`` -- a column of rational numbers of length equal to the\n           degree of ``nf`` or a single rational number\n        \n        OUTPUT:\n        \n         - ``nf.nfbasistoalg(x).lift()``\n        \n        EXAMPLES::\n        \n            >>> K = pari('x^3 - 17').nfinit()\n            >>> K.getattr('zk')\n            [1, 1/3*x^2 - 1/3*x + 1/3, x]\n            >>> K.nfbasistoalg_lift(42)\n            42\n            >>> K.nfbasistoalg_lift(\"[3/2, -5, 0]~\")\n            -5/3*x^2 + 5/3*x - 1/6\n            >>> K.getattr('zk') * pari(\"[3/2, -5, 0]~\")\n            -5/3*x^2 + 5/3*x - 1/6\n        ";
  static char __pyx_k_Unable_to_allocate_s_bytes_memor[] = "Unable to allocate %s bytes memory for PARI.";
  static char __pyx_k_Use_for_exponentiation_not_which[] = "Use ** for exponentiation, not '^', which means xor\n";
  static char __pyx_k_attempt_to_assign_sequence_of_si[] = "attempt to assign sequence of size %s to slice of size %s";
  static char __pyx_k_cannot_index_PARI_type_s_by_tupl[] = "cannot index PARI type %s by tuple";
  static char __pyx_k_column_j_s_must_be_between_0_and[] = "column j(=%s) must be between 0 and %s";
  static char __pyx_k_gen_change_variable_name_line_83[] = "gen.change_variable_name (line 8368)";
  static char __pyx_k_gen_must_be_of_PARI_type_t_INT_o[] = "gen must be of PARI type t_INT or t_POL of degree 0";
  static char __pyx_k_in_Python_and_has_the_wrong_prec[] = "in Python, and has the wrong precedence.";
  static char __pyx_k_input_v_must_be_of_type_vecsmall[] = "input v must be of type vecsmall (use v.Vecsmall())";
  static char __pyx_k_length_of_entries_s_must_equal_n[] = "length of entries (=%s) must equal n (=%s)";
  static char __pyx_k_matrix_index_must_be_of_the_form[] = "matrix index must be of the form [row, column]";
  static char __pyx_k_nth_prime_meaningless_for_non_po[] = "nth prime meaningless for non-positive n (=%s)";
  static char __pyx_k_p_s_must_be_of_type_t_INT_but_is[] = "p (=%s) must be of type t_INT, but is of type %s.";
  static char __pyx_k_s_must_be_nonnegative_and_not_to[] = "s must be nonnegative and not too big.";
  static char __pyx_k_x_s_must_be_of_type_t_INT_but_is[] = "x (=%s) must be of type t_INT, but is of type %s.";
  static char __pyx_k_x_s_must_be_of_type_t_VEC_but_is[] = "x (=%s) must be of type t_VEC, but is of type %s.";
  static char __pyx_k_Convert_from_precision_expresse_2[] = "\n    Convert from precision expressed in decimal to precision expressed\n    in bits.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_dec_to_bits(15)\n        49\n        >>> [(n,gen.prec_dec_to_bits(n)) for n in range(10,100,10)]\n        [(10, 33), (20, 66), (30, 99), (40, 132), (50, 166), (60, 199), (70, 232), (80, 265), (90, 298)]\n    ";
  static char __pyx_k_Convert_from_precision_expresse_3[] = "\n    Convert from precision expressed in bits to pari real precision\n    expressed in words. Note: this rounds up to the nearest word,\n    adjusts for the two codewords of a pari real, and is\n    architecture-dependent.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_bits_to_words(70)    # 32-bit:  5\n        4\n    \n    ::\n\n        # 32-bit: [(32, 3), (64, 4), (96, 5), (128, 6), (160, 7), (192, 8), (224, 9), (256, 10)]\n        >>> [(32*n,gen.prec_bits_to_words(32*n)) for n in range(1,9)]\n        [(32, 3), (64, 3), (96, 4), (128, 4), (160, 5), (192, 5), (224, 6), (256, 6)]\n    ";
  static char __pyx_k_Convert_from_precision_expresse_4[] = "\n    Convert from precision expressed in decimal to precision expressed\n    in words. Note: this rounds up to the nearest word, adjusts for the\n    two codewords of a pari real, and is architecture-dependent.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_dec_to_words(38)   # 32-bit: 6\n        4\n        \n        # 32-bit: [(10, 4), (20, 5), (30, 6), (40, 7), (50, 8), (60, 9), (70, 10), (80, 11)] \n        >>> [(n,gen.prec_dec_to_words(n)) for n in range(10,90,10)]\n        [(10, 3), (20, 4), (30, 4), (40, 5), (50, 5), (60, 6), (70, 6), (80, 7)]\n        \n    ";
  static char __pyx_k_Convert_from_precision_expresse_5[] = "\n    Convert from precision expressed in words to precision expressed in\n    decimal. Note: this adjusts for the two codewords of a pari real,\n    and is architecture-dependent.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_words_to_dec(5)    # 32-bit: 28\n        57\n\n        # 32-bit: [(3, 9), (4, 19), (5, 28), (6, 38), (7, 48), (8, 57), (9, 67)] \n        >>> [(n,gen.prec_words_to_dec(n)) for n in range(3,10)]\n        [(3, 19), (4, 38), (5, 57), (6, 77), (7, 96), (8, 115), (9, 134)]\n    ";
  static char __pyx_k_Return_a_Python_list_of_the_PAR_2[] = "\n        Return a Python list of the PARI gens. This object must be of type\n        t_VEC\n        \n        INPUT: NoneOUTPUT:\n        \n        \n        -  ``list`` - Python list whose elements are the\n           elements of the input gen.\n        \n        \n        EXAMPLES::\n        \n            >>> v=pari([1,2,3,10,102,10])\n            >>> w = v.python_list()\n            >>> w\n            [1, 2, 3, 10, 102, 10]\n            >>> isinstance(w[0], gen)\n            True\n            >>> pari(\"[1,2,3]\").python_list()\n            [1, 2, 3]\n        ";
  static char __pyx_k_Transform_the_object_x_into_a_c_2[] = "\n        Transform the object `x` into a column vector with minimal size `|n|`.\n        The order of the resulting vector is reversed compared to :meth:`Col`.\n        \n        INPUT:\n        \n        - ``x`` -- gen\n        \n        - ``n`` -- Make the vector of minimal length `|n|`. If `n > 0`,\n          prepend zeros; if `n < 0`, append zeros.\n        \n        OUTPUT:\n        \n        A PARI column vector (type ``t_COL``)\n        \n        EXAMPLES::\n        \n            >>> pari(1.5).Colrev()\n            [1.50000000000000]~\n            >>> pari([1,2,3,4]).Colrev()\n            [4, 3, 2, 1]~\n            >>> pari('[1,2; 3,4]').Colrev()\n            [[3, 4], [1, 2]]~\n            >>> pari('x + 3*x^3').Colrev()\n            [0, 1, 0, 3]~\n\n        We demonstate the `n` argument::\n\n            >>> pari([1,2,3,4]).Colrev(2)\n            [4, 3, 2, 1]~\n            >>> pari([1,2,3,4]).Colrev(-2)\n            [4, 3, 2, 1]~\n            >>> pari([1,2,3,4]).Colrev(6)\n            [0, 0, 4, 3, 2, 1]~\n            >>> pari([1,2,3,4]).Colrev(-6)\n            [4, 3, 2, 1, 0, 0]~\n        ";
  static char __pyx_k_Transform_the_object_x_into_a_v_2[] = "\n        Transform the object `x` into a vector with minimal size `|n|`.\n        The order of the resulting vector is reversed compared to :meth:`Vec`.\n        \n        INPUT:\n        \n        - ``x`` -- gen\n        \n        - ``n`` -- Make the vector of minimal length `|n|`. If `n > 0`,\n          prepend zeros; if `n < 0`, append zeros.\n        \n        OUTPUT:\n        \n        A PARI vector (type ``t_VEC``)\n        \n        EXAMPLES::\n        \n            >>> pari(1).Vecrev()\n            [1]\n            >>> pari('x^3').Vecrev()\n            [0, 0, 0, 1]\n            >>> pari('x^3 + 3*x - 2').Vecrev()\n            [-2, 3, 0, 1]\n            >>> pari([1, 2, 3]).Vecrev()\n            [3, 2, 1]\n            >>> pari('Col([1, 2, 3])').Vecrev()\n            [3, 2, 1]\n            >>> pari('[1, 2; 3, 4]').Vecrev()\n            [[2, 4]~, [1, 3]~]\n            >>> pari('\"Sage\"').Vecrev()\n            [\"e\", \"g\", \"a\", \"S\"]\n\n        We demonstate the `n` argument::\n\n            >>> pari([1,2,3,4]).Vecrev(2)\n            [4, 3, 2, 1]\n            >>> pari([1,2,3,4]).Vecrev(-2)\n            [4, 3, 2, 1]\n            >>> pari([1,2,3,4]).Vecrev(6)\n            [0, 0, 4, 3, 2, 1]\n            >>> pari([1,2,3,4]).Vecrev(-6)\n            [4, 3, 2, 1, 0, 0]\n        ";
  static PyObject *__pyx_kp_s_;
  static PyObject *__pyx_kp_s_0x;
  static PyObject *__pyx_n_s_A;
  static PyObject *__pyx_kp_u_A_mathnf_flag_0_upper_triangula;
  static PyObject *__pyx_n_s_AttributeError;
  static PyObject *__pyx_n_s_B;
  static PyObject *__pyx_kp_s_BIG_WARNING_The_number_s_wasn_t;
  static PyObject *__pyx_kp_u_Bessel_I_function_Bessel_functi;
  static PyObject *__pyx_kp_u_Bessel_J_function_Bessel_functi;
  static PyObject *__pyx_kp_u_Check_whether_a_and_b_are_equal;
  static PyObject *__pyx_kp_u_Check_whether_a_is_equal_to_the;
  static PyObject *__pyx_kp_u_Check_whether_a_is_equal_to_zer;
  static PyObject *__pyx_kp_u_Computes_the_Hurwitz_Kronecker;
  static PyObject *__pyx_kp_u_Convert_from_pari_real_precisio;
  static PyObject *__pyx_kp_u_Convert_from_precision_expresse;
  static PyObject *__pyx_kp_u_Convert_from_precision_expresse_2;
  static PyObject *__pyx_kp_u_Convert_from_precision_expresse_3;
  static PyObject *__pyx_kp_u_Convert_from_precision_expresse_4;
  static PyObject *__pyx_kp_u_Convert_from_precision_expresse_5;
  static PyObject *__pyx_kp_u_Convert_self_to_a_list_of_PARI;
  static PyObject *__pyx_kp_u_Create_the_PARI_object_obtained;
  static PyObject *__pyx_kp_u_Creates_a_PARI_t_REAL_with_valu;
  static PyObject *__pyx_kp_u_Creates_a_vector_containing_as;
  static PyObject *__pyx_kp_s_Current_error_number_d;
  static PyObject *__pyx_n_s_D;
  static PyObject *__pyx_kp_u_Determine_whether_or_not_self_i;
  static PyObject *__pyx_kp_s_Doubling_the_PARI_stack;
  static PyObject *__pyx_kp_u_EXAMPLES_We_construct_a_relativ;
  static PyObject *__pyx_kp_u_EXAMPLES_f_pari_x_2_y_3_x_y_f_x;
  static PyObject *__pyx_kp_u_EXAMPLES_n_pari_set_real_precis;
  static PyObject *__pyx_kp_u_EXAMPLES_pari_10_issquarefree_T;
  static PyObject *__pyx_kp_u_Edited_from_the_pari_documentat;
  static PyObject *__pyx_n_s_Exception;
  static PyObject *__pyx_kp_u_Factorization_of_the_polynomial;
  static PyObject *__pyx_kp_u_For_real_x_return_the_largest_i;
  static PyObject *__pyx_kp_u_For_real_x_return_the_smallest;
  static PyObject *__pyx_n_s_GeneratorType;
  static PyObject *__pyx_kp_u_Given_a_PARI_number_field_self;
  static PyObject *__pyx_kp_u_Given_an_INTMOD_or_POLMOD_Mod_a;
  static PyObject *__pyx_kp_u_Given_an_ideal_I_in_Hermite_nor;
  static PyObject *__pyx_kp_u_Given_two_integral_ideals_x_and;
  static PyObject *__pyx_kp_u_Greatest_common_divisor_of_all;
  static PyObject *__pyx_n_s_I;
  static PyObject *__pyx_n_s_ImportError;
  static PyObject *__pyx_kp_u_In_self_replace_the_variable_va;
  static PyObject *__pyx_kp_u_In_self_which_must_be_a_t_POL_o;
  static PyObject *__pyx_n_s_IndexError;
  static PyObject *__pyx_kp_s_Interface_to_the_PARI_C_library;
  static PyObject *__pyx_kp_u_J_Bessel_function_of_half_integ;
  static PyObject *__pyx_kp_u_List_x_transforms_the_PARI_vect;
  static PyObject *__pyx_kp_u_Logarithm_of_the_gamma_function;
  static PyObject *__pyx_kp_u_M_matfrobenius_flag_0_Return_th;
  static PyObject *__pyx_kp_s_Mat;
  static PyObject *__pyx_n_s_Mat_2;
  static PyObject *__pyx_kp_u_Mat_x_Returns_the_matrix_define;
  static PyObject *__pyx_n_s_MemoryError;
  static PyObject *__pyx_n_s_Mod;
  static PyObject *__pyx_kp_u_Mod_x_y_Returns_the_object_x_mo;
  static PyObject *__pyx_kp_s_Not_a_PARI_number_field;
  static PyObject *__pyx_kp_s_Not_an_INTMOD_or_POLMOD_in_mod;
  static PyObject *__pyx_kp_s_Object_s_must_be_of_type_t_VEC;
  static PyObject *__pyx_kp_s_Object_s_must_be_of_type_t_VECSM;
  static PyObject *__pyx_n_s_OverflowError;
  static PyObject *__pyx_n_s_P;
  static PyObject *__pyx_kp_s_PARI_stack_size_d;
  static PyObject *__pyx_kp_s_PARI_user_exception;
  static PyObject *__pyx_kp_s_PARI_was_interrupted;
  static PyObject *__pyx_n_s_PariError;
  static PyObject *__pyx_n_s_PariError___repr;
  static PyObject *__pyx_kp_u_PariError___repr___line_10114;
  static PyObject *__pyx_n_s_PariError___str;
  static PyObject *__pyx_kp_s_PariError_d;
  static PyObject *__pyx_n_s_PariError_errmessage;
  static PyObject *__pyx_n_s_PariError_errnum;
  static PyObject *__pyx_n_s_PariError_set_errnum;
  static PyObject *__pyx_kp_u_PariInstance___call___line_9300;
  static PyObject *__pyx_kp_u_PariInstance__primelimit_line_94;
  static PyObject *__pyx_kp_u_PariInstance__real_coerced_to_bi;
  static PyObject *__pyx_kp_u_PariInstance_euler_line_9590;
  static PyObject *__pyx_kp_u_PariInstance_factorial_line_9659;
  static PyObject *__pyx_kp_u_PariInstance_getrand_line_9765;
  static PyObject *__pyx_kp_u_PariInstance_init_primes_line_94;
  static PyObject *__pyx_kp_u_PariInstance_pi_line_9607;
  static PyObject *__pyx_kp_u_PariInstance_polcyclo_line_9677;
  static PyObject *__pyx_kp_u_PariInstance_pollegendre_line_96;
  static PyObject *__pyx_kp_u_PariInstance_polsubcyclo_line_96;
  static PyObject *__pyx_kp_u_PariInstance_poltchebi_line_9642;
  static PyObject *__pyx_kp_u_PariInstance_prime_list_line_950;
  static PyObject *__pyx_kp_u_PariInstance_primes_up_to_n_line;
  static PyObject *__pyx_kp_u_PariInstance_read_line_9455;
  static PyObject *__pyx_kp_u_PariInstance_setrand_line_9725;
  static PyObject *__pyx_kp_u_PariInstance_vector_line_9785;
  static PyObject *__pyx_kp_u_Pol_x_v_convert_x_into_a_polyno;
  static PyObject *__pyx_n_s_Polrev;
  static PyObject *__pyx_kp_u_Polrev_x_v_Convert_x_into_a_pol;
  static PyObject *__pyx_kp_u_Prime_ideal_decomposition_of_th;
  static PyObject *__pyx_kp_u_Qfb_a_b_c_D_0_Returns_the_binar;
  static PyObject *__pyx_kp_u_Read_a_script_from_the_named_fi;
  static PyObject *__pyx_kp_u_Recompute_the_primes_table_incl;
  static PyObject *__pyx_kp_u_Return_Euler_s_constant_to_the;
  static PyObject *__pyx_kp_u_Return_Python_int_Very_fast_and;
  static PyObject *__pyx_kp_u_Return_a_Python_list_of_the_PAR;
  static PyObject *__pyx_kp_u_Return_a_Python_list_of_the_PAR_2;
  static PyObject *__pyx_kp_u_Return_a_basis_of_the_kernel_of;
  static PyObject *__pyx_kp_u_Return_a_primitive_root_modulo;
  static PyObject *__pyx_kp_u_Return_a_python_integer_represe;
  static PyObject *__pyx_kp_u_Return_a_string_containing_the;
  static PyObject *__pyx_kp_u_Return_self_1_OUTPUT_pari_gen_E;
  static PyObject *__pyx_kp_u_Return_self_as_a_Python_complex;
  static PyObject *__pyx_kp_u_Return_the_Euler_phi_function_o;
  static PyObject *__pyx_kp_u_Return_the_Fibonacci_number_of;
  static PyObject *__pyx_kp_u_Return_the_PARI_elliptic_curve;
  static PyObject *__pyx_kp_u_Return_the_PARI_type_of_self_as;
  static PyObject *__pyx_kp_u_Return_the_big_ideal_bid_struct;
  static PyObject *__pyx_kp_u_Return_the_complementary_error;
  static PyObject *__pyx_kp_u_Return_the_determinant_of_this;
  static PyObject *__pyx_kp_u_Return_the_discrete_logarithm_o;
  static PyObject *__pyx_kp_u_Return_the_factorial_of_the_int;
  static PyObject *__pyx_kp_u_Return_the_factorization_of_x_I;
  static PyObject *__pyx_kp_u_Return_the_first_n_Fourier_coef;
  static PyObject *__pyx_kp_u_Return_the_hash_of_self_compute;
  static PyObject *__pyx_kp_u_Return_the_integer_kernel_of_a;
  static PyObject *__pyx_kp_u_Return_the_least_common_multipl;
  static PyObject *__pyx_kp_u_Return_the_length_of_self_as_a;
  static PyObject *__pyx_kp_u_Return_the_nth_entry_of_self_Th;
  static PyObject *__pyx_kp_u_Return_the_number_of_columns_of;
  static PyObject *__pyx_kp_u_Return_the_number_of_divisors_o;
  static PyObject *__pyx_kp_u_Return_the_number_of_primes_alr;
  static PyObject *__pyx_kp_u_Return_the_number_of_primes_les;
  static PyObject *__pyx_kp_u_Return_the_number_of_rows_of_se;
  static PyObject *__pyx_kp_u_Return_the_primes_n_as_a_pari_l;
  static PyObject *__pyx_kp_u_Return_the_roots_of_poly_in_the;
  static PyObject *__pyx_kp_u_Return_the_sum_of_the_divisors;
  static PyObject *__pyx_kp_u_Return_the_sum_of_the_k_th_powe;
  static PyObject *__pyx_kp_u_Return_the_total_number_of_byte;
  static PyObject *__pyx_kp_u_Return_the_total_number_of_mach;
  static PyObject *__pyx_kp_u_Return_the_trace_of_this_PARI_o;
  static PyObject *__pyx_kp_u_Return_the_valuation_of_x_where;
  static PyObject *__pyx_kp_u_Return_the_value_of_the_constan;
  static PyObject *__pyx_kp_u_Return_the_value_or_the_series;
  static PyObject *__pyx_kp_u_Returns_PARI_s_current_random_n;
  static PyObject *__pyx_kp_u_Returns_Python_int_list_form_of;
  static PyObject *__pyx_kp_u_Returns_a_2_component_vector_wi;
  static PyObject *__pyx_kp_u_Returns_a_Python_list_r1_r2_whe;
  static PyObject *__pyx_kp_u_Returns_a_polynomial_over_QQ_wh;
  static PyObject *__pyx_kp_u_Returns_a_vector_of_generators;
  static PyObject *__pyx_kp_u_Returns_a_vector_of_generators_2;
  static PyObject *__pyx_kp_u_Returns_a_vector_with_a_ZZ_basi;
  static PyObject *__pyx_kp_u_Returns_the_Hermite_Normal_Form;
  static PyObject *__pyx_kp_u_Returns_the_Hermite_normal_form;
  static PyObject *__pyx_kp_u_Returns_the_absolute_value_of_x;
  static PyObject *__pyx_kp_u_Returns_the_class_number_of_sel;
  static PyObject *__pyx_kp_u_Returns_the_defining_polynomial;
  static PyObject *__pyx_kp_u_Returns_the_different_of_this_n;
  static PyObject *__pyx_kp_u_Returns_the_prime_of_ZZ_lying_b;
  static PyObject *__pyx_kp_u_Returns_the_ramification_index;
  static PyObject *__pyx_kp_u_Returns_the_regulator_of_this_n;
  static PyObject *__pyx_kp_u_Returns_the_residue_class_degre;
  static PyObject *__pyx_kp_u_Returns_the_second_generator_of;
  static PyObject *__pyx_kp_u_Returns_the_structure_of_the_cl;
  static PyObject *__pyx_kp_u_Returns_the_structure_of_the_gr;
  static PyObject *__pyx_kp_u_Returns_u_v_d_such_that_d_gcd_x;
  static PyObject *__pyx_n_s_RuntimeError;
  static PyObject *__pyx_n_s_S;
  static PyObject *__pyx_n_s_SIGINT;
  static PyObject *__pyx_kp_u_Ser_x_v_x_Create_a_power_series;
  static PyObject *__pyx_kp_u_Set_the_nth_entry_to_a_referenc;
  static PyObject *__pyx_kp_u_Set_x_convert_x_into_a_set_i_e;
  static PyObject *__pyx_kp_s_Setjmp_enabled_d;
  static PyObject *__pyx_kp_u_Sets_PARI_s_current_random_numb;
  static PyObject *__pyx_kp_u_Show_the_internal_structure_of;
  static PyObject *__pyx_kp_u_Str_self_Return_the_print_repre;
  static PyObject *__pyx_kp_u_Strchr_x_converts_x_to_a_string;
  static PyObject *__pyx_n_s_Strtex;
  static PyObject *__pyx_kp_u_Strtex_x_Translates_the_vector;
  static PyObject *__pyx_n_s_T;
  static PyObject *__pyx_kp_u_TESTS_PariError_11_PariError_11;
  static PyObject *__pyx_kp_u_The_Bernoulli_number_B_x_as_for;
  static PyObject *__pyx_kp_u_The_Bernoulli_number_B_x_where;
  static PyObject *__pyx_kp_u_The_H_1_Bessel_function_of_inde;
  static PyObject *__pyx_kp_u_The_H_2_Bessel_function_of_inde;
  static PyObject *__pyx_kp_u_The_arithmetic_geometric_mean_o;
  static PyObject *__pyx_kp_u_The_cosine_function_If_x_is_an;
  static PyObject *__pyx_kp_u_The_cotangent_of_x_If_x_is_an_e;
  static PyObject *__pyx_kp_u_The_hyperbolic_cosine_function;
  static PyObject *__pyx_kp_u_The_hyperbolic_sine_function_If;
  static PyObject *__pyx_kp_u_The_principal_branch_of_cos_1_x;
  static PyObject *__pyx_kp_u_The_principal_branch_of_cosh_1;
  static PyObject *__pyx_kp_u_The_principal_branch_of_sin_1_x;
  static PyObject *__pyx_kp_u_The_principal_branch_of_sinh_1;
  static PyObject *__pyx_kp_u_The_principal_branch_of_tan_1_x;
  static PyObject *__pyx_kp_u_The_principal_branch_of_tanh_1;
  static PyObject *__pyx_kp_u_The_principal_branch_of_the_dil;
  static PyObject *__pyx_kp_u_The_uniformizer_of_the_p_adic_r;
  static PyObject *__pyx_kp_s_This_is_probably_an_infinite_loo;
  static PyObject *__pyx_kp_u_Transform_the_object_x_into_a_c;
  static PyObject *__pyx_kp_u_Transform_the_object_x_into_a_c_2;
  static PyObject *__pyx_kp_u_Transform_the_object_x_into_a_t;
  static PyObject *__pyx_kp_u_Transform_the_object_x_into_a_v;
  static PyObject *__pyx_kp_u_Transform_the_object_x_into_a_v_2;
  static PyObject *__pyx_kp_u_Transforms_the_column_vector_x;
  static PyObject *__pyx_kp_u_Transforms_the_column_vector_x_2;
  static PyObject *__pyx_kp_u_Transpose_of_the_matrix_self_EX;
  static PyObject *__pyx_n_s_TypeError;
  static PyObject *__pyx_kp_s_Unable_to_allocate_s_bytes_memor;
  static PyObject *__pyx_kp_s_Unknown_PARI_type_s;
  static PyObject *__pyx_kp_s_Use_for_exponentiation_not_which;
  static PyObject *__pyx_kp_s_Users_dunfield_work_CyPari_cypa;
  static PyObject *__pyx_n_s_ValueError;
  static PyObject *__pyx_n_s_Vec;
  static PyObject *__pyx_n_s_Vecrev;
  static PyObject *__pyx_kp_u_Vector_of_vectors_L_of_all_idea;
  static PyObject *__pyx_kp_s__10;
  static PyObject *__pyx_kp_s__11;
  static PyObject *__pyx_kp_s__12;
  static PyObject *__pyx_kp_s__14;
  static PyObject *__pyx_kp_s__16;
  static PyObject *__pyx_kp_s__5;
  static PyObject *__pyx_kp_s__6;
  static PyObject *__pyx_kp_s__8;
  static PyObject *__pyx_n_s_a;
  static PyObject *__pyx_kp_u_a_hyperu_b_x_U_confluent_hyperg;
  static PyObject *__pyx_n_s_abs;
  static PyObject *__pyx_n_s_add_one;
  static PyObject *__pyx_n_s_alarm_handler;
  static PyObject *__pyx_n_s_allocatemem;
  static PyObject *__pyx_n_s_append;
  static PyObject *__pyx_kp_u_arg_x_argument_of_x_such_that_p;
  static PyObject *__pyx_n_s_args;
  static PyObject *__pyx_kp_s_attempt_to_assign_sequence_of_si;
  static PyObject *__pyx_n_s_aut;
  static PyObject *__pyx_kp_s_available_d;
  static PyObject *__pyx_n_s_b;
  static PyObject *__pyx_n_s_bezout;
  static PyObject *__pyx_n_s_bid;
  static PyObject *__pyx_kp_u_binary_x_gives_the_vector_forme;
  static PyObject *__pyx_kp_u_binomial_x_k_return_the_binomia;
  static PyObject *__pyx_kp_u_bitand_x_y_Bitwise_and_of_two_i;
  static PyObject *__pyx_kp_u_bitneg_x_n_1_Bitwise_negation_o;
  static PyObject *__pyx_kp_u_bitnegimply_x_y_Bitwise_negated;
  static PyObject *__pyx_kp_u_bitor_x_y_Bitwise_or_of_two_int;
  static PyObject *__pyx_n_s_bits;
  static PyObject *__pyx_kp_u_bittest_x_long_n_Returns_bit_nu;
  static PyObject *__pyx_kp_u_bitxor_x_y_Bitwise_exclusive_or;
  static PyObject *__pyx_n_s_bound;
  static PyObject *__pyx_n_s_c;
  static PyObject *__pyx_kp_s_cannot_index_PARI_type_s_by_tupl;
  static PyObject *__pyx_kp_u_centerlift_x_v_Centered_lift_of;
  static PyObject *__pyx_kp_s_change_variable_name_only_works;
  static PyObject *__pyx_n_s_chars_to_str;
  static PyObject *__pyx_n_s_chr;
  static PyObject *__pyx_kp_s_column_index_out_of_bounds;
  static PyObject *__pyx_kp_s_column_j_s_must_be_between_0_and;
  static PyObject *__pyx_n_s_component;
  static PyObject *__pyx_kp_u_component_x_long_n_Return_n_th;
  static PyObject *__pyx_kp_u_conj_x_Return_the_algebraic_con;
  static PyObject *__pyx_kp_u_conjvec_x_Returns_the_vector_of;
  static PyObject *__pyx_n_s_cypari_src_gen;
  static PyObject *__pyx_n_s_d;
  static PyObject *__pyx_kp_s_d_full;
  static PyObject *__pyx_n_s_debug;
  static PyObject *__pyx_n_s_decode;
  static PyObject *__pyx_n_s_default;
  static PyObject *__pyx_n_s_default_int_handler;
  static PyObject *__pyx_kp_s_default_s;
  static PyObject *__pyx_kp_s_default_s_s;
  static PyObject *__pyx_n_s_den;
  static PyObject *__pyx_n_s_denom;
  static PyObject *__pyx_kp_u_denominator_x_Return_the_denomi;
  static PyObject *__pyx_n_s_depth;
  static PyObject *__pyx_n_s_doc;
  static PyObject *__pyx_n_s_e;
  static PyObject *__pyx_kp_u_e_disc_return_the_discriminant;
  static PyObject *__pyx_kp_u_e_elladd_z0_z1_return_the_sum_o;
  static PyObject *__pyx_kp_u_e_ellak_n_Returns_the_coefficie;
  static PyObject *__pyx_kp_u_e_ellap_p_Returns_the_prime_ind;
  static PyObject *__pyx_kp_u_e_ellaplist_n_Returns_a_PARI_li;
  static PyObject *__pyx_kp_u_e_ellbil_z0_z1_return_the_value;
  static PyObject *__pyx_kp_u_e_ellchangecurve_ch_return_the;
  static PyObject *__pyx_kp_u_e_elleta_return_the_vector_eta1;
  static PyObject *__pyx_kp_u_e_ellglobalred_return_informati;
  static PyObject *__pyx_kp_u_e_ellheight_a_flag_2_return_the;
  static PyObject *__pyx_kp_u_e_ellheightmatrix_x_return_the;
  static PyObject *__pyx_kp_u_e_ellisoncurve_x_return_True_if;
  static PyObject *__pyx_kp_u_e_elllocalred_p_computes_the_da;
  static PyObject *__pyx_kp_u_e_elllseries_s_A_1_return_the_v;
  static PyObject *__pyx_kp_u_e_ellorder_x_return_the_order_o;
  static PyObject *__pyx_kp_u_e_ellordinate_x_return_the_y_co;
  static PyObject *__pyx_kp_u_e_ellpointtoz_P_return_the_comp;
  static PyObject *__pyx_kp_u_e_ellpow_z_n_return_n_times_the;
  static PyObject *__pyx_kp_u_e_ellrootno_p_return_the_local;
  static PyObject *__pyx_kp_u_e_ellsigma_z_flag_0_return_the;
  static PyObject *__pyx_kp_u_e_ellsub_z0_z1_return_z0_z1_on;
  static PyObject *__pyx_kp_u_e_elltors_flag_0_return_informa;
  static PyObject *__pyx_kp_u_e_ellzeta_z_return_the_value_at;
  static PyObject *__pyx_kp_u_e_ellztopoint_z_return_the_poin;
  static PyObject *__pyx_kp_u_e_j_return_the_j_invariant_of_t;
  static PyObject *__pyx_kp_u_e_omega_return_basis_for_the_pe;
  static PyObject *__pyx_kp_u_ellminimalmodel_e_return_the_st;
  static PyObject *__pyx_n_s_entries;
  static PyObject *__pyx_n_s_enumerate;
  static PyObject *__pyx_n_s_errmessage;
  static PyObject *__pyx_n_s_errnum;
  static PyObject *__pyx_n_s_estimate;
  static PyObject *__pyx_n_s_eval;
  static PyObject *__pyx_n_s_exc_info;
  static PyObject *__pyx_n_s_fa;
  static PyObject *__pyx_n_s_factor;
  static PyObject *__pyx_n_s_find;
  static PyObject *__pyx_n_s_find_root;
  static PyObject *__pyx_n_s_flag;
  static PyObject *__pyx_n_s_flush;
  static PyObject *__pyx_kp_u_frac_x_Return_the_fractional_pa;
  static PyObject *__pyx_n_s_future_builtins;
  static PyObject *__pyx_kp_u_gen_Col_line_2080;
  static PyObject *__pyx_kp_u_gen_Colrev_line_2127;
  static PyObject *__pyx_kp_u_gen_List_line_2180;
  static PyObject *__pyx_kp_u_gen_Mat_line_2200;
  static PyObject *__pyx_kp_u_gen_Mod_line_2263;
  static PyObject *__pyx_kp_u_gen_Pol_line_2324;
  static PyObject *__pyx_kp_u_gen_Polrev_line_2383;
  static PyObject *__pyx_kp_u_gen_Qfb_line_2423;
  static PyObject *__pyx_kp_u_gen_Ser_line_2475;
  static PyObject *__pyx_kp_u_gen_Set_line_2532;
  static PyObject *__pyx_kp_u_gen_Str_line_2567;
  static PyObject *__pyx_kp_u_gen_Strchr_line_2607;
  static PyObject *__pyx_kp_u_gen_Strtex_line_2657;
  static PyObject *__pyx_kp_u_gen_Vec_line_2694;
  static PyObject *__pyx_kp_u_gen_Vecrev_line_2752;
  static PyObject *__pyx_kp_u_gen_Vecsmall_line_2799;
  static PyObject *__pyx_kp_u_gen___complex___line_1673;
  static PyObject *__pyx_kp_u_gen___getitem___line_982;
  static PyObject *__pyx_kp_u_gen___hash___line_432;
  static PyObject *__pyx_kp_u_gen___index___line_1458;
  static PyObject *__pyx_kp_u_gen___int___line_1498;
  static PyObject *__pyx_kp_u_gen___setitem___line_1211;
  static PyObject *__pyx_kp_u_gen__add_one_line_556;
  static PyObject *__pyx_kp_u_gen__gen_length_line_1196;
  static PyObject *__pyx_kp_u_gen__valp_line_3997;
  static PyObject *__pyx_kp_u_gen_abs_line_4056;
  static PyObject *__pyx_kp_u_gen_acos_line_4082;
  static PyObject *__pyx_kp_u_gen_acosh_line_4107;
  static PyObject *__pyx_kp_u_gen_agm_line_4131;
  static PyObject *__pyx_kp_u_gen_algdep_line_8596;
  static PyObject *__pyx_kp_u_gen_arg_line_4160;
  static PyObject *__pyx_kp_u_gen_asin_line_4177;
  static PyObject *__pyx_kp_u_gen_asinh_line_4199;
  static PyObject *__pyx_kp_u_gen_atan_line_4219;
  static PyObject *__pyx_kp_u_gen_atanh_line_4239;
  static PyObject *__pyx_kp_u_gen_bernfrac_line_4261;
  static PyObject *__pyx_kp_u_gen_bernreal_line_4278;
  static PyObject *__pyx_kp_u_gen_bernvec_line_4293;
  static PyObject *__pyx_kp_u_gen_besselh1_line_4314;
  static PyObject *__pyx_kp_u_gen_besselh2_line_4334;
  static PyObject *__pyx_kp_u_gen_besseli_line_4401;
  static PyObject *__pyx_kp_u_gen_besselj_line_4354;
  static PyObject *__pyx_kp_u_gen_besseljh_line_4377;
  static PyObject *__pyx_kp_u_gen_besselk_line_4426;
  static PyObject *__pyx_kp_u_gen_besseln_line_4468;
  static PyObject *__pyx_kp_u_gen_bid_get_cyc_line_937;
  static PyObject *__pyx_kp_u_gen_bid_get_gen_line_955;
  static PyObject *__pyx_kp_u_gen_binary_line_2841;
  static PyObject *__pyx_kp_u_gen_binomial_line_5243;
  static PyObject *__pyx_kp_u_gen_bitand_line_2881;
  static PyObject *__pyx_kp_u_gen_bitneg_line_2922;
  static PyObject *__pyx_kp_u_gen_bitnegimply_line_2968;
  static PyObject *__pyx_kp_u_gen_bitor_line_3002;
  static PyObject *__pyx_kp_u_gen_bittest_line_3037;
  static PyObject *__pyx_kp_u_gen_bitxor_line_3078;
  static PyObject *__pyx_kp_u_gen_bnf_get_cyc_line_805;
  static PyObject *__pyx_kp_u_gen_bnf_get_gen_line_821;
  static PyObject *__pyx_kp_u_gen_bnf_get_no_line_792;
  static PyObject *__pyx_kp_u_gen_bnf_get_reg_line_837;
  static PyObject *__pyx_kp_u_gen_ceil_line_3111;
  static PyObject *__pyx_kp_u_gen_centerlift_line_3153;
  static PyObject *__pyx_kp_u_gen_change_variable_name_line_83;
  static PyObject *__pyx_kp_u_gen_component_line_3192;
  static PyObject *__pyx_kp_u_gen_conj_line_3238;
  static PyObject *__pyx_kp_u_gen_conjvec_line_3270;
  static PyObject *__pyx_kp_u_gen_content_line_7461;
  static PyObject *__pyx_kp_u_gen_cos_line_4488;
  static PyObject *__pyx_kp_u_gen_cosh_line_4509;
  static PyObject *__pyx_kp_u_gen_cotan_line_4530;
  static PyObject *__pyx_kp_u_gen_debug_line_8776;
  static PyObject *__pyx_kp_u_gen_denominator_line_3294;
  static PyObject *__pyx_kp_u_gen_dilog_line_4557;
  static PyObject *__pyx_kp_u_gen_disc_line_6585;
  static PyObject *__pyx_kp_u_gen_elladd_line_5559;
  static PyObject *__pyx_kp_u_gen_ellak_line_5595;
  static PyObject *__pyx_kp_u_gen_ellan_line_5634;
  static PyObject *__pyx_kp_u_gen_ellanalyticrank_line_5674;
  static PyObject *__pyx_kp_u_gen_ellap_line_5689;
  static PyObject *__pyx_kp_u_gen_ellaplist_line_5729;
  static PyObject *__pyx_kp_u_gen_ellbil_line_5801;
  static PyObject *__pyx_kp_u_gen_ellchangecurve_line_5826;
  static PyObject *__pyx_kp_u_gen_ellchangepoint_line_8751;
  static PyObject *__pyx_kp_u_gen_elleisnum_line_8635;
  static PyObject *__pyx_kp_u_gen_elleta_line_5857;
  static PyObject *__pyx_kp_u_gen_ellglobalred_line_5524;
  static PyObject *__pyx_kp_u_gen_ellheight_line_5879;
  static PyObject *__pyx_kp_u_gen_ellheightmatrix_line_5926;
  static PyObject *__pyx_kp_u_gen_ellinit_line_5451;
  static PyObject *__pyx_kp_u_gen_ellisoncurve_line_5955;
  static PyObject *__pyx_kp_u_gen_elllocalred_line_5983;
  static PyObject *__pyx_kp_u_gen_elllseries_line_6138;
  static PyObject *__pyx_kp_u_gen_ellminimalmodel_line_6181;
  static PyObject *__pyx_kp_u_gen_ellorder_line_6219;
  static PyObject *__pyx_kp_u_gen_ellordinate_line_6250;
  static PyObject *__pyx_kp_u_gen_ellpointtoz_line_6281;
  static PyObject *__pyx_kp_u_gen_ellpow_line_6307;
  static PyObject *__pyx_kp_u_gen_ellrootno_line_6370;
  static PyObject *__pyx_kp_u_gen_ellsigma_line_6408;
  static PyObject *__pyx_kp_u_gen_ellsub_line_6425;
  static PyObject *__pyx_kp_u_gen_elltors_line_6455;
  static PyObject *__pyx_kp_u_gen_ellwp_line_8677;
  static PyObject *__pyx_kp_u_gen_ellzeta_line_6500;
  static PyObject *__pyx_kp_u_gen_ellztopoint_line_6533;
  static PyObject *__pyx_kp_u_gen_erfc_line_4608;
  static PyObject *__pyx_kp_u_gen_eta_line_4631;
  static PyObject *__pyx_kp_u_gen_exp_line_4660;
  static PyObject *__pyx_kp_u_gen_factor_line_8228;
  static PyObject *__pyx_kp_u_gen_factornf_line_7487;
  static PyObject *__pyx_kp_u_gen_fibonacci_line_5287;
  static PyObject *__pyx_kp_u_gen_floor_line_3324;
  static PyObject *__pyx_kp_u_gen_frac_line_3367;
  static PyObject *__pyx_kp_u_gen_gamma_line_4681;
  static PyObject *__pyx_kp_u_gen_gammah_line_4709;
  static PyObject *__pyx_kp_u_gen_gequal0_line_1758;
  static PyObject *__pyx_kp_u_gen_gequal_line_1724;
  static PyObject *__pyx_kp_u_gen_gequal_long_line_1778;
  static PyObject *__pyx_kp_u_gen_hex_line_1477;
  static PyObject *__pyx_kp_u_gen_hyperu_line_4730;
  static PyObject *__pyx_kp_u_gen_idealcoprime_line_6743;
  static PyObject *__pyx_kp_u_gen_ideallist_line_6791;
  static PyObject *__pyx_kp_u_gen_ideallog_line_6817;
  static PyObject *__pyx_kp_u_gen_idealprimedec_line_6861;
  static PyObject *__pyx_kp_u_gen_idealstar_line_6881;
  static PyObject *__pyx_kp_u_gen_imag_line_3393;
  static PyObject *__pyx_kp_u_gen_incgam_line_4750;
  static PyObject *__pyx_kp_u_gen_incgamc_line_4773;
  static PyObject *__pyx_kp_u_gen_intvec_unsafe_line_1563;
  static PyObject *__pyx_kp_u_gen_ispower_line_1928;
  static PyObject *__pyx_kp_u_gen_isprime_line_1809;
  static PyObject *__pyx_kp_u_gen_ispseudoprime_line_1889;
  static PyObject *__pyx_kp_u_gen_issquarefree_line_5334;
  static PyObject *__pyx_kp_u_gen_j_line_6599;
  static PyObject *__pyx_kp_u_gen_lcm_line_5348;
  static PyObject *__pyx_kp_u_gen_lift_line_3430;
  static PyObject *__pyx_kp_u_gen_list_line_458;
  static PyObject *__pyx_kp_u_gen_log_gamma_line_4841;
  static PyObject *__pyx_kp_u_gen_log_line_4799;
  static PyObject *__pyx_kp_u_gen_matadjoint_line_7876;
  static PyObject *__pyx_kp_u_gen_matdet_line_8032;
  static PyObject *__pyx_kp_u_gen_matfrobenius_line_8182;
  static PyObject *__pyx_kp_u_gen_mathnf_line_8066;
  static PyObject *__pyx_kp_u_gen_mathnfmod_line_8092;
  static PyObject *__pyx_kp_u_gen_mathnfmodid_line_8126;
  static PyObject *__pyx_kp_u_gen_matker_line_7977;
  static PyObject *__pyx_kp_u_gen_matkerint_line_8006;
  static PyObject *__pyx_kp_u_gen_matsnf_line_8155;
  static PyObject *__pyx_kp_u_gen_matsolve_line_7950;
  static PyObject *__pyx_kp_u_gen_mattranspose_line_7864;
  static PyObject *__pyx_kp_u_gen_mod_line_623;
  static PyObject *__pyx_kp_s_gen_must_be_of_PARI_type_t_INT_o;
  static PyObject *__pyx_kp_s_gen_must_be_of_PARI_type_t_VEC;
  static PyObject *__pyx_kp_u_gen_ncols_line_7829;
  static PyObject *__pyx_kp_u_gen_newtonpoly_line_7541;
  static PyObject *__pyx_kp_u_gen_nextprime_line_8346;
  static PyObject *__pyx_kp_u_gen_nf_get_diff_line_724;
  static PyObject *__pyx_kp_u_gen_nf_get_pol_line_691;
  static PyObject *__pyx_kp_u_gen_nf_get_sign_line_744;
  static PyObject *__pyx_kp_u_gen_nf_get_zk_line_772;
  static PyObject *__pyx_kp_u_gen_nf_subst_line_8456;
  static PyObject *__pyx_kp_u_gen_nfbasis_d_line_7002;
  static PyObject *__pyx_kp_u_gen_nfbasis_line_6955;
  static PyObject *__pyx_kp_u_gen_nfbasistoalg_lift_line_7066;
  static PyObject *__pyx_kp_u_gen_nfbasistoalg_line_7034;
  static PyObject *__pyx_kp_u_gen_nfdisc_line_7097;
  static PyObject *__pyx_kp_u_gen_nfeltreduce_line_7132;
  static PyObject *__pyx_kp_u_gen_nfgaloisconj_line_7607;
  static PyObject *__pyx_kp_u_gen_nfhilbert_line_7160;
  static PyObject *__pyx_kp_u_gen_nfinit_line_7194;
  static PyObject *__pyx_kp_u_gen_nfisisom_line_7258;
  static PyObject *__pyx_kp_u_gen_nfroots_line_7636;
  static PyObject *__pyx_kp_u_gen_nfrootsof1_line_7298;
  static PyObject *__pyx_kp_u_gen_nrows_line_7844;
  static PyObject *__pyx_kp_u_gen_numbpart_line_3465;
  static PyObject *__pyx_kp_u_gen_numdiv_line_5359;
  static PyObject *__pyx_kp_u_gen_omega_line_6572;
  static PyObject *__pyx_kp_u_gen_padicprec_line_3522;
  static PyObject *__pyx_kp_u_gen_padicprime_line_3554;
  static PyObject *__pyx_kp_u_gen_phi_line_5371;
  static PyObject *__pyx_kp_u_gen_polcoeff_line_7556;
  static PyObject *__pyx_kp_u_gen_polylog_line_4867;
  static PyObject *__pyx_kp_u_gen_pr_get_e_line_870;
  static PyObject *__pyx_kp_u_gen_pr_get_f_line_893;
  static PyObject *__pyx_kp_u_gen_pr_get_gen_line_916;
  static PyObject *__pyx_kp_u_gen_pr_get_p_line_852;
  static PyObject *__pyx_kp_u_gen_primepi_line_5381;
  static PyObject *__pyx_kp_u_gen_psi_line_4895;
  static PyObject *__pyx_kp_u_gen_python_list_line_1627;
  static PyObject *__pyx_kp_u_gen_python_list_small_line_1604;
  static PyObject *__pyx_kp_u_gen_qfbhclassno_line_1848;
  static PyObject *__pyx_kp_u_gen_quadhilbert_line_7428;
  static PyObject *__pyx_kp_u_gen_rnfidealdown_line_7362;
  static PyObject *__pyx_kp_u_gen_rnfinit_line_7405;
  static PyObject *__pyx_kp_u_gen_round_line_3665;
  static PyObject *__pyx_kp_u_gen_serreverse_line_7766;
  static PyObject *__pyx_kp_u_gen_simplify_line_3721;
  static PyObject *__pyx_kp_u_gen_sin_line_4915;
  static PyObject *__pyx_kp_u_gen_sinh_line_4934;
  static PyObject *__pyx_kp_u_gen_sizebyte_line_3795;
  static PyObject *__pyx_kp_u_gen_sizedigit_line_3814;
  static PyObject *__pyx_kp_u_gen_sizeword_line_3762;
  static PyObject *__pyx_kp_u_gen_sqr_line_4953;
  static PyObject *__pyx_kp_u_gen_sqrt_line_4980;
  static PyObject *__pyx_kp_u_gen_sqrtn_line_4997;
  static PyObject *__pyx_kp_u_gen_subst_line_8423;
  static PyObject *__pyx_kp_u_gen_sumdiv_line_5411;
  static PyObject *__pyx_kp_u_gen_sumdivk_line_5423;
  static PyObject *__pyx_kp_u_gen_tan_line_5055;
  static PyObject *__pyx_kp_u_gen_tanh_line_5074;
  static PyObject *__pyx_kp_u_gen_teichmuller_line_5098;
  static PyObject *__pyx_kp_u_gen_theta_line_5113;
  static PyObject *__pyx_kp_u_gen_thetanullk_line_5132;
  static PyObject *__pyx_kp_u_gen_trace_line_8054;
  static PyObject *__pyx_kp_u_gen_truncate_line_3858;
  static PyObject *__pyx_kp_u_gen_type_line_8523;
  static PyObject *__pyx_kp_u_gen_valuation_line_3921;
  static PyObject *__pyx_kp_u_gen_variable_line_4019;
  static PyObject *__pyx_kp_u_gen_weber_line_5149;
  static PyObject *__pyx_kp_u_gen_xgcd_line_5435;
  static PyObject *__pyx_kp_u_gen_zeta_line_5178;
  static PyObject *__pyx_kp_u_gen_znprimroot_line_8309;
  static PyObject *__pyx_n_s_getitem;
  static PyObject *__pyx_n_s_hex;
  static PyObject *__pyx_n_s_im;
  static PyObject *__pyx_n_s_imag;
  static PyObject *__pyx_kp_u_imag_x_Return_the_imaginary_par;
  static PyObject *__pyx_n_s_import;
  static PyObject *__pyx_kp_s_in_Python_and_has_the_wrong_prec;
  static PyObject *__pyx_kp_s_index_must_be_an_integer_or_a_2;
  static PyObject *__pyx_kp_s_index_out_of_bounds;
  static PyObject *__pyx_kp_s_index_s_must_be_between_0_and_s;
  static PyObject *__pyx_n_s_indices;
  static PyObject *__pyx_n_s_init;
  static PyObject *__pyx_n_s_init_pari_stack;
  static PyObject *__pyx_n_s_init_primes;
  static PyObject *__pyx_kp_s_input_v_must_be_of_type_vecsmall;
  static PyObject *__pyx_n_s_isprime;
  static PyObject *__pyx_kp_u_isprime_x_flag_0_Returns_True_i;
  static PyObject *__pyx_kp_u_ispseudoprime_x_flag_0_Returns;
  static PyObject *__pyx_n_s_k;
  static PyObject *__pyx_n_s_lambda;
  static PyObject *__pyx_kp_s_len_of_entries_s_must_be_s_s_s;
  static PyObject *__pyx_kp_s_length_of_entries_s_must_equal_n;
  static PyObject *__pyx_kp_u_lift_x_v_Returns_the_lift_of_an;
  static PyObject *__pyx_n_s_limit;
  static PyObject *__pyx_n_s_lmax;
  static PyObject *__pyx_n_s_m;
  static PyObject *__pyx_n_s_main;
  static PyObject *__pyx_kp_u_matadjoint_x_adjoint_matrix_of;
  static PyObject *__pyx_n_s_math;
  static PyObject *__pyx_n_s_matrix;
  static PyObject *__pyx_kp_s_matrix_index_must_be_of_the_form;
  static PyObject *__pyx_kp_u_matsolve_B_Solve_the_linear_sys;
  static PyObject *__pyx_n_s_max;
  static PyObject *__pyx_n_s_maxprime;
  static PyObject *__pyx_n_s_metaclass;
  static PyObject *__pyx_n_s_module;
  static PyObject *__pyx_n_s_n;
  static PyObject *__pyx_n_s_ncols;
  static PyObject *__pyx_n_s_ne;
  static PyObject *__pyx_kp_u_nextprime_x_smallest_pseudoprim;
  static PyObject *__pyx_kp_u_nf_nfrootsof1_number_of_roots_o;
  static PyObject *__pyx_kp_u_nfbasis_d_x_Return_a_basis_of_t;
  static PyObject *__pyx_kp_u_nfbasis_x_flag_fa_integral_basi;
  static PyObject *__pyx_kp_u_nfdisc_x_Return_the_discriminan;
  static PyObject *__pyx_kp_u_nfhilbert_nf_a_b_p_if_p_is_omit;
  static PyObject *__pyx_kp_u_nfinit_pol_flag_0_pol_being_a_n;
  static PyObject *__pyx_n_s_nfinit_with_prec;
  static PyObject *__pyx_kp_u_nfisisom_x_y_Determine_if_the_n;
  static PyObject *__pyx_kp_s_not_the_same_prime_in_padicprec;
  static PyObject *__pyx_n_s_nrows;
  static PyObject *__pyx_n_s_nth_prime;
  static PyObject *__pyx_n_s_nth_prime_2;
  static PyObject *__pyx_kp_s_nth_prime_meaningless_for_non_po;
  static PyObject *__pyx_kp_u_nu_besselk_x_flag_0_K_Bessel_fu;
  static PyObject *__pyx_kp_u_nu_besseln_x_Bessel_N_function;
  static PyObject *__pyx_kp_u_numbpart_x_returns_the_number_o;
  static PyObject *__pyx_n_s_obj;
  static PyObject *__pyx_kp_u_om_elleisnum_k_flag_0_om_om1_om;
  static PyObject *__pyx_n_s_operator;
  static PyObject *__pyx_n_s_p;
  static PyObject *__pyx_kp_s_p_s_must_be_of_type_t_INT_but_is;
  static PyObject *__pyx_kp_u_padicprec_x_p_Return_the_absolu;
  static PyObject *__pyx_n_s_pari;
  static PyObject *__pyx_n_s_pari_2;
  static PyObject *__pyx_kp_s_pari_trap_recursion_too_deep;
  static PyObject *__pyx_n_s_pbw;
  static PyObject *__pyx_n_s_perm;
  static PyObject *__pyx_n_s_pol2;
  static PyObject *__pyx_n_s_polcoeff;
  static PyObject *__pyx_kp_u_polcyclo_n_v_x_cyclotomic_polyn;
  static PyObject *__pyx_n_s_poldegree;
  static PyObject *__pyx_kp_u_pollegendre_n_v_x_Legendre_poly;
  static PyObject *__pyx_n_s_polrel;
  static PyObject *__pyx_kp_u_polsubcyclo_n_d_v_x_return_the;
  static PyObject *__pyx_kp_u_poltchebi_n_v_x_Chebyshev_polyn;
  static PyObject *__pyx_n_s_poly;
  static PyObject *__pyx_kp_u_prec_bits_to_dec_line_248;
  static PyObject *__pyx_n_s_prec_bits_to_words;
  static PyObject *__pyx_kp_u_prec_bits_to_words_line_280;
  static PyObject *__pyx_kp_u_prec_dec_to_bits_line_264;
  static PyObject *__pyx_kp_u_prec_dec_to_words_line_331;
  static PyObject *__pyx_n_s_prec_in_bits;
  static PyObject *__pyx_kp_u_prec_words_to_bits_line_311;
  static PyObject *__pyx_kp_u_prec_words_to_dec_line_350;
  static PyObject *__pyx_n_s_precision;
  static PyObject *__pyx_n_s_prepare;
  static PyObject *__pyx_n_s_prime_list;
  static PyObject *__pyx_kp_u_prime_list_n_returns_list_of_th;
  static PyObject *__pyx_n_s_primepi;
  static PyObject *__pyx_n_s_print;
  static PyObject *__pyx_n_s_proof;
  static PyObject *__pyx_n_s_pysignal;
  static PyObject *__pyx_n_s_python_ints;
  static PyObject *__pyx_n_s_pyx_vtable;
  static PyObject *__pyx_kp_u_q_theta_z_Jacobi_sine_theta_fun;
  static PyObject *__pyx_kp_u_q_thetanullk_k_return_the_k_th;
  static PyObject *__pyx_n_s_qflllgram;
  static PyObject *__pyx_n_s_qualname;
  static PyObject *__pyx_n_s_r;
  static PyObject *__pyx_n_s_range;
  static PyObject *__pyx_n_s_re;
  static PyObject *__pyx_n_s_real;
  static PyObject *__pyx_n_s_real_coerced_to_bits_prec;
  static PyObject *__pyx_n_s_replace;
  static PyObject *__pyx_n_s_repr;
  static PyObject *__pyx_n_s_rhs;
  static PyObject *__pyx_kp_u_rnfidealdown_rnf_x_finds_the_in;
  static PyObject *__pyx_kp_u_round_x_estimate_False_If_x_is;
  static PyObject *__pyx_kp_s_row_i_s_must_be_between_0_and_s;
  static PyObject *__pyx_kp_s_row_index_out_of_bounds;
  static PyObject *__pyx_n_s_s;
  static PyObject *__pyx_kp_s_s_d;
  static PyObject *__pyx_kp_u_s_gamma_precision_Gamma_functio;
  static PyObject *__pyx_kp_u_s_gammah_Gamma_function_evaluat;
  static PyObject *__pyx_kp_u_s_incgam_x_y_precision_incomple;
  static PyObject *__pyx_kp_u_s_incgamc_x_complementary_incom;
  static PyObject *__pyx_kp_s_s_must_be_nonnegative_and_not_to;
  static PyObject *__pyx_n_s_self;
  static PyObject *__pyx_kp_u_self_ellchangepoint_y_change_da;
  static PyObject *__pyx_kp_s_self_must_be_of_PARI_type_t_MAT;
  static PyObject *__pyx_n_s_seriesprecision;
  static PyObject *__pyx_kp_u_serreverse_f_reversion_of_the_p;
  static PyObject *__pyx_n_s_set_errnum;
  static PyObject *__pyx_n_s_set_real_precision;
  static PyObject *__pyx_n_s_signal;
  static PyObject *__pyx_n_s_silent;
  static PyObject *__pyx_kp_u_simplify_x_Simplify_the_object;
  static PyObject *__pyx_n_s_size;
  static PyObject *__pyx_kp_u_sizedigit_x_Return_a_quick_esti;
  static PyObject *__pyx_n_s_speak_up;
  static PyObject *__pyx_n_s_stdout;
  static PyObject *__pyx_n_s_str;
  static PyObject *__pyx_n_s_str_to_chars;
  static PyObject *__pyx_n_s_sys;
  static PyObject *__pyx_n_s_t0heap;
  static PyObject *__pyx_n_s_t_CLOSURE;
  static PyObject *__pyx_n_s_t_COL;
  static PyObject *__pyx_n_s_t_COMPLEX;
  static PyObject *__pyx_n_s_t_FFELT;
  static PyObject *__pyx_n_s_t_FRAC;
  static PyObject *__pyx_n_s_t_INT;
  static PyObject *__pyx_n_s_t_INTMOD;
  static PyObject *__pyx_n_s_t_LIST;
  static PyObject *__pyx_n_s_t_MAT;
  static PyObject *__pyx_n_s_t_PADIC;
  static PyObject *__pyx_n_s_t_POL;
  static PyObject *__pyx_n_s_t_POLMOD;
  static PyObject *__pyx_n_s_t_QFI;
  static PyObject *__pyx_n_s_t_QFR;
  static PyObject *__pyx_n_s_t_QUAD;
  static PyObject *__pyx_n_s_t_REAL;
  static PyObject *__pyx_n_s_t_RFRAC;
  static PyObject *__pyx_n_s_t_SER;
  static PyObject *__pyx_n_s_t_STR;
  static PyObject *__pyx_n_s_t_VEC;
  static PyObject *__pyx_n_s_t_VECSMALL;
  static PyObject *__pyx_n_s_tech;
  static PyObject *__pyx_kp_u_teichmuller_x_teichmuller_chara;
  static PyObject *__pyx_n_s_test;
  static PyObject *__pyx_n_s_test_2;
  static PyObject *__pyx_n_s_testclass;
  static PyObject *__pyx_kp_u_truncate_x_estimate_False_Retur;
  static PyObject *__pyx_n_s_type;
  static PyObject *__pyx_n_s_types;
  static PyObject *__pyx_kp_s_unindexable_object;
  static PyObject *__pyx_n_s_unknown;
  static PyObject *__pyx_kp_s_used_by_cypari_gen_d;
  static PyObject *__pyx_kp_s_used_d;
  static PyObject *__pyx_n_s_utf8;
  static PyObject *__pyx_n_s_v;
  static PyObject *__pyx_kp_u_valuation_x_p_Return_the_valuat;
  static PyObject *__pyx_n_s_value;
  static PyObject *__pyx_n_s_var;
  static PyObject *__pyx_n_s_variable;
  static PyObject *__pyx_kp_u_variable_x_Return_the_main_vari;
  static PyObject *__pyx_n_s_vdir;
  static PyObject *__pyx_n_s_vecextract;
  static PyObject *__pyx_n_s_vecsmall_to_intlist;
  static PyObject *__pyx_n_s_vector;
  static PyObject *__pyx_kp_u_vector_long_n_entries_None_Crea;
  static PyObject *__pyx_n_s_version_info;
  static PyObject *__pyx_n_s_write;
  static PyObject *__pyx_n_s_x;
  static PyObject *__pyx_kp_u_x_eta_flag_0_if_flag_0_eta_func;
  static PyObject *__pyx_kp_u_x_exp_exponential_of_x_If_x_is;
  static PyObject *__pyx_kp_u_x_log_natural_logarithm_of_x_Th;
  static PyObject *__pyx_kp_u_x_matsnf_flag_0_Smith_normal_fo;
  static PyObject *__pyx_kp_s_x_must_be_of_type_t_VEC;
  static PyObject *__pyx_kp_u_x_newtonpoly_p_Newton_polygon_o;
  static PyObject *__pyx_kp_u_x_polylog_m_flag_0_m_th_polylog;
  static PyObject *__pyx_kp_u_x_psi_psi_function_at_x_Return;
  static PyObject *__pyx_kp_s_x_s_must_be_of_type_t_INT_but_is;
  static PyObject *__pyx_kp_s_x_s_must_be_of_type_t_VEC_but_is;
  static PyObject *__pyx_kp_u_x_sin_The_sine_of_x_If_x_is_an;
  static PyObject *__pyx_kp_u_x_sqr_square_of_x_Faster_than_a;
  static PyObject *__pyx_kp_u_x_sqrt_precision_The_square_roo;
  static PyObject *__pyx_kp_u_x_sqrtn_n_return_the_principal;
  static PyObject *__pyx_kp_u_x_tan_tangent_of_x_If_x_is_an_e;
  static PyObject *__pyx_kp_u_x_tanh_hyperbolic_tangent_of_x;
  static PyObject *__pyx_kp_u_x_weber_flag_0_One_of_Weber_s_f;
  static PyObject *__pyx_n_s_xrange;
  static PyObject *__pyx_n_s_y;
  static PyObject *__pyx_n_s_ya;
  static PyObject *__pyx_n_s_z;
  static PyObject *__pyx_n_s_z0;
  static PyObject *__pyx_n_s_z1;
  static PyObject *__pyx_kp_u_zeta_s_zeta_function_at_s_with;
  static PyObject *__pyx_int_0;
  static PyObject *__pyx_int_1;
  static PyObject *__pyx_int_2;
  static PyObject *__pyx_int_3;
  static PyObject *__pyx_int_4;
  static PyObject *__pyx_int_10;
  static PyObject *__pyx_int_14;
  static PyObject *__pyx_int_16;
  static PyObject *__pyx_int_20;
  static PyObject *__pyx_int_500000;
  static PyObject *__pyx_int_8000000;
  static PyObject *__pyx_int_16000000;
  static PyObject *__pyx_int_neg_1;
  static PyObject *__pyx_slice__7;
  static PyObject *__pyx_slice__9;
  static PyObject *__pyx_tuple__2;
  static PyObject *__pyx_tuple__3;
  static PyObject *__pyx_tuple__4;
  static PyObject *__pyx_slice__21;
  static PyObject *__pyx_tuple__13;
  static PyObject *__pyx_tuple__15;
  static PyObject *__pyx_tuple__17;
  static PyObject *__pyx_tuple__18;
  static PyObject *__pyx_tuple__19;
  static PyObject *__pyx_tuple__20;
  static PyObject *__pyx_tuple__22;
  static PyObject *__pyx_tuple__23;
  static PyObject *__pyx_tuple__24;
  static PyObject *__pyx_tuple__25;
  static PyObject *__pyx_tuple__26;
  static PyObject *__pyx_tuple__27;
  static PyObject *__pyx_tuple__28;
  static PyObject *__pyx_tuple__29;
  static PyObject *__pyx_tuple__30;
  static PyObject *__pyx_tuple__32;
  static PyObject *__pyx_tuple__34;
  static PyObject *__pyx_tuple__36;
  static PyObject *__pyx_tuple__38;
  static PyObject *__pyx_tuple__40;
  static PyObject *__pyx_tuple__42;
  static PyObject *__pyx_codeobj__31;
  static PyObject *__pyx_codeobj__33;
  static PyObject *__pyx_codeobj__35;
  static PyObject *__pyx_codeobj__37;
  static PyObject *__pyx_codeobj__39;
  static PyObject *__pyx_codeobj__41;
  static PyObject *__pyx_codeobj__43;

/* "cypari_src/gen.pyx":178
 * if sys.version_info[0] == 3: # Python 3
 *     xrange = range
 *     str_to_chars = lambda s : bytes(s, 'utf8')             # <<<<<<<<<<<<<<
 *     chars_to_str = lambda b : b.decode()
 * else: # Python 2
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_16lambda1(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_10cypari_src_3gen_16lambda1 = {"lambda1", (PyCFunction)__pyx_pw_10cypari_src_3gen_16lambda1, METH_O, 0};
static PyObject *__pyx_pw_10cypari_src_3gen_16lambda1(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_10cypari_src_3gen_lambda1(__pyx_self, ((PyObject *)__pyx_v_s));

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

static PyObject *__pyx_lambda_funcdef_10cypari_src_3gen_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
  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("lambda1", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  __Pyx_INCREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyBytes_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* "cypari_src/gen.pyx":179
 *     xrange = range
 *     str_to_chars = lambda s : bytes(s, 'utf8')
 *     chars_to_str = lambda b : b.decode()             # <<<<<<<<<<<<<<
 * else: # Python 2
 *     str_to_chars = lambda s : s
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_17lambda2(PyObject *__pyx_self, PyObject *__pyx_v_b); /*proto*/
static PyMethodDef __pyx_mdef_10cypari_src_3gen_17lambda2 = {"lambda2", (PyCFunction)__pyx_pw_10cypari_src_3gen_17lambda2, METH_O, 0};
static PyObject *__pyx_pw_10cypari_src_3gen_17lambda2(PyObject *__pyx_self, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_10cypari_src_3gen_lambda2(__pyx_self, ((PyObject *)__pyx_v_b));

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

static PyObject *__pyx_lambda_funcdef_10cypari_src_3gen_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b) {
  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("lambda2", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cypari_src.gen.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":181
 *     chars_to_str = lambda b : b.decode()
 * else: # Python 2
 *     str_to_chars = lambda s : s             # <<<<<<<<<<<<<<
 *     chars_to_str = lambda s : s
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_18lambda3(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_10cypari_src_3gen_18lambda3 = {"lambda3", (PyCFunction)__pyx_pw_10cypari_src_3gen_18lambda3, METH_O, 0};
static PyObject *__pyx_pw_10cypari_src_3gen_18lambda3(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_10cypari_src_3gen_lambda3(__pyx_self, ((PyObject *)__pyx_v_s));

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

static PyObject *__pyx_lambda_funcdef_10cypari_src_3gen_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda3", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_s);
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

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

/* "cypari_src/gen.pyx":182
 * else: # Python 2
 *     str_to_chars = lambda s : s
 *     chars_to_str = lambda s : s             # <<<<<<<<<<<<<<
 * 
 * # Our unique PARI instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_19lambda4(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_10cypari_src_3gen_19lambda4 = {"lambda4", (PyCFunction)__pyx_pw_10cypari_src_3gen_19lambda4, METH_O, 0};
static PyObject *__pyx_pw_10cypari_src_3gen_19lambda4(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_10cypari_src_3gen_lambda4(__pyx_self, ((PyObject *)__pyx_v_s));

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

static PyObject *__pyx_lambda_funcdef_10cypari_src_3gen_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda4", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_s);
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

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

/* "cypari_src/gen.pyx":207
 * # the computation but are actually copied by gcopy.
 * cdef pari_sp stack_mark
 * cdef inline void set_mark():             # <<<<<<<<<<<<<<
 *     global stack_mark, avma
 *     stack_mark = avma
 */

static CYTHON_INLINE void __pyx_f_10cypari_src_3gen_set_mark(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_mark", 0);

  /* "cypari_src/gen.pyx":209
 * cdef inline void set_mark():
 *     global stack_mark, avma
 *     stack_mark = avma             # <<<<<<<<<<<<<<
 * 
 * ##############################################
 */
  __pyx_v_10cypari_src_3gen_stack_mark = avma;

  /* "cypari_src/gen.pyx":207
 * # the computation but are actually copied by gcopy.
 * cdef pari_sp stack_mark
 * cdef inline void set_mark():             # <<<<<<<<<<<<<<
 *     global stack_mark, avma
 *     stack_mark = avma
 */

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

/* "cypari_src/gen.pyx":248
 * #################################################################
 * 
 * cpdef prec_bits_to_dec(int prec_in_bits):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in bits to precision expressed in
 */

static PyObject *__pyx_pw_10cypari_src_3gen_1prec_bits_to_dec(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_bits); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_bits_to_dec(int __pyx_v_prec_in_bits, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_v_log_2;
  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("prec_bits_to_dec", 0);

  /* "cypari_src/gen.pyx":261
 *         [(32, 9), (64, 19), (96, 28), (128, 38), (160, 48), (192, 57), (224, 67), (256, 77)]
 *         """
 *     log_2 = 0.301029995663981             # <<<<<<<<<<<<<<
 *     return int(prec_in_bits*log_2)
 * 
 */
  __pyx_v_log_2 = 0.301029995663981;

  /* "cypari_src/gen.pyx":262
 *         """
 *     log_2 = 0.301029995663981
 *     return int(prec_in_bits*log_2)             # <<<<<<<<<<<<<<
 * 
 * cpdef prec_dec_to_bits(int prec_in_dec):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_prec_in_bits * __pyx_v_log_2)); 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);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); 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);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":248
 * #################################################################
 * 
 * cpdef prec_bits_to_dec(int prec_in_bits):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in bits to precision expressed in
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.prec_bits_to_dec", __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_10cypari_src_3gen_1prec_bits_to_dec(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_bits); /*proto*/
static char __pyx_doc_10cypari_src_3gen_prec_bits_to_dec[] = "\n    Convert from precision expressed in bits to precision expressed in\n    decimal.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_bits_to_dec(53)\n        15\n        >>> [(32*n,gen.prec_bits_to_dec(32*n)) for n in range(1,9)]\n        [(32, 9), (64, 19), (96, 28), (128, 38), (160, 48), (192, 57), (224, 67), (256, 77)]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_1prec_bits_to_dec(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_bits) {
  int __pyx_v_prec_in_bits;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prec_bits_to_dec (wrapper)", 0);
  assert(__pyx_arg_prec_in_bits); {
    __pyx_v_prec_in_bits = __Pyx_PyInt_As_int(__pyx_arg_prec_in_bits); if (unlikely((__pyx_v_prec_in_bits == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.prec_bits_to_dec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_prec_bits_to_dec(__pyx_self, ((int)__pyx_v_prec_in_bits));

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

static PyObject *__pyx_pf_10cypari_src_3gen_prec_bits_to_dec(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_bits) {
  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("prec_bits_to_dec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_bits_to_dec(__pyx_v_prec_in_bits, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.prec_bits_to_dec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":264
 *     return int(prec_in_bits*log_2)
 * 
 * cpdef prec_dec_to_bits(int prec_in_dec):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in decimal to precision expressed
 */

static PyObject *__pyx_pw_10cypari_src_3gen_3prec_dec_to_bits(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_dec); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_dec_to_bits(int __pyx_v_prec_in_dec, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_v_log_10;
  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("prec_dec_to_bits", 0);

  /* "cypari_src/gen.pyx":277
 *         [(10, 33), (20, 66), (30, 99), (40, 132), (50, 166), (60, 199), (70, 232), (80, 265), (90, 298)]
 *     """
 *     log_10 = 3.32192809488736             # <<<<<<<<<<<<<<
 *     return int(prec_in_dec*log_10)
 * 
 */
  __pyx_v_log_10 = 3.32192809488736;

  /* "cypari_src/gen.pyx":278
 *     """
 *     log_10 = 3.32192809488736
 *     return int(prec_in_dec*log_10)             # <<<<<<<<<<<<<<
 * 
 * cpdef prec_bits_to_words(int prec_in_bits=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_prec_in_dec * __pyx_v_log_10)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __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 = 278; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":264
 *     return int(prec_in_bits*log_2)
 * 
 * cpdef prec_dec_to_bits(int prec_in_dec):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in decimal to precision expressed
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.prec_dec_to_bits", __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_10cypari_src_3gen_3prec_dec_to_bits(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_dec); /*proto*/
static char __pyx_doc_10cypari_src_3gen_2prec_dec_to_bits[] = "\n    Convert from precision expressed in decimal to precision expressed\n    in bits.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_dec_to_bits(15)\n        49\n        >>> [(n,gen.prec_dec_to_bits(n)) for n in range(10,100,10)]\n        [(10, 33), (20, 66), (30, 99), (40, 132), (50, 166), (60, 199), (70, 232), (80, 265), (90, 298)]\n    ";
static PyObject *__pyx_pw_10cypari_src_3gen_3prec_dec_to_bits(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_dec) {
  int __pyx_v_prec_in_dec;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prec_dec_to_bits (wrapper)", 0);
  assert(__pyx_arg_prec_in_dec); {
    __pyx_v_prec_in_dec = __Pyx_PyInt_As_int(__pyx_arg_prec_in_dec); if (unlikely((__pyx_v_prec_in_dec == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.prec_dec_to_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_2prec_dec_to_bits(__pyx_self, ((int)__pyx_v_prec_in_dec));

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

static PyObject *__pyx_pf_10cypari_src_3gen_2prec_dec_to_bits(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_dec) {
  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("prec_dec_to_bits", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_dec_to_bits(__pyx_v_prec_in_dec, 0); 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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.prec_dec_to_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":280
 *     return int(prec_in_dec*log_10)
 * 
 * cpdef prec_bits_to_words(int prec_in_bits=0):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in bits to pari real precision
 */

static PyObject *__pyx_pw_10cypari_src_3gen_5prec_bits_to_words(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_bits_to_words(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_10cypari_src_3gen_prec_bits_to_words *__pyx_optional_args) {
  int __pyx_v_prec_in_bits = ((int)0);
  int __pyx_v_wordsize;
  int __pyx_v_padded_bits;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prec_bits_to_words", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_prec_in_bits = __pyx_optional_args->prec_in_bits;
    }
  }

  /* "cypari_src/gen.pyx":299
 *         [(32, 3), (64, 3), (96, 4), (128, 4), (160, 5), (192, 5), (224, 6), (256, 6)]
 *     """
 *     if not prec_in_bits:             # <<<<<<<<<<<<<<
 *         return prec
 *     cdef int wordsize
 */
  __pyx_t_1 = ((!(__pyx_v_prec_in_bits != 0)) != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":300
 *     """
 *     if not prec_in_bits:
 *         return prec             # <<<<<<<<<<<<<<
 *     cdef int wordsize
 *     wordsize = BITS_IN_LONG
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_long(__pyx_v_10cypari_src_3gen_prec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":302
 *         return prec
 *     cdef int wordsize
 *     wordsize = BITS_IN_LONG             # <<<<<<<<<<<<<<
 * 
 *     # increase prec_in_bits to the nearest multiple of wordsize
 */
  __pyx_v_wordsize = BITS_IN_LONG;

  /* "cypari_src/gen.pyx":306
 *     # increase prec_in_bits to the nearest multiple of wordsize
 *     cdef int padded_bits
 *     padded_bits = (prec_in_bits + wordsize - 1) & ~(wordsize - 1)             # <<<<<<<<<<<<<<
 *     return int(padded_bits/wordsize + 2)
 * 
 */
  __pyx_v_padded_bits = (((__pyx_v_prec_in_bits + __pyx_v_wordsize) - 1) & (~(__pyx_v_wordsize - 1)));

  /* "cypari_src/gen.pyx":307
 *     cdef int padded_bits
 *     padded_bits = (prec_in_bits + wordsize - 1) & ~(wordsize - 1)
 *     return int(padded_bits/wordsize + 2)             # <<<<<<<<<<<<<<
 * 
 * pbw = prec_bits_to_words
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_wordsize == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_wordsize == (int)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_padded_bits))) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyInt_From_long((__Pyx_div_int(__pyx_v_padded_bits, __pyx_v_wordsize) + 2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __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 = 307; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":280
 *     return int(prec_in_dec*log_10)
 * 
 * cpdef prec_bits_to_words(int prec_in_bits=0):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in bits to pari real precision
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cypari_src.gen.prec_bits_to_words", __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_10cypari_src_3gen_5prec_bits_to_words(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_4prec_bits_to_words[] = "\n    Convert from precision expressed in bits to pari real precision\n    expressed in words. Note: this rounds up to the nearest word,\n    adjusts for the two codewords of a pari real, and is\n    architecture-dependent.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_bits_to_words(70)    # 32-bit:  5\n        4\n    \n    ::\n\n        # 32-bit: [(32, 3), (64, 4), (96, 5), (128, 6), (160, 7), (192, 8), (224, 9), (256, 10)]\n        >>> [(32*n,gen.prec_bits_to_words(32*n)) for n in range(1,9)]\n        [(32, 3), (64, 3), (96, 4), (128, 4), (160, 5), (192, 5), (224, 6), (256, 6)]\n    ";
static PyObject *__pyx_pw_10cypari_src_3gen_5prec_bits_to_words(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_prec_in_bits;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prec_bits_to_words (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prec_in_bits,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_prec_in_bits);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prec_bits_to_words") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __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;
      }
    }
    if (values[0]) {
      __pyx_v_prec_in_bits = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_prec_in_bits == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_prec_in_bits = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prec_bits_to_words", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.prec_bits_to_words", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_4prec_bits_to_words(__pyx_self, __pyx_v_prec_in_bits);

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

static PyObject *__pyx_pf_10cypari_src_3gen_4prec_bits_to_words(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_bits) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10cypari_src_3gen_prec_bits_to_words __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prec_bits_to_words", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.prec_in_bits = __pyx_v_prec_in_bits;
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_bits_to_words(0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.prec_bits_to_words", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":311
 * pbw = prec_bits_to_words
 * 
 * cpdef prec_words_to_bits(int prec_in_words):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from pari real precision expressed in words to precision
 */

static PyObject *__pyx_pw_10cypari_src_3gen_7prec_words_to_bits(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_words); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_words_to_bits(int __pyx_v_prec_in_words, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("prec_words_to_bits", 0);

  /* "cypari_src/gen.pyx":329
 *     """
 *     # see user's guide to the pari library, page 10
 *     return int((prec_in_words - 2) * BITS_IN_LONG)             # <<<<<<<<<<<<<<
 * 
 * cpdef prec_dec_to_words(int prec_in_dec):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_long(((__pyx_v_prec_in_words - 2) * BITS_IN_LONG)); 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":311
 * pbw = prec_bits_to_words
 * 
 * cpdef prec_words_to_bits(int prec_in_words):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from pari real precision expressed in words to precision
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.prec_words_to_bits", __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_10cypari_src_3gen_7prec_words_to_bits(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_words); /*proto*/
static char __pyx_doc_10cypari_src_3gen_6prec_words_to_bits[] = "\n    Convert from pari real precision expressed in words to precision\n    expressed in bits. Note: this adjusts for the two codewords of a\n    pari real, and is architecture-dependent.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_words_to_bits(10)   # 32-bit: 256\n        512\n\n        # 32-bit: [(3, 32), (4, 64), (5, 96), (6, 128), (7, 160), (8, 192), (9, 224)]\n        >>> [(n,gen.prec_words_to_bits(n)) for n in range(3,10)]\n        [(3, 64), (4, 128), (5, 192), (6, 256), (7, 320), (8, 384), (9, 448)]\n    \n    ";
static PyObject *__pyx_pw_10cypari_src_3gen_7prec_words_to_bits(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_words) {
  int __pyx_v_prec_in_words;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prec_words_to_bits (wrapper)", 0);
  assert(__pyx_arg_prec_in_words); {
    __pyx_v_prec_in_words = __Pyx_PyInt_As_int(__pyx_arg_prec_in_words); if (unlikely((__pyx_v_prec_in_words == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.prec_words_to_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_6prec_words_to_bits(__pyx_self, ((int)__pyx_v_prec_in_words));

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

static PyObject *__pyx_pf_10cypari_src_3gen_6prec_words_to_bits(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_words) {
  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("prec_words_to_bits", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_words_to_bits(__pyx_v_prec_in_words, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.prec_words_to_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":331
 *     return int((prec_in_words - 2) * BITS_IN_LONG)
 * 
 * cpdef prec_dec_to_words(int prec_in_dec):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in decimal to precision expressed
 */

static PyObject *__pyx_pw_10cypari_src_3gen_9prec_dec_to_words(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_dec); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_dec_to_words(int __pyx_v_prec_in_dec, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  struct __pyx_opt_args_10cypari_src_3gen_prec_bits_to_words __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prec_dec_to_words", 0);

  /* "cypari_src/gen.pyx":348
 * 
 *     """
 *     return prec_bits_to_words(prec_dec_to_bits(prec_in_dec))             # <<<<<<<<<<<<<<
 * 
 * cpdef prec_words_to_dec(int prec_in_words):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_dec_to_bits(__pyx_v_prec_in_dec, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.prec_in_bits = __pyx_t_2;
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_bits_to_words(0, &__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":331
 *     return int((prec_in_words - 2) * BITS_IN_LONG)
 * 
 * cpdef prec_dec_to_words(int prec_in_dec):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in decimal to precision expressed
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.prec_dec_to_words", __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_10cypari_src_3gen_9prec_dec_to_words(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_dec); /*proto*/
static char __pyx_doc_10cypari_src_3gen_8prec_dec_to_words[] = "\n    Convert from precision expressed in decimal to precision expressed\n    in words. Note: this rounds up to the nearest word, adjusts for the\n    two codewords of a pari real, and is architecture-dependent.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_dec_to_words(38)   # 32-bit: 6\n        4\n        \n        # 32-bit: [(10, 4), (20, 5), (30, 6), (40, 7), (50, 8), (60, 9), (70, 10), (80, 11)] \n        >>> [(n,gen.prec_dec_to_words(n)) for n in range(10,90,10)]\n        [(10, 3), (20, 4), (30, 4), (40, 5), (50, 5), (60, 6), (70, 6), (80, 7)]\n        \n    ";
static PyObject *__pyx_pw_10cypari_src_3gen_9prec_dec_to_words(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_dec) {
  int __pyx_v_prec_in_dec;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prec_dec_to_words (wrapper)", 0);
  assert(__pyx_arg_prec_in_dec); {
    __pyx_v_prec_in_dec = __Pyx_PyInt_As_int(__pyx_arg_prec_in_dec); if (unlikely((__pyx_v_prec_in_dec == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.prec_dec_to_words", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_8prec_dec_to_words(__pyx_self, ((int)__pyx_v_prec_in_dec));

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

static PyObject *__pyx_pf_10cypari_src_3gen_8prec_dec_to_words(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_dec) {
  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("prec_dec_to_words", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_dec_to_words(__pyx_v_prec_in_dec, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.prec_dec_to_words", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":350
 *     return prec_bits_to_words(prec_dec_to_bits(prec_in_dec))
 * 
 * cpdef prec_words_to_dec(int prec_in_words):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in words to precision expressed in
 */

static PyObject *__pyx_pw_10cypari_src_3gen_11prec_words_to_dec(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_words); /*proto*/
static PyObject *__pyx_f_10cypari_src_3gen_prec_words_to_dec(int __pyx_v_prec_in_words, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prec_words_to_dec", 0);

  /* "cypari_src/gen.pyx":366
 *         [(3, 19), (4, 38), (5, 57), (6, 77), (7, 96), (8, 115), (9, 134)]
 *     """
 *     return prec_bits_to_dec(prec_words_to_bits(prec_in_words))             # <<<<<<<<<<<<<<
 * 
 * # Also a copy of PARI accessible from external pure python code.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_words_to_bits(__pyx_v_prec_in_words, 0); 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_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_bits_to_dec(__pyx_t_2, 0); 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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":350
 *     return prec_bits_to_words(prec_dec_to_bits(prec_in_dec))
 * 
 * cpdef prec_words_to_dec(int prec_in_words):             # <<<<<<<<<<<<<<
 *     r"""
 *     Convert from precision expressed in words to precision expressed in
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.prec_words_to_dec", __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_10cypari_src_3gen_11prec_words_to_dec(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_words); /*proto*/
static char __pyx_doc_10cypari_src_3gen_10prec_words_to_dec[] = "\n    Convert from precision expressed in words to precision expressed in\n    decimal. Note: this adjusts for the two codewords of a pari real,\n    and is architecture-dependent.\n    \n    EXAMPLES::\n    \n        >>> import cypari.gen as gen\n        >>> gen.prec_words_to_dec(5)    # 32-bit: 28\n        57\n\n        # 32-bit: [(3, 9), (4, 19), (5, 28), (6, 38), (7, 48), (8, 57), (9, 67)] \n        >>> [(n,gen.prec_words_to_dec(n)) for n in range(3,10)]\n        [(3, 19), (4, 38), (5, 57), (6, 77), (7, 96), (8, 115), (9, 134)]\n    ";
static PyObject *__pyx_pw_10cypari_src_3gen_11prec_words_to_dec(PyObject *__pyx_self, PyObject *__pyx_arg_prec_in_words) {
  int __pyx_v_prec_in_words;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prec_words_to_dec (wrapper)", 0);
  assert(__pyx_arg_prec_in_words); {
    __pyx_v_prec_in_words = __Pyx_PyInt_As_int(__pyx_arg_prec_in_words); if (unlikely((__pyx_v_prec_in_words == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.prec_words_to_dec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_10prec_words_to_dec(__pyx_self, ((int)__pyx_v_prec_in_words));

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

static PyObject *__pyx_pf_10cypari_src_3gen_10prec_words_to_dec(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_prec_in_words) {
  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("prec_words_to_dec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_words_to_dec(__pyx_v_prec_in_words, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.prec_words_to_dec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":376
 * t0heap = [0]*5
 * 
 * cdef t0GEN(x):             # <<<<<<<<<<<<<<
 *     global t0
 *     t0 = P.toGEN(x, 0)
 */

static PyObject *__pyx_f_10cypari_src_3gen_t0GEN(PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GEN __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("t0GEN", 0);

  /* "cypari_src/gen.pyx":378
 * cdef t0GEN(x):
 *     global t0
 *     t0 = P.toGEN(x, 0)             # <<<<<<<<<<<<<<
 * 
 * cdef t1GEN(x):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->toGEN(__pyx_v_10cypari_src_3gen_P, __pyx_v_x, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_10cypari_src_3gen_t0 = __pyx_t_1;

  /* "cypari_src/gen.pyx":376
 * t0heap = [0]*5
 * 
 * cdef t0GEN(x):             # <<<<<<<<<<<<<<
 *     global t0
 *     t0 = P.toGEN(x, 0)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cypari_src.gen.t0GEN", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":380
 *     t0 = P.toGEN(x, 0)
 * 
 * cdef t1GEN(x):             # <<<<<<<<<<<<<<
 *     global t1
 *     t1 = P.toGEN(x, 1)
 */

static PyObject *__pyx_f_10cypari_src_3gen_t1GEN(PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GEN __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("t1GEN", 0);

  /* "cypari_src/gen.pyx":382
 * cdef t1GEN(x):
 *     global t1
 *     t1 = P.toGEN(x, 1)             # <<<<<<<<<<<<<<
 * 
 * cdef t2GEN(x):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->toGEN(__pyx_v_10cypari_src_3gen_P, __pyx_v_x, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_10cypari_src_3gen_t1 = __pyx_t_1;

  /* "cypari_src/gen.pyx":380
 *     t0 = P.toGEN(x, 0)
 * 
 * cdef t1GEN(x):             # <<<<<<<<<<<<<<
 *     global t1
 *     t1 = P.toGEN(x, 1)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cypari_src.gen.t1GEN", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":384
 *     t1 = P.toGEN(x, 1)
 * 
 * cdef t2GEN(x):             # <<<<<<<<<<<<<<
 *     global t2
 *     t2 = P.toGEN(x, 2)
 */

static PyObject *__pyx_f_10cypari_src_3gen_t2GEN(PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GEN __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("t2GEN", 0);

  /* "cypari_src/gen.pyx":386
 * cdef t2GEN(x):
 *     global t2
 *     t2 = P.toGEN(x, 2)             # <<<<<<<<<<<<<<
 * 
 * cdef t3GEN(x):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->toGEN(__pyx_v_10cypari_src_3gen_P, __pyx_v_x, 2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_10cypari_src_3gen_t2 = __pyx_t_1;

  /* "cypari_src/gen.pyx":384
 *     t1 = P.toGEN(x, 1)
 * 
 * cdef t2GEN(x):             # <<<<<<<<<<<<<<
 *     global t2
 *     t2 = P.toGEN(x, 2)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cypari_src.gen.t2GEN", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":388
 *     t2 = P.toGEN(x, 2)
 * 
 * cdef t3GEN(x):             # <<<<<<<<<<<<<<
 *     global t3
 *     t3 = P.toGEN(x, 3)
 */

static PyObject *__pyx_f_10cypari_src_3gen_t3GEN(PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GEN __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("t3GEN", 0);

  /* "cypari_src/gen.pyx":390
 * cdef t3GEN(x):
 *     global t3
 *     t3 = P.toGEN(x, 3)             # <<<<<<<<<<<<<<
 * 
 * cdef t4GEN(x):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->toGEN(__pyx_v_10cypari_src_3gen_P, __pyx_v_x, 3); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_10cypari_src_3gen_t3 = __pyx_t_1;

  /* "cypari_src/gen.pyx":388
 *     t2 = P.toGEN(x, 2)
 * 
 * cdef t3GEN(x):             # <<<<<<<<<<<<<<
 *     global t3
 *     t3 = P.toGEN(x, 3)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cypari_src.gen.t3GEN", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":392
 *     t3 = P.toGEN(x, 3)
 * 
 * cdef t4GEN(x):             # <<<<<<<<<<<<<<
 *     global t4
 *     t4 = P.toGEN(x, 4)
 */

static PyObject *__pyx_f_10cypari_src_3gen_t4GEN(PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GEN __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("t4GEN", 0);

  /* "cypari_src/gen.pyx":394
 * cdef t4GEN(x):
 *     global t4
 *     t4 = P.toGEN(x, 4)             # <<<<<<<<<<<<<<
 * 
 * cdef class gen:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->toGEN(__pyx_v_10cypari_src_3gen_P, __pyx_v_x, 4); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_10cypari_src_3gen_t4 = __pyx_t_1;

  /* "cypari_src/gen.pyx":392
 *     t3 = P.toGEN(x, 3)
 * 
 * cdef t4GEN(x):             # <<<<<<<<<<<<<<
 *     global t4
 *     t4 = P.toGEN(x, 4)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cypari_src.gen.t4GEN", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":405
 *     # components.
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.b = 0
 *         self._parent = P
 */

/* Python wrapper */
static int __pyx_pw_10cypari_src_3gen_3gen_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10cypari_src_3gen_3gen_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen___init__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static int __pyx_pf_10cypari_src_3gen_3gen___init__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cypari_src/gen.pyx":406
 * 
 *     def __init__(self):
 *         self.b = 0             # <<<<<<<<<<<<<<
 *         self._parent = P
 *         self._refers_to = {}
 */
  __pyx_v_self->b = 0;

  /* "cypari_src/gen.pyx":407
 *     def __init__(self):
 *         self.b = 0
 *         self._parent = P             # <<<<<<<<<<<<<<
 *         self._refers_to = {}
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
  __Pyx_GOTREF(__pyx_v_self->_parent);
  __Pyx_DECREF(__pyx_v_self->_parent);
  __pyx_v_self->_parent = ((PyObject *)__pyx_v_10cypari_src_3gen_P);

  /* "cypari_src/gen.pyx":408
 *         self.b = 0
 *         self._parent = P
 *         self._refers_to = {}             # <<<<<<<<<<<<<<
 * 
 *     def parent(self):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_refers_to);
  __Pyx_DECREF(__pyx_v_self->_refers_to);
  __pyx_v_self->_refers_to = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":405
 *     # components.
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.b = 0
 *         self._parent = P
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":410
 *         self._refers_to = {}
 * 
 *     def parent(self):             # <<<<<<<<<<<<<<
 *         return self._parent
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_3parent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_3parent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parent (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_2parent(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_2parent(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parent", 0);

  /* "cypari_src/gen.pyx":411
 * 
 *     def parent(self):
 *         return self._parent             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, GEN g, pari_sp b):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_parent);
  __pyx_r = __pyx_v_self->_parent;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":410
 *         self._refers_to = {}
 * 
 *     def parent(self):             # <<<<<<<<<<<<<<
 *         return self._parent
 * 
 */

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

/* "cypari_src/gen.pyx":413
 *         return self._parent
 * 
 *     cdef void init(self, GEN g, pari_sp b):             # <<<<<<<<<<<<<<
 *         """
 *         g - PARI GEN b - pointer to memory chunk where PARI gen lives (if
 */

static void __pyx_f_10cypari_src_3gen_3gen_init(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, GEN __pyx_v_g, pari_sp __pyx_v_b) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "cypari_src/gen.pyx":419
 *         scope).
 *         """
 *         self.g = g             # <<<<<<<<<<<<<<
 *         self.b = b
 *         self._parent = P
 */
  __pyx_v_self->g = __pyx_v_g;

  /* "cypari_src/gen.pyx":420
 *         """
 *         self.g = g
 *         self.b = b             # <<<<<<<<<<<<<<
 *         self._parent = P
 *         self._refers_to = {}
 */
  __pyx_v_self->b = __pyx_v_b;

  /* "cypari_src/gen.pyx":421
 *         self.g = g
 *         self.b = b
 *         self._parent = P             # <<<<<<<<<<<<<<
 *         self._refers_to = {}
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
  __Pyx_GOTREF(__pyx_v_self->_parent);
  __Pyx_DECREF(__pyx_v_self->_parent);
  __pyx_v_self->_parent = ((PyObject *)__pyx_v_10cypari_src_3gen_P);

  /* "cypari_src/gen.pyx":422
 *         self.b = b
 *         self._parent = P
 *         self._refers_to = {}             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_refers_to);
  __Pyx_DECREF(__pyx_v_self->_refers_to);
  __pyx_v_self->_refers_to = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":413
 *         return self._parent
 * 
 *     cdef void init(self, GEN g, pari_sp b):             # <<<<<<<<<<<<<<
 *         """
 *         g - PARI GEN b - pointer to memory chunk where PARI gen lives (if
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cypari_src.gen.gen.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "cypari_src/gen.pyx":424
 *         self._refers_to = {}
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.b:
 *             PyMem_Free(<void*> self.b)
 */

/* Python wrapper */
static void __pyx_pw_10cypari_src_3gen_3gen_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10cypari_src_3gen_3gen_5__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10cypari_src_3gen_3gen_4__dealloc__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static void __pyx_pf_10cypari_src_3gen_3gen_4__dealloc__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "cypari_src/gen.pyx":425
 * 
 *     def __dealloc__(self):
 *         if self.b:             # <<<<<<<<<<<<<<
 *             PyMem_Free(<void*> self.b)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->b != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":426
 *     def __dealloc__(self):
 *         if self.b:
 *             PyMem_Free(<void*> self.b)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    PyMem_Free(((void *)__pyx_v_self->b));
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cypari_src/gen.pyx":424
 *         self._refers_to = {}
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.b:
 *             PyMem_Free(<void*> self.b)
 */

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

/* "cypari_src/gen.pyx":428
 *             PyMem_Free(<void*> self.b)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return chars_to_str(P.new_gen_to_bytes(self.g))
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_7__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_6__repr__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_6__repr__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cypari_src/gen.pyx":429
 * 
 *     def __repr__(self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return chars_to_str(P.new_gen_to_bytes(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":430
 *     def __repr__(self):
 *         sig_on()
 *         return chars_to_str(P.new_gen_to_bytes(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_chars_to_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen_to_bytes(__pyx_v_10cypari_src_3gen_P, __pyx_v_self->g); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":428
 *             PyMem_Free(<void*> self.b)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return chars_to_str(P.new_gen_to_bytes(self.g))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cypari_src.gen.gen.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":432
 *         return chars_to_str(P.new_gen_to_bytes(self.g))
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the hash of self, computed using PARI's hash_GEN().
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_10cypari_src_3gen_3gen_9__hash__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_8__hash__[] = "\n        Return the hash of self, computed using PARI's hash_GEN().\n        \n        TESTS::\n        \n            >>> isinstance( pari('1 + 2.0*I').__hash__(), int )\n            True\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_10cypari_src_3gen_3gen_8__hash__;
#endif
static Py_hash_t __pyx_pw_10cypari_src_3gen_3gen_9__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_8__hash__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static Py_hash_t __pyx_pf_10cypari_src_3gen_3gen_8__hash__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  long __pyx_v_h;
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "cypari_src/gen.pyx":445
 *         # Let's hope this doesn't crash.
 *         #sig_on()
 *         h = hash_GEN(self.g)             # <<<<<<<<<<<<<<
 *         #sig_off()
 *         return h
 */
  __pyx_v_h = hash_GEN(__pyx_v_self->g);

  /* "cypari_src/gen.pyx":447
 *         h = hash_GEN(self.g)
 *         #sig_off()
 *         return h             # <<<<<<<<<<<<<<
 * 
 *     def _testclass(self):
 */
  __pyx_r = __pyx_v_h;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":432
 *         return chars_to_str(P.new_gen_to_bytes(self.g))
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the hash of self, computed using PARI's hash_GEN().
 */

  /* function exit code */
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":449
 *         return h
 * 
 *     def _testclass(self):             # <<<<<<<<<<<<<<
 *         import test
 *         T = test.testclass()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_11_testclass(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_11_testclass(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_testclass (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_10_testclass(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_10_testclass(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  PyObject *__pyx_v_test = NULL;
  PyObject *__pyx_v_T = 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("_testclass", 0);

  /* "cypari_src/gen.pyx":450
 * 
 *     def _testclass(self):
 *         import test             # <<<<<<<<<<<<<<
 *         T = test.testclass()
 *         T._init(self)
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_test, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_test = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":451
 *     def _testclass(self):
 *         import test
 *         T = test.testclass()             # <<<<<<<<<<<<<<
 *         T._init(self)
 *         return T
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_test, __pyx_n_s_testclass); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_T = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":452
 *         import test
 *         T = test.testclass()
 *         T._init(self)             # <<<<<<<<<<<<<<
 *         return T
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_T, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); 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);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":453
 *         T = test.testclass()
 *         T._init(self)
 *         return T             # <<<<<<<<<<<<<<
 * 
 *     cdef GEN _gen(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_T);
  __pyx_r = __pyx_v_T;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":449
 *         return h
 * 
 *     def _testclass(self):             # <<<<<<<<<<<<<<
 *         import test
 *         T = test.testclass()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cypari_src.gen.gen._testclass", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_test);
  __Pyx_XDECREF(__pyx_v_T);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":455
 *         return T
 * 
 *     cdef GEN _gen(self):             # <<<<<<<<<<<<<<
 *         return self.g
 * 
 */

static GEN __pyx_f_10cypari_src_3gen_3gen__gen(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  GEN __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_gen", 0);

  /* "cypari_src/gen.pyx":456
 * 
 *     cdef GEN _gen(self):
 *         return self.g             # <<<<<<<<<<<<<<
 * 
 *     def list(self):
 */
  __pyx_r = __pyx_v_self->g;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":455
 *         return T
 * 
 *     cdef GEN _gen(self):             # <<<<<<<<<<<<<<
 *         return self.g
 * 
 */

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

/* "cypari_src/gen.pyx":458
 *         return self.g
 * 
 *     def list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert self to a list of PARI gens.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_13list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_12list[] = "\n        Convert self to a list of PARI gens.\n\n        EXAMPLES:\n\n        A PARI vector becomes a Sage list::\n\n            >>> L = pari(\"vector(10,i,i^2)\").list()\n            >>> L\n            [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\n            >>> isinstance(L, list)\n            True\n            >>> isinstance(L[0], gen)\n            True\n\n        For polynomials, list() behaves as for ordinary Sage polynomials::\n\n            >>> pol = pari(\"x^3 + 5/3*x\"); pol.list()\n            [0, 5/3, 0, 1]\n\n        For power series or laurent series, we get all coefficients starting\n        from the lowest degree term.  This includes trailing zeros::\n\n            >>> pari('x^2 + O(x^8)').list()\n            [1, 0, 0, 0, 0, 0]\n            >>> s = pari('x^-2 + O(x^0)')\n            >>> s.list()\n            [1, 0]\n\n        For matrices, we get a list of columns::\n\n            >>> M = pari('[1,4;2,5;3,6]'); M\n            [1, 4; 2, 5; 3, 6]\n            >>> M.list()\n            [[1, 2, 3]~, [4, 5, 6]~]\n\n        For \"scalar\" types, we get a 1-element list containing ``self``::\n\n            >>> pari(\"42\").list()\n            [42]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_13list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_12list(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_12list(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list", 0);

  /* "cypari_src/gen.pyx":500
 *             [42]
 *         """
 *         if typ(self.g) == t_POL:             # <<<<<<<<<<<<<<
 *             return list(self.Vecrev())
 *         return list(self.Vec())
 */
  __pyx_t_1 = ((typ(__pyx_v_self->g) == t_POL) != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":501
 *         """
 *         if typ(self.g) == t_POL:
 *             return list(self.Vecrev())             # <<<<<<<<<<<<<<
 *         return list(self.Vec())
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Vecrev); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":502
 *         if typ(self.g) == t_POL:
 *             return list(self.Vecrev())
 *         return list(self.Vec())             # <<<<<<<<<<<<<<
 * 
 * #    def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Vec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":458
 *         return self.g
 * 
 *     def list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert self to a list of PARI gens.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cypari_src.gen.gen.list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":516
 * #        return cypari.gen_py.pari, (s,)
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_15__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_15__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_14__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_14__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_left = 0;
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_right = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "cypari_src/gen.pyx":518
 *     def __add__(self, other):
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)             # <<<<<<<<<<<<<<
 *         right = other if isinstance(other, gen) else P(other)
 *         sig_on()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_self, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_self);
    __pyx_t_1 = __pyx_v_self;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __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 = NULL;
      __Pyx_INCREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_left = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":519
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gadd(left.g, right.g))
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_other);
    __pyx_t_1 = __pyx_v_other;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_right = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":520
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gadd(left.g, right.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":521
 *         right = other if isinstance(other, gen) else P(other)
 *         sig_on()
 *         return P.new_gen(gadd(left.g, right.g))             # <<<<<<<<<<<<<<
 * 
 *     def __sub__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gadd(__pyx_v_left->g, __pyx_v_right->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":516
 * #        return cypari.gen_py.pari, (s,)
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cypari_src.gen.gen.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_left);
  __Pyx_XDECREF((PyObject *)__pyx_v_right);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":523
 *         return P.new_gen(gadd(left.g, right.g))
 * 
 *     def __sub__(self, other):             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_17__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_17__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_16__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_16__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_left = 0;
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_right = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__sub__", 0);

  /* "cypari_src/gen.pyx":525
 *     def __sub__(self, other):
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)             # <<<<<<<<<<<<<<
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_self, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_self);
    __pyx_t_1 = __pyx_v_self;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __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 = NULL;
      __Pyx_INCREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_left = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":526
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_other);
    __pyx_t_1 = __pyx_v_other;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_right = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":527
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gsub(left.g, right.g))
 */
  __pyx_f_10cypari_src_3gen_set_mark();

  /* "cypari_src/gen.pyx":528
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gsub(left.g, right.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":529
 *         set_mark()
 *         sig_on()
 *         return P.new_gen(gsub(left.g, right.g))             # <<<<<<<<<<<<<<
 * 
 *     def __mul__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gsub(__pyx_v_left->g, __pyx_v_right->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":523
 *         return P.new_gen(gadd(left.g, right.g))
 * 
 *     def __sub__(self, other):             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cypari_src.gen.gen.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_left);
  __Pyx_XDECREF((PyObject *)__pyx_v_right);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":531
 *         return P.new_gen(gsub(left.g, right.g))
 * 
 *     def __mul__(self, other):             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_19__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_19__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_18__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_18__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_left = 0;
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_right = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__mul__", 0);

  /* "cypari_src/gen.pyx":533
 *     def __mul__(self, other):
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)             # <<<<<<<<<<<<<<
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_self, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_self);
    __pyx_t_1 = __pyx_v_self;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __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 = NULL;
      __Pyx_INCREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_left = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":534
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_other);
    __pyx_t_1 = __pyx_v_other;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_right = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":535
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gmul(left.g, right.g))
 */
  __pyx_f_10cypari_src_3gen_set_mark();

  /* "cypari_src/gen.pyx":536
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gmul(left.g, right.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":537
 *         set_mark()
 *         sig_on()
 *         return P.new_gen(gmul(left.g, right.g))             # <<<<<<<<<<<<<<
 * 
 *     def __truediv__(self, other):  # Python 3
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gmul(__pyx_v_left->g, __pyx_v_right->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":531
 *         return P.new_gen(gsub(left.g, right.g))
 * 
 *     def __mul__(self, other):             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cypari_src.gen.gen.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_left);
  __Pyx_XDECREF((PyObject *)__pyx_v_right);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":539
 *         return P.new_gen(gmul(left.g, right.g))
 * 
 *     def __truediv__(self, other):  # Python 3             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_21__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_21__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_20__truediv__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_20__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_left = 0;
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_right = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__truediv__", 0);

  /* "cypari_src/gen.pyx":541
 *     def __truediv__(self, other):  # Python 3
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)             # <<<<<<<<<<<<<<
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_self, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_self);
    __pyx_t_1 = __pyx_v_self;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __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 = NULL;
      __Pyx_INCREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_left = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":542
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_other);
    __pyx_t_1 = __pyx_v_other;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_right = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":543
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gdiv(left.g, right.g))
 */
  __pyx_f_10cypari_src_3gen_set_mark();

  /* "cypari_src/gen.pyx":544
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gdiv(left.g, right.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":545
 *         set_mark()
 *         sig_on()
 *         return P.new_gen(gdiv(left.g, right.g))             # <<<<<<<<<<<<<<
 * 
 *     def __div__(self, other):  # Pyth0n 2
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gdiv(__pyx_v_left->g, __pyx_v_right->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":539
 *         return P.new_gen(gmul(left.g, right.g))
 * 
 *     def __truediv__(self, other):  # Python 3             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cypari_src.gen.gen.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_left);
  __Pyx_XDECREF((PyObject *)__pyx_v_right);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":547
 *         return P.new_gen(gdiv(left.g, right.g))
 * 
 *     def __div__(self, other):  # Pyth0n 2             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_23__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_23__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_22__div__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

#if PY_MAJOR_VERSION < 3
static PyObject *__pyx_pf_10cypari_src_3gen_3gen_22__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_left = 0;
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_right = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__div__", 0);

  /* "cypari_src/gen.pyx":549
 *     def __div__(self, other):  # Pyth0n 2
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)             # <<<<<<<<<<<<<<
 *         right = other if isinstance(other, gen) else P(other)
 *         sig_on()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_self, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_self);
    __pyx_t_1 = __pyx_v_self;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __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 = NULL;
      __Pyx_INCREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_left = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":550
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         set_mark()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_other);
    __pyx_t_1 = __pyx_v_other;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_right = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":551
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         set_mark()
 *         return P.new_gen(gdiv(left.g, right.g))
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":552
 *         right = other if isinstance(other, gen) else P(other)
 *         sig_on()
 *         set_mark()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gdiv(left.g, right.g))
 *         #return P.new_gen(gdiv(left.g, right.g))
 */
  __pyx_f_10cypari_src_3gen_set_mark();

  /* "cypari_src/gen.pyx":553
 *         sig_on()
 *         set_mark()
 *         return P.new_gen(gdiv(left.g, right.g))             # <<<<<<<<<<<<<<
 *         #return P.new_gen(gdiv(left.g, right.g))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gdiv(__pyx_v_left->g, __pyx_v_right->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":547
 *         return P.new_gen(gdiv(left.g, right.g))
 * 
 *     def __div__(self, other):  # Pyth0n 2             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cypari_src.gen.gen.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_left);
  __Pyx_XDECREF((PyObject *)__pyx_v_right);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

/* "cypari_src/gen.pyx":556
 *         #return P.new_gen(gdiv(left.g, right.g))
 * 
 *     def _add_one(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return self + 1.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_25_add_one(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_24_add_one[] = "\n        Return self + 1.\n        \n        OUTPUT: pari gen\n        \n        EXAMPLES::\n        \n            >>> n = pari(5)\n            >>> n._add_one()\n            6\n            >>> n = pari('x^3')\n            >>> n._add_one()\n            x^3 + 1\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_25_add_one(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_add_one (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_24_add_one(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_24_add_one(struct __pyx_obj_10cypari_src_3gen_gen *__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("_add_one", 0);

  /* "cypari_src/gen.pyx":571
 *             x^3 + 1
 *         """
 *         set_mark()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gaddsg(1, self.g))
 */
  __pyx_f_10cypari_src_3gen_set_mark();

  /* "cypari_src/gen.pyx":572
 *         """
 *         set_mark()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gaddsg(1, self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":573
 *         set_mark()
 *         sig_on()
 *         return P.new_gen(gaddsg(1, self.g))             # <<<<<<<<<<<<<<
 * 
 *     def __mod__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gaddsg(1, __pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":556
 *         #return P.new_gen(gdiv(left.g, right.g))
 * 
 *     def _add_one(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return self + 1.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen._add_one", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":575
 *         return P.new_gen(gaddsg(1, self.g))
 * 
 *     def __mod__(self, other):             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_27__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_27__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mod__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_26__mod__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_26__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_left = 0;
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_right = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__mod__", 0);

  /* "cypari_src/gen.pyx":577
 *     def __mod__(self, other):
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)             # <<<<<<<<<<<<<<
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_self, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_self);
    __pyx_t_1 = __pyx_v_self;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __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 = NULL;
      __Pyx_INCREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_left = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":578
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_other);
    __pyx_t_1 = __pyx_v_other;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_right = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":579
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gmod(left.g, right.g))
 */
  __pyx_f_10cypari_src_3gen_set_mark();

  /* "cypari_src/gen.pyx":580
 *         right = other if isinstance(other, gen) else P(other)
 *         set_mark()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gmod(left.g, right.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":581
 *         set_mark()
 *         sig_on()
 *         return P.new_gen(gmod(left.g, right.g))             # <<<<<<<<<<<<<<
 * 
 *     def __pow__(self, n, m):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gmod(__pyx_v_left->g, __pyx_v_right->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":575
 *         return P.new_gen(gaddsg(1, self.g))
 * 
 *     def __mod__(self, other):             # <<<<<<<<<<<<<<
 *         cdef gen left, right
 *         left = self if isinstance(self, gen) else P(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cypari_src.gen.gen.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_left);
  __Pyx_XDECREF((PyObject *)__pyx_v_right);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":583
 *         return P.new_gen(gmod(left.g, right.g))
 * 
 *     def __pow__(self, n, m):             # <<<<<<<<<<<<<<
 *         t0GEN(self)
 *         t1GEN(n)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_29__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_m); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_29__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_m) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pow__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_28__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_n), ((PyObject *)__pyx_v_m));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_28__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *__pyx_v_m) {
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_ans = NULL;
  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("__pow__", 0);

  /* "cypari_src/gen.pyx":584
 * 
 *     def __pow__(self, n, m):
 *         t0GEN(self)             # <<<<<<<<<<<<<<
 *         t1GEN(n)
 *         # Note: the prec parameter here has no effect when t0,t1 are
 */
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_self); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":585
 *     def __pow__(self, n, m):
 *         t0GEN(self)
 *         t1GEN(n)             # <<<<<<<<<<<<<<
 *         # Note: the prec parameter here has no effect when t0,t1 are
 *         # real; the precision of the result is the minimum of the
 */
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":590
 *         # precisions of t0 and t1.  In any case the 3rd parameter to
 *         # gpow should be a word-precision, not a decimal precision.
 *         sig_on()             # <<<<<<<<<<<<<<
 *         ans = P.new_gen(gpow(t0, t1, prec))
 *         return ans
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":591
 *         # gpow should be a word-precision, not a decimal precision.
 *         sig_on()
 *         ans = P.new_gen(gpow(t0, t1, prec))             # <<<<<<<<<<<<<<
 *         return ans
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gpow(__pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ans = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":592
 *         sig_on()
 *         ans = P.new_gen(gpow(t0, t1, prec))
 *         return ans             # <<<<<<<<<<<<<<
 * 
 *     def __neg__(gen self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ans));
  __pyx_r = ((PyObject *)__pyx_v_ans);
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":583
 *         return P.new_gen(gmod(left.g, right.g))
 * 
 *     def __pow__(self, n, m):             # <<<<<<<<<<<<<<
 *         t0GEN(self)
 *         t1GEN(n)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ans);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":594
 *         return ans
 * 
 *     def __neg__(gen self):             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_31__neg__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_31__neg__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_30__neg__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_30__neg__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__neg__", 0);

  /* "cypari_src/gen.pyx":595
 * 
 *     def __neg__(gen self):
 *         set_mark()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gneg(self.g))
 */
  __pyx_f_10cypari_src_3gen_set_mark();

  /* "cypari_src/gen.pyx":596
 *     def __neg__(gen self):
 *         set_mark()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gneg(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":597
 *         set_mark()
 *         sig_on()
 *         return P.new_gen(gneg(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def __xor__(gen self, n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gneg(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":594
 *         return ans
 * 
 *     def __neg__(gen self):             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":599
 *         return P.new_gen(gneg(self.g))
 * 
 *     def __xor__(gen self, n):             # <<<<<<<<<<<<<<
 *         raise RuntimeError, "Use ** for exponentiation, not '^', which means xor\n"+\
 *               "in Python, and has the wrong precedence."
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_33__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_n); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_33__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__xor__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_10cypari_src_3gen_gen, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_32__xor__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_n));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_32__xor__(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__xor__", 0);

  /* "cypari_src/gen.pyx":600
 * 
 *     def __xor__(gen self, n):
 *         raise RuntimeError, "Use ** for exponentiation, not '^', which means xor\n"+\             # <<<<<<<<<<<<<<
 *               "in Python, and has the wrong precedence."
 * 
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Use_for_exponentiation_not_which, __pyx_kp_s_in_Python_and_has_the_wrong_prec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_builtin_RuntimeError, __pyx_t_1, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cypari_src/gen.pyx":599
 *         return P.new_gen(gneg(self.g))
 * 
 *     def __xor__(gen self, n):             # <<<<<<<<<<<<<<
 *         raise RuntimeError, "Use ** for exponentiation, not '^', which means xor\n"+\
 *               "in Python, and has the wrong precedence."
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":603
 *               "in Python, and has the wrong precedence."
 * 
 *     def __rshift__(gen self, long n):             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_35__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_35__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
  long __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__rshift__ (wrapper)", 0);
  assert(__pyx_arg_n); {
    __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.__rshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_10cypari_src_3gen_gen, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_34__rshift__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((long)__pyx_v_n));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_34__rshift__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__rshift__", 0);

  /* "cypari_src/gen.pyx":604
 * 
 *     def __rshift__(gen self, long n):
 *         set_mark()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gshift(self.g, -n))
 */
  __pyx_f_10cypari_src_3gen_set_mark();

  /* "cypari_src/gen.pyx":605
 *     def __rshift__(gen self, long n):
 *         set_mark()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gshift(self.g, -n))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":606
 *         set_mark()
 *         sig_on()
 *         return P.new_gen(gshift(self.g, -n))             # <<<<<<<<<<<<<<
 * 
 *     def __lshift__(gen self, long n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gshift(__pyx_v_self->g, (-__pyx_v_n)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":603
 *               "in Python, and has the wrong precedence."
 * 
 *     def __rshift__(gen self, long n):             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.__rshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":608
 *         return P.new_gen(gshift(self.g, -n))
 * 
 *     def __lshift__(gen self, long n):             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_37__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_37__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
  long __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__lshift__ (wrapper)", 0);
  assert(__pyx_arg_n); {
    __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.__lshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_10cypari_src_3gen_gen, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_36__lshift__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((long)__pyx_v_n));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_36__lshift__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__lshift__", 0);

  /* "cypari_src/gen.pyx":609
 * 
 *     def __lshift__(gen self, long n):
 *         set_mark()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gshift(self.g, n))
 */
  __pyx_f_10cypari_src_3gen_set_mark();

  /* "cypari_src/gen.pyx":610
 *     def __lshift__(gen self, long n):
 *         set_mark()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gshift(self.g, n))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":611
 *         set_mark()
 *         sig_on()
 *         return P.new_gen(gshift(self.g, n))             # <<<<<<<<<<<<<<
 * 
 *     def __invert__(gen self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gshift(__pyx_v_self->g, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":608
 *         return P.new_gen(gshift(self.g, -n))
 * 
 *     def __lshift__(gen self, long n):             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.__lshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":613
 *         return P.new_gen(gshift(self.g, n))
 * 
 *     def __invert__(gen self):             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_39__invert__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_39__invert__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__invert__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_38__invert__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_38__invert__(struct __pyx_obj_10cypari_src_3gen_gen *__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("__invert__", 0);

  /* "cypari_src/gen.pyx":614
 * 
 *     def __invert__(gen self):
 *         set_mark()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(ginv(self.g))
 */
  __pyx_f_10cypari_src_3gen_set_mark();

  /* "cypari_src/gen.pyx":615
 *     def __invert__(gen self):
 *         set_mark()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(ginv(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":616
 *         set_mark()
 *         sig_on()
 *         return P.new_gen(ginv(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def getattr(self, attr):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, ginv(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":613
 *         return P.new_gen(gshift(self.g, n))
 * 
 *     def __invert__(gen self):             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":618
 *         return P.new_gen(ginv(self.g))
 * 
 *     def getattr(self, attr):             # <<<<<<<<<<<<<<
 *         t0GEN(str(self) + '.' + str(attr))
 *         sig_on()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_41getattr(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_41getattr(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getattr (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_40getattr(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_attr));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_40getattr(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_attr) {
  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("getattr", 0);

  /* "cypari_src/gen.pyx":619
 * 
 *     def getattr(self, attr):
 *         t0GEN(str(self) + '.' + str(attr))             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(t0)
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_attr);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_attr);
  __Pyx_GIVEREF(__pyx_v_attr);
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __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_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cypari_src/gen.pyx":620
 *     def getattr(self, attr):
 *         t0GEN(str(self) + '.' + str(attr))
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(t0)
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":621
 *         t0GEN(str(self) + '.' + str(attr))
 *         sig_on()
 *         return self.new_gen(t0)             # <<<<<<<<<<<<<<
 * 
 *     def mod(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, __pyx_v_10cypari_src_3gen_t0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":618
 *         return P.new_gen(ginv(self.g))
 * 
 *     def getattr(self, attr):             # <<<<<<<<<<<<<<
 *         t0GEN(str(self) + '.' + str(attr))
 *         sig_on()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cypari_src.gen.gen.getattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":623
 *         return self.new_gen(t0)
 * 
 *     def mod(self):             # <<<<<<<<<<<<<<
 *         """
 *         Given an INTMOD or POLMOD ``Mod(a,m)``, return the modulus `m`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_43mod(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_42mod[] = "\n        Given an INTMOD or POLMOD ``Mod(a,m)``, return the modulus `m`.\n\n        EXAMPLES::\n\n            >>> pari(4).Mod(5).mod()\n            5\n            >>> pari(\"Mod(x, x*y)\").mod()\n            y*x\n            >>> pari(\"[Mod(4,5)]\").mod()\n            Traceback (most recent call last):\n            ...\n            TypeError: Not an INTMOD or POLMOD in mod()\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_43mod(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mod (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_42mod(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

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

  /* "cypari_src/gen.pyx":638
 *             TypeError: Not an INTMOD or POLMOD in mod()
 *         """
 *         if typ(self.g) != t_INTMOD and typ(self.g) != t_POLMOD:             # <<<<<<<<<<<<<<
 *             raise TypeError("Not an INTMOD or POLMOD in mod()")
 *         # The hardcoded 1 below refers to the position in the internal
 */
  __pyx_t_2 = ((typ(__pyx_v_self->g) != t_INTMOD) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((typ(__pyx_v_self->g) != t_POLMOD) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":639
 *         """
 *         if typ(self.g) != t_INTMOD and typ(self.g) != t_POLMOD:
 *             raise TypeError("Not an INTMOD or POLMOD in mod()")             # <<<<<<<<<<<<<<
 *         # The hardcoded 1 below refers to the position in the internal
 *         # representation of a INTMOD or POLDMOD where the modulus is
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __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 = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cypari_src/gen.pyx":643
 *         # representation of a INTMOD or POLDMOD where the modulus is
 *         # stored.
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(gel(self.g, 1))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":644
 *         # stored.
 *         sig_on()
 *         return self.new_gen(gel(self.g, 1))             # <<<<<<<<<<<<<<
 * 
 *     cdef GEN get_nf(self) except NULL:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, gel(__pyx_v_self->g, 1))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":623
 *         return self.new_gen(t0)
 * 
 *     def mod(self):             # <<<<<<<<<<<<<<
 *         """
 *         Given an INTMOD or POLMOD ``Mod(a,m)``, return the modulus `m`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cypari_src.gen.gen.mod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":646
 *         return self.new_gen(gel(self.g, 1))
 * 
 *     cdef GEN get_nf(self) except NULL:             # <<<<<<<<<<<<<<
 *         """
 *         Given a PARI object `self`, convert it to a proper PARI number
 */

static GEN __pyx_f_10cypari_src_3gen_3gen_get_nf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  GEN __pyx_v_nf;
  long __pyx_v_nftyp;
  GEN __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_nf", 0);

  /* "cypari_src/gen.pyx":684
 *         cdef GEN nf
 *         cdef long nftyp
 *         sig_on()             # <<<<<<<<<<<<<<
 *         nf = get_nf(self.g, &nftyp)
 *         sig_off()
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":685
 *         cdef long nftyp
 *         sig_on()
 *         nf = get_nf(self.g, &nftyp)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         if not nf:
 */
  __pyx_v_nf = get_nf(__pyx_v_self->g, (&__pyx_v_nftyp));

  /* "cypari_src/gen.pyx":686
 *         sig_on()
 *         nf = get_nf(self.g, &nftyp)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         if not nf:
 *             raise TypeError("Not a PARI number field")
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":687
 *         nf = get_nf(self.g, &nftyp)
 *         sig_off()
 *         if not nf:             # <<<<<<<<<<<<<<
 *             raise TypeError("Not a PARI number field")
 *         return nf
 */
  __pyx_t_1 = ((!(__pyx_v_nf != 0)) != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":688
 *         sig_off()
 *         if not nf:
 *             raise TypeError("Not a PARI number field")             # <<<<<<<<<<<<<<
 *         return nf
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __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 = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cypari_src/gen.pyx":689
 *         if not nf:
 *             raise TypeError("Not a PARI number field")
 *         return nf             # <<<<<<<<<<<<<<
 * 
 *     def nf_get_pol(self):
 */
  __pyx_r = __pyx_v_nf;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":646
 *         return self.new_gen(gel(self.g, 1))
 * 
 *     cdef GEN get_nf(self) except NULL:             # <<<<<<<<<<<<<<
 *         """
 *         Given a PARI object `self`, convert it to a proper PARI number
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.gen.get_nf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":691
 *         return nf
 * 
 *     def nf_get_pol(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the defining polynomial of this number field.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_45nf_get_pol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_44nf_get_pol[] = "\n        Returns the defining polynomial of this number field.\n\n        INPUT:\n\n        - ``self`` -- A PARI number field being the output of ``nfinit()``,\n                      ``bnfinit()`` or ``bnrinit()``.\n\n        EXAMPLES::\n            \n            >>> K = pari('y^4 - 4*y^2 + 1').nfinit()\n            >>> K.nf_get_pol()\n            y^4 - 4*y^2 + 1\n            >>> bnr = pari('K = bnfinit(y^4 - 4*y^2 + 1); bnrinit(K, 2*y)')\n            >>> bnr.nf_get_pol()\n            y^4 - 4*y^2 + 1\n\n        For relative extensions, we can only get the absolute polynomial,\n        not the relative one::\n\n            >>> K.rnfequation(pari('x^2 - 5'))   # Absolute polynomial\n            x^8 - 28*x^6 + 208*x^4 - 408*x^2 + 36\n            >>> L = K.rnfinit(pari('x^2 - 5'))\n            >>> L.nf_get_pol()\n            Traceback (most recent call last):\n            ...\n            TypeError: Not a PARI number field\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_45nf_get_pol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nf_get_pol (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_44nf_get_pol(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_44nf_get_pol(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  GEN __pyx_v_nf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GEN __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nf_get_pol", 0);

  /* "cypari_src/gen.pyx":720
 *             TypeError: Not a PARI number field
 *         """
 *         cdef GEN nf = self.get_nf()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(nf_get_pol(nf))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_nf(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nf = __pyx_t_1;

  /* "cypari_src/gen.pyx":721
 *         """
 *         cdef GEN nf = self.get_nf()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(nf_get_pol(nf))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":722
 *         cdef GEN nf = self.get_nf()
 *         sig_on()
 *         return self.new_gen(nf_get_pol(nf))             # <<<<<<<<<<<<<<
 * 
 *     def nf_get_diff(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, nf_get_pol(__pyx_v_nf))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":691
 *         return nf
 * 
 *     def nf_get_pol(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the defining polynomial of this number field.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.gen.nf_get_pol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":724
 *         return self.new_gen(nf_get_pol(nf))
 * 
 *     def nf_get_diff(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the different of this number field as a PARI ideal.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_47nf_get_diff(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_46nf_get_diff[] = "\n        Returns the different of this number field as a PARI ideal.\n        \n        INPUT:\n\n        - ``self`` -- A PARI number field being the output of ``nfinit()``,\n                      ``bnfinit()`` or ``bnrinit()``.\n\n        EXAMPLES::\n            \n            >>> K = pari('x^4 - 4*x^2 + 1').nfinit()\n            >>> K.nf_get_diff()\n            [12, 0, 0, 0; 0, 12, 8, 0; 0, 0, 4, 0; 0, 0, 0, 4]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_47nf_get_diff(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nf_get_diff (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_46nf_get_diff(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_46nf_get_diff(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  GEN __pyx_v_nf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GEN __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nf_get_diff", 0);

  /* "cypari_src/gen.pyx":739
 *             [12, 0, 0, 0; 0, 12, 8, 0; 0, 0, 4, 0; 0, 0, 0, 4]
 *         """
 *         cdef GEN nf = self.get_nf()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         # Very bad code, but there doesn't seem to be a better way
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_nf(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nf = __pyx_t_1;

  /* "cypari_src/gen.pyx":740
 *         """
 *         cdef GEN nf = self.get_nf()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # Very bad code, but there doesn't seem to be a better way
 *         return self.new_gen(gel(gel(nf, 5), 5))
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":742
 *         sig_on()
 *         # Very bad code, but there doesn't seem to be a better way
 *         return self.new_gen(gel(gel(nf, 5), 5))             # <<<<<<<<<<<<<<
 * 
 *     def nf_get_sign(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, gel(gel(__pyx_v_nf, 5), 5))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":724
 *         return self.new_gen(nf_get_pol(nf))
 * 
 *     def nf_get_diff(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the different of this number field as a PARI ideal.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.gen.nf_get_diff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":744
 *         return self.new_gen(gel(gel(nf, 5), 5))
 * 
 *     def nf_get_sign(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Python list ``[r1, r2]``, where ``r1`` and ``r2`` are
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_49nf_get_sign(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_48nf_get_sign[] = "\n        Returns a Python list ``[r1, r2]``, where ``r1`` and ``r2`` are\n        Python ints representing the number of real embeddings and pairs\n        of complex embeddings of this number field, respectively.\n        \n        INPUT:\n\n        - ``self`` -- A PARI number field being the output of ``nfinit()``,\n                      ``bnfinit()`` or ``bnrinit()``.\n\n        EXAMPLES::\n            \n            >>> K = pari('x^4 - 4*x^2 + 1').nfinit()\n            >>> s = K.nf_get_sign(); s\n            [4, 0]\n            >>> isinstance(s, list); isinstance(s[0], int)\n            True\n            True\n            >>> pari.polcyclo(15).nfinit().nf_get_sign()\n            [0, 4]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_49nf_get_sign(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nf_get_sign (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_48nf_get_sign(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_48nf_get_sign(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  long __pyx_v_r1;
  long __pyx_v_r2;
  GEN __pyx_v_nf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GEN __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nf_get_sign", 0);

  /* "cypari_src/gen.pyx":768
 *         cdef long r1
 *         cdef long r2
 *         cdef GEN nf = self.get_nf()             # <<<<<<<<<<<<<<
 *         nf_get_sign(nf, &r1, &r2)
 *         return [r1, r2]
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_nf(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nf = __pyx_t_1;

  /* "cypari_src/gen.pyx":769
 *         cdef long r2
 *         cdef GEN nf = self.get_nf()
 *         nf_get_sign(nf, &r1, &r2)             # <<<<<<<<<<<<<<
 *         return [r1, r2]
 * 
 */
  nf_get_sign(__pyx_v_nf, (&__pyx_v_r1), (&__pyx_v_r2));

  /* "cypari_src/gen.pyx":770
 *         cdef GEN nf = self.get_nf()
 *         nf_get_sign(nf, &r1, &r2)
 *         return [r1, r2]             # <<<<<<<<<<<<<<
 * 
 *     def nf_get_zk(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_r1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_r2); 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_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":744
 *         return self.new_gen(gel(gel(nf, 5), 5))
 * 
 *     def nf_get_sign(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a Python list ``[r1, r2]``, where ``r1`` and ``r2`` are
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cypari_src.gen.gen.nf_get_sign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":772
 *         return [r1, r2]
 * 
 *     def nf_get_zk(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a vector with a `\ZZ`-basis for the ring of integers of
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_51nf_get_zk(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_50nf_get_zk[] = "\n        Returns a vector with a `\\ZZ`-basis for the ring of integers of\n        this number field. The first element is always `1`.\n        \n        INPUT:\n\n        - ``self`` -- A PARI number field being the output of ``nfinit()``,\n                      ``bnfinit()`` or ``bnrinit()``.\n\n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^4 - 4*x^2 + 1)')\n            >>> K.nf_get_zk()\n            [1, x, x^3 - 4*x, x^2 - 2]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_51nf_get_zk(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nf_get_zk (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_50nf_get_zk(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_50nf_get_zk(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  GEN __pyx_v_nf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GEN __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nf_get_zk", 0);

  /* "cypari_src/gen.pyx":788
 *             [1, x, x^3 - 4*x, x^2 - 2]
 *         """
 *         cdef GEN nf = self.get_nf()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(nf_get_zk(nf))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_nf(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nf = __pyx_t_1;

  /* "cypari_src/gen.pyx":789
 *         """
 *         cdef GEN nf = self.get_nf()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(nf_get_zk(nf))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":790
 *         cdef GEN nf = self.get_nf()
 *         sig_on()
 *         return self.new_gen(nf_get_zk(nf))             # <<<<<<<<<<<<<<
 * 
 *     def bnf_get_no(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, nf_get_zk(__pyx_v_nf))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":772
 *         return [r1, r2]
 * 
 *     def nf_get_zk(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a vector with a `\ZZ`-basis for the ring of integers of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.gen.nf_get_zk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":792
 *         return self.new_gen(nf_get_zk(nf))
 * 
 *     def bnf_get_no(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the class number of ``self``, a "big number field" (``bnf``).
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_53bnf_get_no(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_52bnf_get_no[] = "\n        Returns the class number of ``self``, a \"big number field\" (``bnf``).\n        \n        EXAMPLES::\n            \n            >>> K = pari('bnfinit(x^2+65)')\n            >>> K.bnf_get_no()\n            8\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_53bnf_get_no(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bnf_get_no (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_52bnf_get_no(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_52bnf_get_no(struct __pyx_obj_10cypari_src_3gen_gen *__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("bnf_get_no", 0);

  /* "cypari_src/gen.pyx":802
 *             8
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bnf_get_no(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":803
 *         """
 *         sig_on()
 *         return self.new_gen(bnf_get_no(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def bnf_get_cyc(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bnf_get_no(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":792
 *         return self.new_gen(nf_get_zk(nf))
 * 
 *     def bnf_get_no(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the class number of ``self``, a "big number field" (``bnf``).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.bnf_get_no", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":805
 *         return self.new_gen(bnf_get_no(self.g))
 * 
 *     def bnf_get_cyc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the structure of the class group of this number field as
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_55bnf_get_cyc(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_54bnf_get_cyc[] = "\n        Returns the structure of the class group of this number field as\n        a vector of SNF invariants.\n        \n        NOTE: ``self`` must be a \"big number field\" (``bnf``).\n        \n        EXAMPLES::\n            \n            >>> K = pari('bnfinit(x^2+65)')\n            >>> K.bnf_get_cyc()\n            [4, 2]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_55bnf_get_cyc(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bnf_get_cyc (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_54bnf_get_cyc(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_54bnf_get_cyc(struct __pyx_obj_10cypari_src_3gen_gen *__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("bnf_get_cyc", 0);

  /* "cypari_src/gen.pyx":818
 *             [4, 2]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bnf_get_cyc(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":819
 *         """
 *         sig_on()
 *         return self.new_gen(bnf_get_cyc(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def bnf_get_gen(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bnf_get_cyc(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":805
 *         return self.new_gen(bnf_get_no(self.g))
 * 
 *     def bnf_get_cyc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the structure of the class group of this number field as
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.bnf_get_cyc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":821
 *         return self.new_gen(bnf_get_cyc(self.g))
 * 
 *     def bnf_get_gen(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a vector of generators of the class group of this
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_57bnf_get_gen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_56bnf_get_gen[] = "\n        Returns a vector of generators of the class group of this\n        number field.\n        \n        NOTE: ``self`` must be a \"big number field\" (``bnf``).\n        \n        EXAMPLES::\n            \n            >>> K = pari('bnfinit(x^2+65)')\n            >>> G = K.bnf_get_gen(); G\n            [[3, 2; 0, 1], [2, 1; 0, 1]]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_57bnf_get_gen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bnf_get_gen (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_56bnf_get_gen(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_56bnf_get_gen(struct __pyx_obj_10cypari_src_3gen_gen *__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("bnf_get_gen", 0);

  /* "cypari_src/gen.pyx":834
 *             [[3, 2; 0, 1], [2, 1; 0, 1]]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bnf_get_gen(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":835
 *         """
 *         sig_on()
 *         return self.new_gen(bnf_get_gen(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def bnf_get_reg(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bnf_get_gen(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":821
 *         return self.new_gen(bnf_get_cyc(self.g))
 * 
 *     def bnf_get_gen(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a vector of generators of the class group of this
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.bnf_get_gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":837
 *         return self.new_gen(bnf_get_gen(self.g))
 * 
 *     def bnf_get_reg(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the regulator of this number field.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_59bnf_get_reg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_58bnf_get_reg[] = "\n        Returns the regulator of this number field.\n        \n        NOTE: ``self`` must be a \"big number field\" (``bnf``).\n        \n        EXAMPLES::\n            \n            >>> K = pari('bnfinit(x^4 - 4*x^2 + 1)')\n            >>> K.bnf_get_reg()\n            2.66089858019037...\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_59bnf_get_reg(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bnf_get_reg (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_58bnf_get_reg(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_58bnf_get_reg(struct __pyx_obj_10cypari_src_3gen_gen *__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("bnf_get_reg", 0);

  /* "cypari_src/gen.pyx":849
 *             2.66089858019037...
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bnf_get_reg(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":850
 *         """
 *         sig_on()
 *         return self.new_gen(bnf_get_reg(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def pr_get_p(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bnf_get_reg(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":837
 *         return self.new_gen(bnf_get_gen(self.g))
 * 
 *     def bnf_get_reg(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the regulator of this number field.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.bnf_get_reg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":852
 *         return self.new_gen(bnf_get_reg(self.g))
 * 
 *     def pr_get_p(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the prime of `\ZZ` lying below this prime ideal.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_61pr_get_p(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_60pr_get_p[] = "\n        Returns the prime of `\\ZZ` lying below this prime ideal.\n        \n        NOTE: ``self`` must be a PARI prime ideal (as returned by\n        ``idealfactor`` for example).\n        \n        EXAMPLES::\n            XXX\n            >>> K = pari('nfinit(x^2+1)')\n            >>> F = K.idealfactor(5); F\n            [[5, [-2, 1]~, 1, 1, [2, 1]~], 1; [5, [2, 1]~, 1, 1, [-2, 1]~], 1]\n            >>> F[0,0].pr_get_p()\n            5\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_61pr_get_p(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pr_get_p (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_60pr_get_p(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_60pr_get_p(struct __pyx_obj_10cypari_src_3gen_gen *__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("pr_get_p", 0);

  /* "cypari_src/gen.pyx":867
 *             5
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(pr_get_p(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":868
 *         """
 *         sig_on()
 *         return self.new_gen(pr_get_p(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def pr_get_e(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, pr_get_p(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":852
 *         return self.new_gen(bnf_get_reg(self.g))
 * 
 *     def pr_get_p(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the prime of `\ZZ` lying below this prime ideal.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.pr_get_p", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":870
 *         return self.new_gen(pr_get_p(self.g))
 * 
 *     def pr_get_e(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the ramification index (over `\QQ`) of this prime ideal.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_63pr_get_e(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_62pr_get_e[] = "\n        Returns the ramification index (over `\\QQ`) of this prime ideal.\n        \n        NOTE: ``self`` must be a PARI prime ideal (as returned by\n        ``idealfactor`` for example).\n        \n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^2+1)')\n            >>> K.idealfactor(2)[0,0].pr_get_e()\n            2\n            >>> K.idealfactor(3)[0,0].pr_get_e()\n            1\n            >>> K.idealfactor(5)[0,0].pr_get_e()\n            1\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_63pr_get_e(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pr_get_e (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_62pr_get_e(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_62pr_get_e(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  long __pyx_v_e;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pr_get_e", 0);

  /* "cypari_src/gen.pyx":888
 *         """
 *         cdef long e
 *         sig_on()             # <<<<<<<<<<<<<<
 *         e = pr_get_e(self.g)
 *         sig_off()
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":889
 *         cdef long e
 *         sig_on()
 *         e = pr_get_e(self.g)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return e
 */
  __pyx_v_e = pr_get_e(__pyx_v_self->g);

  /* "cypari_src/gen.pyx":890
 *         sig_on()
 *         e = pr_get_e(self.g)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return e
 * 
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":891
 *         e = pr_get_e(self.g)
 *         sig_off()
 *         return e             # <<<<<<<<<<<<<<
 * 
 *     def pr_get_f(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":870
 *         return self.new_gen(pr_get_p(self.g))
 * 
 *     def pr_get_e(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the ramification index (over `\QQ`) of this prime ideal.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.pr_get_e", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":893
 *         return e
 * 
 *     def pr_get_f(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the residue class degree (over `\QQ`) of this prime ideal.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_65pr_get_f(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_64pr_get_f[] = "\n        Returns the residue class degree (over `\\QQ`) of this prime ideal.\n        \n        NOTE: ``self`` must be a PARI prime ideal (as returned by\n        ``idealfactor`` for example).\n        \n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^2+1)')\n            >>> K.idealfactor(2)[0,0].pr_get_f()\n            1\n            >>> K.idealfactor(3)[0,0].pr_get_f()\n            2\n            >>> K.idealfactor(5)[0,0].pr_get_f()\n            1\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_65pr_get_f(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pr_get_f (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_64pr_get_f(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_64pr_get_f(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  long __pyx_v_f;
  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("pr_get_f", 0);

  /* "cypari_src/gen.pyx":911
 *         """
 *         cdef long f
 *         sig_on()             # <<<<<<<<<<<<<<
 *         f = pr_get_f(self.g)
 *         sig_off()
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":912
 *         cdef long f
 *         sig_on()
 *         f = pr_get_f(self.g)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return f
 */
  __pyx_v_f = pr_get_f(__pyx_v_self->g);

  /* "cypari_src/gen.pyx":913
 *         sig_on()
 *         f = pr_get_f(self.g)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return f
 * 
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":914
 *         f = pr_get_f(self.g)
 *         sig_off()
 *         return f             # <<<<<<<<<<<<<<
 * 
 *     def pr_get_gen(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":893
 *         return e
 * 
 *     def pr_get_f(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the residue class degree (over `\QQ`) of this prime ideal.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.pr_get_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":916
 *         return f
 * 
 *     def pr_get_gen(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the second generator of this PARI prime ideal, where the
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_67pr_get_gen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_66pr_get_gen[] = "\n        Returns the second generator of this PARI prime ideal, where the\n        first generator is ``self.pr_get_p()``.\n        \n        NOTE: ``self`` must be a PARI prime ideal (as returned by\n        ``idealfactor`` for example).\n        \n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^2+1)')\n            >>> g = K.idealfactor(2)[0,0].pr_get_gen(); g\n            [1, 1]~\n            >>> g = K.idealfactor(3)[0,0].pr_get_gen(); g\n            [3, 0]~\n            >>> g = K.idealfactor(5)[0,0].pr_get_gen(); g\n            [-2, 1]~\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_67pr_get_gen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pr_get_gen (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_66pr_get_gen(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_66pr_get_gen(struct __pyx_obj_10cypari_src_3gen_gen *__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("pr_get_gen", 0);

  /* "cypari_src/gen.pyx":934
 *             [-2, 1]~
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(pr_get_gen(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":935
 *         """
 *         sig_on()
 *         return self.new_gen(pr_get_gen(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def bid_get_cyc(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, pr_get_gen(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":916
 *         return f
 * 
 *     def pr_get_gen(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the second generator of this PARI prime ideal, where the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.pr_get_gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":937
 *         return self.new_gen(pr_get_gen(self.g))
 * 
 *     def bid_get_cyc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the structure of the group `(O_K/I)^*`, where `I` is the
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_69bid_get_cyc(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_68bid_get_cyc[] = "\n        Returns the structure of the group `(O_K/I)^*`, where `I` is the\n        ideal represented by ``self``.\n        \n        NOTE: ``self`` must be a \"big ideal\" (``bid``) as returned by\n        ``idealstar`` for example.\n        \n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^2+1)')\n            >>> J = K.idealstar(pari('4*x+2'))\n            >>> J.bid_get_cyc()\n            [4, 2]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_69bid_get_cyc(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bid_get_cyc (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_68bid_get_cyc(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_68bid_get_cyc(struct __pyx_obj_10cypari_src_3gen_gen *__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("bid_get_cyc", 0);

  /* "cypari_src/gen.pyx":952
 *             [4, 2]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bid_get_cyc(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":953
 *         """
 *         sig_on()
 *         return self.new_gen(bid_get_cyc(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def bid_get_gen(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bid_get_cyc(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":937
 *         return self.new_gen(pr_get_gen(self.g))
 * 
 *     def bid_get_cyc(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the structure of the group `(O_K/I)^*`, where `I` is the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.bid_get_cyc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":955
 *         return self.new_gen(bid_get_cyc(self.g))
 * 
 *     def bid_get_gen(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a vector of generators of the group `(O_K/I)^*`, where
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_71bid_get_gen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_70bid_get_gen[] = "\n        Returns a vector of generators of the group `(O_K/I)^*`, where\n        `I` is the ideal represented by ``self``.\n        \n        NOTE: ``self`` must be a \"big ideal\" (``bid``) with generators,\n        as returned by ``idealstar`` with ``flag`` = 2.\n        \n        EXAMPLES::\n            \n            >>> K = pari('nfinit(x^2+1)')\n            >>> J = K.idealstar(pari('4*x + 2'), 2)\n            >>> J.bid_get_gen()\n            [7, [-2, -1]~]\n        \n        We get an exception if we do not supply ``flag = 2`` to\n        ``idealstar``::\n            \n            >>> J = K.idealstar(3)\n            >>> J.bid_get_gen()\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_71bid_get_gen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bid_get_gen (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_70bid_get_gen(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_70bid_get_gen(struct __pyx_obj_10cypari_src_3gen_gen *__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("bid_get_gen", 0);

  /* "cypari_src/gen.pyx":979
 *             PariError:  (5)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bid_get_gen(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":980
 *         """
 *         sig_on()
 *         return self.new_gen(bid_get_gen(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(gen self, n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bid_get_gen(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":955
 *         return self.new_gen(bid_get_cyc(self.g))
 * 
 *     def bid_get_gen(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a vector of generators of the group `(O_K/I)^*`, where
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.bid_get_gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":982
 *         return self.new_gen(bid_get_gen(self.g))
 * 
 *     def __getitem__(gen self, n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the nth entry of self. The indexing is 0-based, like in
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_73__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_n); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_72__getitem__[] = "\n        Return the nth entry of self. The indexing is 0-based, like in\n        Python. Note that this is *different* than the default behavior\n        of the PARI/GP interpreter.\n        \n        EXAMPLES::\n        \n            >>> p = pari('1 + 2*x + 3*x^2')\n            >>> p[0]\n            1\n            >>> p[2]\n            3\n            >>> p[100]\n            0\n            >>> p[-1]\n            0\n            >>> q = pari('x^2 + 3*x^3 + O(x^6)')\n            >>> q[3]\n            3\n            >>> q[5]\n            0\n            >>> q[6]\n            Traceback (most recent call last):\n            ...\n            IndexError: index out of bounds\n            >>> m = pari('[1,2;3,4]')\n            >>> m[0]\n            [1, 3]~\n            >>> m[1,0]\n            3\n            >>> l = pari('List([1,2,3])')\n            >>> l[1]\n            2\n            >>> s = pari('\"hello, world!\"')\n            >>> s[0]\n            'h'\n            >>> s[4]\n            'o'\n            >>> s[12]\n            '!'\n            >>> s[13]\n            Traceback (most recent call last):\n            ...\n            IndexError: index out of bounds\n            >>> v = pari('[1,2,3]')\n            >>> v[0]\n            1\n            >>> c = pari('Col([1,2,3])')\n            >>> c[1]\n            2\n            >>> sv = pari('Vecsmall([1,2,3])')\n            >>> sv[2]\n            3\n            >>> isinstance(sv[2], int)\n            True\n            >>> tuple(pari('3/5'))\n            (3, 5)\n            >>> tuple(pari('1 + 5*I'))\n            (1, 5)\n            >>> tuple(pari('Qfb(1, 2, 3)'))\n            (1, 2, 3)\n            >>> pari(57)[0]\n            Traceback (most recent call last):\n            ...\n            TypeError: unindexable object\n            >>> m = pari(\"[[1,2;3,4],5]\") ; m[0][1,0]\n            3\n            >>> v = pari(xrange(20))\n            >>> v[2:5]\n            [2, 3, 4]\n            >>> v[:]\n            [0, 1, 2, 3, 4, ""5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> v[10:]\n            [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> v[:5]\n            [0, 1, 2, 3, 4]\n            >>> v\n            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> v[-1]\n            Traceback (most recent call last):\n            ...\n            IndexError: index out of bounds\n            >>> v[:-3]\n            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]\n            >>> v[5:]\n            [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> pari([])[::]\n            []\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_10cypari_src_3gen_3gen_72__getitem__;
#endif
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_73__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_72__getitem__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_n));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_72__getitem__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_n) {
  int __pyx_v_pari_type;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_ind = NULL;
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_val = NULL;
  long __pyx_v_l;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_stop = NULL;
  PyObject *__pyx_v_step = NULL;
  PyObject *__pyx_v_inds = NULL;
  Py_ssize_t __pyx_v_k;
  PyObject *__pyx_v_v = NULL;
  long __pyx_v_bound;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  long __pyx_t_6;
  long __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cypari_src/gen.pyx":1073
 *         """
 *         cdef int pari_type
 *         pari_type = typ(self.g)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(n, tuple):
 */
  __pyx_v_pari_type = typ(__pyx_v_self->g);

  /* "cypari_src/gen.pyx":1075
 *         pari_type = typ(self.g)
 * 
 *         if isinstance(n, tuple):             # <<<<<<<<<<<<<<
 *             if pari_type != t_MAT:
 *                 raise TypeError, "self must be of PARI type t_MAT"
 */
  __pyx_t_1 = PyTuple_Check(__pyx_v_n); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cypari_src/gen.pyx":1076
 * 
 *         if isinstance(n, tuple):
 *             if pari_type != t_MAT:             # <<<<<<<<<<<<<<
 *                 raise TypeError, "self must be of PARI type t_MAT"
 *             if len(n) != 2:
 */
    __pyx_t_2 = ((__pyx_v_pari_type != t_MAT) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1077
 *         if isinstance(n, tuple):
 *             if pari_type != t_MAT:
 *                 raise TypeError, "self must be of PARI type t_MAT"             # <<<<<<<<<<<<<<
 *             if len(n) != 2:
 *                 raise IndexError, "index must be an integer or a 2-tuple (i,j)"
 */
      __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_must_be_of_PARI_type_t_MAT, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":1078
 *             if pari_type != t_MAT:
 *                 raise TypeError, "self must be of PARI type t_MAT"
 *             if len(n) != 2:             # <<<<<<<<<<<<<<
 *                 raise IndexError, "index must be an integer or a 2-tuple (i,j)"
 *             i = int(n[0])
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_n); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((__pyx_t_3 != 2) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1079
 *                 raise TypeError, "self must be of PARI type t_MAT"
 *             if len(n) != 2:
 *                 raise IndexError, "index must be an integer or a 2-tuple (i,j)"             # <<<<<<<<<<<<<<
 *             i = int(n[0])
 *             j = int(n[1])
 */
      __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_s_index_must_be_an_integer_or_a_2, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":1080
 *             if len(n) != 2:
 *                 raise IndexError, "index must be an integer or a 2-tuple (i,j)"
 *             i = int(n[0])             # <<<<<<<<<<<<<<
 *             j = int(n[1])
 * 
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_n, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_i = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cypari_src/gen.pyx":1081
 *                 raise IndexError, "index must be an integer or a 2-tuple (i,j)"
 *             i = int(n[0])
 *             j = int(n[1])             # <<<<<<<<<<<<<<
 * 
 *             if i < 0 or i >= glength(<GEN>(self.g[1])):
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_n, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_j = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cypari_src/gen.pyx":1083
 *             j = int(n[1])
 * 
 *             if i < 0 or i >= glength(<GEN>(self.g[1])):             # <<<<<<<<<<<<<<
 *                 raise IndexError, "row index out of bounds"
 *             if j < 0 or j >= glength(self.g):
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_i, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyInt_From_long(glength(((GEN)(__pyx_v_self->g[1])))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_i, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1084
 * 
 *             if i < 0 or i >= glength(<GEN>(self.g[1])):
 *                 raise IndexError, "row index out of bounds"             # <<<<<<<<<<<<<<
 *             if j < 0 or j >= glength(self.g):
 *                 raise IndexError, "column index out of bounds"
 */
      __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_s_row_index_out_of_bounds, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":1085
 *             if i < 0 or i >= glength(<GEN>(self.g[1])):
 *                 raise IndexError, "row index out of bounds"
 *             if j < 0 or j >= glength(self.g):             # <<<<<<<<<<<<<<
 *                 raise IndexError, "column index out of bounds"
 * 
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_j, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyInt_From_long(glength(__pyx_v_self->g)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_j, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1086
 *                 raise IndexError, "row index out of bounds"
 *             if j < 0 or j >= glength(self.g):
 *                 raise IndexError, "column index out of bounds"             # <<<<<<<<<<<<<<
 * 
 *             ind = (i,j)
 */
      __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_s_column_index_out_of_bounds, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":1088
 *                 raise IndexError, "column index out of bounds"
 * 
 *             ind = (i,j)             # <<<<<<<<<<<<<<
 * 
 *             if ind in self._refers_to:
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_i);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    __Pyx_INCREF(__pyx_v_j);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_j);
    __Pyx_GIVEREF(__pyx_v_j);
    __pyx_v_ind = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cypari_src/gen.pyx":1090
 *             ind = (i,j)
 * 
 *             if ind in self._refers_to:             # <<<<<<<<<<<<<<
 *                 return self._refers_to[ind]
 *             else:
 */
    __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_ind, __pyx_v_self->_refers_to, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":1091
 * 
 *             if ind in self._refers_to:
 *                 return self._refers_to[ind]             # <<<<<<<<<<<<<<
 *             else:
 *                 ## In this case, we're being asked to return
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = PyObject_GetItem(__pyx_v_self->_refers_to, __pyx_v_ind); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":1097
 *                 ## we need to create such a gen, add it to
 *                 ## self._refers_to, and return it.
 *                 val = P.new_ref(gmael(self.g, j+1, i+1), self)             # <<<<<<<<<<<<<<
 *                 self._refers_to[ind] = val
 *                 return val
 */
      __pyx_t_4 = PyNumber_Add(__pyx_v_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_4); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyInt_As_long(__pyx_t_4); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_ref(__pyx_v_10cypari_src_3gen_P, gmael(__pyx_v_self->g, __pyx_t_6, __pyx_t_7), __pyx_v_self)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_val = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cypari_src/gen.pyx":1098
 *                 ## self._refers_to, and return it.
 *                 val = P.new_ref(gmael(self.g, j+1, i+1), self)
 *                 self._refers_to[ind] = val             # <<<<<<<<<<<<<<
 *                 return val
 * 
 */
      if (unlikely(PyObject_SetItem(__pyx_v_self->_refers_to, __pyx_v_ind, ((PyObject *)__pyx_v_val)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "cypari_src/gen.pyx":1099
 *                 val = P.new_ref(gmael(self.g, j+1, i+1), self)
 *                 self._refers_to[ind] = val
 *                 return val             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(n, slice):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_val));
      __pyx_r = ((PyObject *)__pyx_v_val);
      goto __pyx_L0;
    }
  }

  /* "cypari_src/gen.pyx":1101
 *                 return val
 * 
 *         elif isinstance(n, slice):             # <<<<<<<<<<<<<<
 *             l = glength(self.g)
 *             start,stop,step = n.indices(l)
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_n); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cypari_src/gen.pyx":1102
 * 
 *         elif isinstance(n, slice):
 *             l = glength(self.g)             # <<<<<<<<<<<<<<
 *             start,stop,step = n.indices(l)
 *             inds = xrange(start,stop,step)
 */
    __pyx_v_l = glength(__pyx_v_self->g);

    /* "cypari_src/gen.pyx":1103
 *         elif isinstance(n, slice):
 *             l = glength(self.g)
 *             start,stop,step = n.indices(l)             # <<<<<<<<<<<<<<
 *             inds = xrange(start,stop,step)
 *             k = len(inds)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_indices); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_l); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_8);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      index = 2; __pyx_t_8 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L14_unpacking_done;
      __pyx_L13_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L14_unpacking_done:;
    }
    __pyx_v_start = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_stop = __pyx_t_10;
    __pyx_t_10 = 0;
    __pyx_v_step = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "cypari_src/gen.pyx":1104
 *             l = glength(self.g)
 *             start,stop,step = n.indices(l)
 *             inds = xrange(start,stop,step)             # <<<<<<<<<<<<<<
 *             k = len(inds)
 *             # fast exit
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_xrange); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = NULL;
    __pyx_t_3 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_3 = 1;
      }
    }
    __pyx_t_5 = PyTuple_New(3+__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_10) {
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
    }
    __Pyx_INCREF(__pyx_v_start);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_3, __pyx_v_start);
    __Pyx_GIVEREF(__pyx_v_start);
    __Pyx_INCREF(__pyx_v_stop);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_3, __pyx_v_stop);
    __Pyx_GIVEREF(__pyx_v_stop);
    __Pyx_INCREF(__pyx_v_step);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_3, __pyx_v_step);
    __Pyx_GIVEREF(__pyx_v_step);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_v_inds = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cypari_src/gen.pyx":1105
 *             start,stop,step = n.indices(l)
 *             inds = xrange(start,stop,step)
 *             k = len(inds)             # <<<<<<<<<<<<<<
 *             # fast exit
 *             if k==0:
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_inds); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_k = __pyx_t_3;

    /* "cypari_src/gen.pyx":1107
 *             k = len(inds)
 *             # fast exit
 *             if k==0:             # <<<<<<<<<<<<<<
 *                 return P.vector(0)
 *             # fast call, beware pari is one based
 */
    __pyx_t_2 = ((__pyx_v_k == 0) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1108
 *             # fast exit
 *             if k==0:
 *                 return P.vector(0)             # <<<<<<<<<<<<<<
 *             # fast call, beware pari is one based
 *             if pari_type == t_VEC:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_10cypari_src_3gen_P), __pyx_n_s_vector); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_8;
      __pyx_t_8 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":1110
 *                 return P.vector(0)
 *             # fast call, beware pari is one based
 *             if pari_type == t_VEC:             # <<<<<<<<<<<<<<
 *                 if step==1:
 *                     return self.vecextract('"'+str(start+1)+".."+str(stop)+'"')
 */
    __pyx_t_2 = ((__pyx_v_pari_type == t_VEC) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1111
 *             # fast call, beware pari is one based
 *             if pari_type == t_VEC:
 *                 if step==1:             # <<<<<<<<<<<<<<
 *                     return self.vecextract('"'+str(start+1)+".."+str(stop)+'"')
 *                 if step==-1:
 */
      __pyx_t_8 = PyObject_RichCompare(__pyx_v_step, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_2) {

        /* "cypari_src/gen.pyx":1112
 *             if pari_type == t_VEC:
 *                 if step==1:
 *                     return self.vecextract('"'+str(start+1)+".."+str(stop)+'"')             # <<<<<<<<<<<<<<
 *                 if step==-1:
 *                     return self.vecextract('"'+str(start+1)+".."+str(stop+2)+'"')
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_vecextract); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyNumber_Add(__pyx_v_start, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Add(__pyx_kp_s__5, __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Add(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_10) {
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_9 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* "cypari_src/gen.pyx":1113
 *                 if step==1:
 *                     return self.vecextract('"'+str(start+1)+".."+str(stop)+'"')
 *                 if step==-1:             # <<<<<<<<<<<<<<
 *                     return self.vecextract('"'+str(start+1)+".."+str(stop+2)+'"')
 *             # slow call
 */
      __pyx_t_8 = PyObject_RichCompare(__pyx_v_step, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_2) {

        /* "cypari_src/gen.pyx":1114
 *                     return self.vecextract('"'+str(start+1)+".."+str(stop)+'"')
 *                 if step==-1:
 *                     return self.vecextract('"'+str(start+1)+".."+str(stop+2)+'"')             # <<<<<<<<<<<<<<
 *             # slow call
 *             v = P.vector(k)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_vecextract); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyNumber_Add(__pyx_v_start, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyNumber_Add(__pyx_kp_s__5, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Add(__pyx_t_9, __pyx_kp_s__6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyNumber_Add(__pyx_v_stop, __pyx_int_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Add(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_10) {
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_9 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "cypari_src/gen.pyx":1116
 *                     return self.vecextract('"'+str(start+1)+".."+str(stop+2)+'"')
 *             # slow call
 *             v = P.vector(k)             # <<<<<<<<<<<<<<
 *             for i,j in enumerate(inds):
 *                 v[i] = self[j]
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_10cypari_src_3gen_P), __pyx_n_s_vector); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_8);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_v = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "cypari_src/gen.pyx":1117
 *             # slow call
 *             v = P.vector(k)
 *             for i,j in enumerate(inds):             # <<<<<<<<<<<<<<
 *                 v[i] = self[j]
 *             return v
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_8 = __pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_inds)) || PyTuple_CheckExact(__pyx_v_inds)) {
      __pyx_t_4 = __pyx_v_inds; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_inds); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_4, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_4, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_12(__pyx_t_4);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
      __pyx_t_10 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_10;
      __pyx_t_10 = 0;

      /* "cypari_src/gen.pyx":1118
 *             v = P.vector(k)
 *             for i,j in enumerate(inds):
 *                 v[i] = self[j]             # <<<<<<<<<<<<<<
 *             return v
 * 
 */
      __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_j); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(PyObject_SetItem(__pyx_v_v, __pyx_v_i, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cypari_src/gen.pyx":1117
 *             # slow call
 *             v = P.vector(k)
 *             for i,j in enumerate(inds):             # <<<<<<<<<<<<<<
 *                 v[i] = self[j]
 *             return v
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cypari_src/gen.pyx":1119
 *             for i,j in enumerate(inds):
 *                 v[i] = self[j]
 *             return v             # <<<<<<<<<<<<<<
 * 
 *         ## there are no "out of bounds" problems
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_v);
    __pyx_r = __pyx_v_v;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":1124
 *         ## for a polynomial or power series, so these go before
 *         ## bounds testing
 *         if pari_type == t_POL:             # <<<<<<<<<<<<<<
 *             return self.polcoeff(n)
 * 
 */
  __pyx_t_2 = ((__pyx_v_pari_type == t_POL) != 0);
  if (__pyx_t_2) {

    /* "cypari_src/gen.pyx":1125
 *         ## bounds testing
 *         if pari_type == t_POL:
 *             return self.polcoeff(n)             # <<<<<<<<<<<<<<
 * 
 *         elif pari_type == t_SER:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_polcoeff); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_10) {
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
      __Pyx_INCREF(__pyx_v_n);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_n);
      __Pyx_GIVEREF(__pyx_v_n);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":1127
 *             return self.polcoeff(n)
 * 
 *         elif pari_type == t_SER:             # <<<<<<<<<<<<<<
 *             bound = valp(self.g) + lg(self.g) - 2
 *             if n >= bound:
 */
  __pyx_t_2 = ((__pyx_v_pari_type == t_SER) != 0);
  if (__pyx_t_2) {

    /* "cypari_src/gen.pyx":1128
 * 
 *         elif pari_type == t_SER:
 *             bound = valp(self.g) + lg(self.g) - 2             # <<<<<<<<<<<<<<
 *             if n >= bound:
 *                 raise IndexError, "index out of bounds"
 */
    __pyx_v_bound = ((valp(__pyx_v_self->g) + lg(__pyx_v_self->g)) - 2);

    /* "cypari_src/gen.pyx":1129
 *         elif pari_type == t_SER:
 *             bound = valp(self.g) + lg(self.g) - 2
 *             if n >= bound:             # <<<<<<<<<<<<<<
 *                 raise IndexError, "index out of bounds"
 *             return self.polcoeff(n)
 */
    __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_bound); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_n, __pyx_t_8, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1130
 *             bound = valp(self.g) + lg(self.g) - 2
 *             if n >= bound:
 *                 raise IndexError, "index out of bounds"             # <<<<<<<<<<<<<<
 *             return self.polcoeff(n)
 * 
 */
      __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_s_index_out_of_bounds, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":1131
 *             if n >= bound:
 *                 raise IndexError, "index out of bounds"
 *             return self.polcoeff(n)             # <<<<<<<<<<<<<<
 * 
 *         elif pari_type in (t_INT, t_REAL, t_PADIC, t_QUAD):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_polcoeff); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_n);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_n);
      __Pyx_GIVEREF(__pyx_v_n);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":1133
 *             return self.polcoeff(n)
 * 
 *         elif pari_type in (t_INT, t_REAL, t_PADIC, t_QUAD):             # <<<<<<<<<<<<<<
 *             # these are definitely scalar!
 *             raise TypeError, "unindexable object"
 */
  __pyx_t_13 = __pyx_v_pari_type;
  __pyx_t_1 = ((__pyx_t_13 == t_INT) != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_t_13 == t_REAL) != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_t_13 == t_PADIC) != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_t_13 == t_QUAD) != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L23_bool_binop_done:;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1135
 *         elif pari_type in (t_INT, t_REAL, t_PADIC, t_QUAD):
 *             # these are definitely scalar!
 *             raise TypeError, "unindexable object"             # <<<<<<<<<<<<<<
 * 
 *         elif n < 0 or n >= glength(self.g):
 */
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_unindexable_object, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cypari_src/gen.pyx":1137
 *             raise TypeError, "unindexable object"
 * 
 *         elif n < 0 or n >= glength(self.g):             # <<<<<<<<<<<<<<
 *             raise IndexError, "index out of bounds"
 * 
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_n, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __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 = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L27_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyInt_From_long(glength(__pyx_v_self->g)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = PyObject_RichCompare(__pyx_v_n, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L27_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1138
 * 
 *         elif n < 0 or n >= glength(self.g):
 *             raise IndexError, "index out of bounds"             # <<<<<<<<<<<<<<
 * 
 *         elif pari_type == t_VEC or pari_type == t_MAT:
 */
    __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_s_index_out_of_bounds, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cypari_src/gen.pyx":1140
 *             raise IndexError, "index out of bounds"
 * 
 *         elif pari_type == t_VEC or pari_type == t_MAT:             # <<<<<<<<<<<<<<
 *             #t_VEC    : row vector        [ code ] [  x_1  ] ... [  x_k  ]
 *             #t_MAT    : matrix            [ code ] [ col_1 ] ... [ col_k ]
 */
  __pyx_t_2 = ((__pyx_v_pari_type == t_VEC) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L29_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_pari_type == t_MAT) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L29_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1143
 *             #t_VEC    : row vector        [ code ] [  x_1  ] ... [  x_k  ]
 *             #t_MAT    : matrix            [ code ] [ col_1 ] ... [ col_k ]
 *             if n in self._refers_to:             # <<<<<<<<<<<<<<
 *                 return self._refers_to[n]
 *             else:
 */
    __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_n, __pyx_v_self->_refers_to, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1144
 *             #t_MAT    : matrix            [ code ] [ col_1 ] ... [ col_k ]
 *             if n in self._refers_to:
 *                 return self._refers_to[n]             # <<<<<<<<<<<<<<
 *             else:
 *                 ## In this case, we're being asked to return
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_8 = PyObject_GetItem(__pyx_v_self->_refers_to, __pyx_v_n); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_r = __pyx_t_8;
      __pyx_t_8 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":1150
 *                 ## we need to create such a gen, add it to
 *                 ## self._refers_to, and return it.
 *                 val = P.new_ref(gel(self.g, n+1), self)             # <<<<<<<<<<<<<<
 *                 self._refers_to[n] = val
 *                 return val
 */
      __pyx_t_8 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyInt_As_long(__pyx_t_8); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_ref(__pyx_v_10cypari_src_3gen_P, gel(__pyx_v_self->g, __pyx_t_7), __pyx_v_self)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_val = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "cypari_src/gen.pyx":1151
 *                 ## self._refers_to, and return it.
 *                 val = P.new_ref(gel(self.g, n+1), self)
 *                 self._refers_to[n] = val             # <<<<<<<<<<<<<<
 *                 return val
 * 
 */
      if (unlikely(PyObject_SetItem(__pyx_v_self->_refers_to, __pyx_v_n, ((PyObject *)__pyx_v_val)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "cypari_src/gen.pyx":1152
 *                 val = P.new_ref(gel(self.g, n+1), self)
 *                 self._refers_to[n] = val
 *                 return val             # <<<<<<<<<<<<<<
 * 
 *         elif pari_type == t_VECSMALL:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_val));
      __pyx_r = ((PyObject *)__pyx_v_val);
      goto __pyx_L0;
    }
  }

  /* "cypari_src/gen.pyx":1154
 *                 return val
 * 
 *         elif pari_type == t_VECSMALL:             # <<<<<<<<<<<<<<
 *             #t_VECSMALL: vec. small ints  [ code ] [ x_1 ] ... [ x_k ]
 *             return self.g[n+1]
 */
  __pyx_t_2 = ((__pyx_v_pari_type == t_VECSMALL) != 0);
  if (__pyx_t_2) {

    /* "cypari_src/gen.pyx":1156
 *         elif pari_type == t_VECSMALL:
 *             #t_VECSMALL: vec. small ints  [ code ] [ x_1 ] ... [ x_k ]
 *             return self.g[n+1]             # <<<<<<<<<<<<<<
 * 
 *         elif pari_type == t_STR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyInt_From_long((__pyx_v_self->g[__pyx_t_3])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":1158
 *             return self.g[n+1]
 * 
 *         elif pari_type == t_STR:             # <<<<<<<<<<<<<<
 *             #t_STR    : string            [ code ] [ man_1 ] ... [ man_k ]
 *             return chr( (<char *>(self.g+1))[n] )
 */
  __pyx_t_2 = ((__pyx_v_pari_type == t_STR) != 0);
  if (__pyx_t_2) {

    /* "cypari_src/gen.pyx":1160
 *         elif pari_type == t_STR:
 *             #t_STR    : string            [ code ] [ man_1 ] ... [ man_k ]
 *             return chr( (<char *>(self.g+1))[n] )             # <<<<<<<<<<<<<<
 * 
 *         elif pari_type == t_LIST:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __Pyx_PyInt_From_char((((char *)(__pyx_v_self->g + 1))[__pyx_t_3])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":1162
 *             return chr( (<char *>(self.g+1))[n] )
 * 
 *         elif pari_type == t_LIST:             # <<<<<<<<<<<<<<
 *             #t_LIST   : list              [ code ] [ n ] [ nmax ][ vec ]
 *             return self.component(n+1)
 */
  __pyx_t_2 = ((__pyx_v_pari_type == t_LIST) != 0);
  if (__pyx_t_2) {

    /* "cypari_src/gen.pyx":1164
 *         elif pari_type == t_LIST:
 *             #t_LIST   : list              [ code ] [ n ] [ nmax ][ vec ]
 *             return self.component(n+1)             # <<<<<<<<<<<<<<
 *             #code from previous version, now segfaults:
 *             #return P.new_ref(gel(self.g,n+2), self)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_component); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_8);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":1168
 *             #return P.new_ref(gel(self.g,n+2), self)
 * 
 *         elif pari_type in (t_INTMOD, t_POLMOD):             # <<<<<<<<<<<<<<
 *             #t_INTMOD : integermods       [ code ] [ mod  ] [ integer ]
 *             #t_POLMOD : poly mod          [ code ] [ mod  ] [ polynomial ]
 */
  __pyx_t_13 = __pyx_v_pari_type;
  __pyx_t_1 = ((__pyx_t_13 == t_INTMOD) != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L32_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_t_13 == t_POLMOD) != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L32_bool_binop_done:;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1176
 *             #   [1] = lift to t_INT or t_POL
 *             # do we want this? maybe the other way around?
 *             raise TypeError, "unindexable object"             # <<<<<<<<<<<<<<
 * 
 *         #elif pari_type in (t_FRAC, t_RFRAC):
 */
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_unindexable_object, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {

    /* "cypari_src/gen.pyx":1194
 *             ## generic code, which currently handles cases
 *             ## as mentioned above
 *             return P.new_ref(gel(self.g,n+1), self)             # <<<<<<<<<<<<<<
 * 
 *     def _gen_length(gen self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyInt_As_long(__pyx_t_8); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_ref(__pyx_v_10cypari_src_3gen_P, gel(__pyx_v_self->g, __pyx_t_7), __pyx_v_self)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":982
 *         return self.new_gen(bid_get_gen(self.g))
 * 
 *     def __getitem__(gen self, n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the nth entry of self. The indexing is 0-based, like in
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cypari_src.gen.gen.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF((PyObject *)__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_stop);
  __Pyx_XDECREF(__pyx_v_step);
  __Pyx_XDECREF(__pyx_v_inds);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1196
 *             return P.new_ref(gel(self.g,n+1), self)
 * 
 *     def _gen_length(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the length of self as a PARI object, *including*
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_75_gen_length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_74_gen_length[] = "\n        Return the length of self as a PARI object, *including*\n        codewords.\n        \n        EXAMPLES::\n        \n            >>> n = pari(30)\n            >>> n.length()\n            1\n            >>> n._gen_length()\n            3\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_75_gen_length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_gen_length (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_74_gen_length(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_74_gen_length(struct __pyx_obj_10cypari_src_3gen_gen *__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("_gen_length", 0);

  /* "cypari_src/gen.pyx":1209
 *             3
 *         """
 *         return lg(self.g)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(gen self, n, y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_long(lg(__pyx_v_self->g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1196
 *             return P.new_ref(gel(self.g,n+1), self)
 * 
 *     def _gen_length(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the length of self as a PARI object, *including*
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen._gen_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1211
 *         return lg(self.g)
 * 
 *     def __setitem__(gen self, n, y):             # <<<<<<<<<<<<<<
 *         r"""
 *         Set the nth entry to a reference to y.
 */

/* Python wrapper */
static int __pyx_pw_10cypari_src_3gen_3gen_77__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_y); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_76__setitem__[] = "\n        Set the nth entry to a reference to y.\n        \n            \n            -  The indexing is 0-based, like everywhere else in Python, but\n               *unlike* in PARI/GP.\n        \n            -  Assignment sets the nth entry to a reference to y, assuming y is\n               an object of type gen. This is the same as in Python, but\n               *different* than what happens in the gp interpreter, where\n               assignment makes a copy of y.\n        \n            -  Because setting creates references it is *possible* to make\n               circular references, unlike in GP. Do *not* do this (see the\n               example below). If you need circular references, work at the Python\n               level (where they work well), not the PARI object level.\n        \n        \n        \n        EXAMPLES::\n        \n            >>> v = pari(range(10))\n            >>> v\n            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> v[0] = 10\n            >>> w = pari([5,8,-20])\n            >>> v\n            [10, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> v[1] = w\n            >>> v\n            [10, [5, 8, -20], 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> w[0] = -30\n            >>> v\n            [10, [-30, 8, -20], 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> t = v[1]; t[1] = 10 ; v  \n            [10, [-30, 10, -20], 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> v[1][0] = 54321 ; v\n            [10, [54321, 10, -20], 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> w\n            [54321, 10, -20]\n            >>> v = pari([[[[0,1],2],3],4]) ; v[0][0][0][1] = 12 ; v\n            [[[[0, 12], 2], 3], 4]\n            >>> m = pari('[0,1;2,3]') ; l = pari('[5,6]') ; n = pari('[7,8;9,0]') ; m[1,0] = l ; l[1] = n ; m[1,0][1][1,1] = 1111 ; m\n            [0, 1; [5, [7, 8; 9, 1111]], 3]\n            >>> m = pari('[[1,2;3,4],5,6]') ; m[0][1,1] = 11 ; m\n            [[1, 2; 3, 11], 5, 6]\n            \n        Finally, we create a circular reference::\n        \n     ""       >>> v = pari([0])\n            >>> w = pari([v])\n            >>> v\n            [0]\n            >>> w\n            [[0]]\n            >>> v[0] = w\n        \n        Now there is a circular reference. Accessing v[0] will cause a crash.\n        \n        ::\n        \n            >>> s=pari.vector(2,[0,0])\n            >>> s[:1]\n            [0]\n            >>> s[:1]=[1]\n            >>> s\n            [1, 0]\n            >>> isinstance(s[0], gen)\n            True\n            >>> s = pari(range(20)) ; s\n            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> s[0:10:2] = range(50,55) ; s\n            [50, 1, 51, 3, 52, 5, 53, 7, 54, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]\n            >>> s[10:20:3] = range(100,150) ; s\n            [50, 1, 51, 3, 52, 5, 53, 7, 54, 9, 100, 11, 12, 101, 14, 15, 102, 17, 18, 103]\n        \n        TESTS::\n        \n            >>> v = pari(xrange(10)) ; v\n            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n            >>> v[:] = xrange(20,30)\n            >>> v\n            [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]\n            >>> isinstance(v[0], gen)\n            True\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_10cypari_src_3gen_3gen_76__setitem__;
#endif
static int __pyx_pw_10cypari_src_3gen_3gen_77__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_y) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_76__setitem__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_n), ((PyObject *)__pyx_v_y));

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

static int __pyx_pf_10cypari_src_3gen_3gen_76__setitem__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_y) {
  int __pyx_v_i;
  int __pyx_v_j;
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x = 0;
  long __pyx_v_l;
  PyObject *__pyx_v_ind = NULL;
  PyObject *__pyx_v_inds = NULL;
  Py_ssize_t __pyx_v_k;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "cypari_src/gen.pyx":1304
 *         # This is misplaced -- contains calls to python
 *         #sig_on()
 *         try:             # <<<<<<<<<<<<<<
 *             if isinstance(y, gen):
 *                 x = y
 */
  /*try:*/ {

    /* "cypari_src/gen.pyx":1305
 *         #sig_on()
 *         try:
 *             if isinstance(y, gen):             # <<<<<<<<<<<<<<
 *                 x = y
 *             else:
 */
    __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_y, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1306
 *         try:
 *             if isinstance(y, gen):
 *                 x = y             # <<<<<<<<<<<<<<
 *             else:
 *                 x = pari(y)
 */
      if (!(likely(((__pyx_v_y) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_y, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __pyx_t_3 = __pyx_v_y;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_v_x = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":1308
 *                 x = y
 *             else:
 *                 x = pari(y)             # <<<<<<<<<<<<<<
 * 
 *             if isinstance(n, tuple):
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_y);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_y);
        __Pyx_GIVEREF(__pyx_v_y);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __pyx_v_x = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L6:;

    /* "cypari_src/gen.pyx":1310
 *                 x = pari(y)
 * 
 *             if isinstance(n, tuple):             # <<<<<<<<<<<<<<
 *                 if typ(self.g) != t_MAT:
 *                     raise TypeError, "cannot index PARI type %s by tuple"%typ(self.g)
 */
    __pyx_t_2 = PyTuple_Check(__pyx_v_n); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":1311
 * 
 *             if isinstance(n, tuple):
 *                 if typ(self.g) != t_MAT:             # <<<<<<<<<<<<<<
 *                     raise TypeError, "cannot index PARI type %s by tuple"%typ(self.g)
 * 
 */
      __pyx_t_1 = ((typ(__pyx_v_self->g) != t_MAT) != 0);
      if (__pyx_t_1) {

        /* "cypari_src/gen.pyx":1312
 *             if isinstance(n, tuple):
 *                 if typ(self.g) != t_MAT:
 *                     raise TypeError, "cannot index PARI type %s by tuple"%typ(self.g)             # <<<<<<<<<<<<<<
 * 
 *                 if len(n) != 2:
 */
        __pyx_t_3 = __Pyx_PyInt_From_long(typ(__pyx_v_self->g)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_cannot_index_PARI_type_s_by_tupl, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_4, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }

      /* "cypari_src/gen.pyx":1314
 *                     raise TypeError, "cannot index PARI type %s by tuple"%typ(self.g)
 * 
 *                 if len(n) != 2:             # <<<<<<<<<<<<<<
 *                     raise ValueError, "matrix index must be of the form [row, column]"
 * 
 */
      __pyx_t_7 = PyObject_Length(__pyx_v_n); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __pyx_t_1 = ((__pyx_t_7 != 2) != 0);
      if (__pyx_t_1) {

        /* "cypari_src/gen.pyx":1315
 * 
 *                 if len(n) != 2:
 *                     raise ValueError, "matrix index must be of the form [row, column]"             # <<<<<<<<<<<<<<
 * 
 *                 i = int(n[0])
 */
        __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_matrix_index_must_be_of_the_form, 0, 0);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }

      /* "cypari_src/gen.pyx":1317
 *                     raise ValueError, "matrix index must be of the form [row, column]"
 * 
 *                 i = int(n[0])             # <<<<<<<<<<<<<<
 *                 j = int(n[1])
 *                 ind = (i,j)
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_n, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_i = __pyx_t_8;

      /* "cypari_src/gen.pyx":1318
 * 
 *                 i = int(n[0])
 *                 j = int(n[1])             # <<<<<<<<<<<<<<
 *                 ind = (i,j)
 * 
 */
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_n, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_j = __pyx_t_8;

      /* "cypari_src/gen.pyx":1319
 *                 i = int(n[0])
 *                 j = int(n[1])
 *                 ind = (i,j)             # <<<<<<<<<<<<<<
 * 
 *                 if i < 0 or i >= glength(<GEN>(self.g[1])):
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_ind = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "cypari_src/gen.pyx":1321
 *                 ind = (i,j)
 * 
 *                 if i < 0 or i >= glength(<GEN>(self.g[1])):             # <<<<<<<<<<<<<<
 *                     raise IndexError, "row i(=%s) must be between 0 and %s"%(i,self.nrows()-1)
 *                 if j < 0 or j >= glength(self.g):
 */
      __pyx_t_2 = ((__pyx_v_i < 0) != 0);
      if (!__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_2 = ((__pyx_v_i >= glength(((GEN)(__pyx_v_self->g[1])))) != 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L11_bool_binop_done:;
      if (__pyx_t_1) {

        /* "cypari_src/gen.pyx":1322
 * 
 *                 if i < 0 or i >= glength(<GEN>(self.g[1])):
 *                     raise IndexError, "row i(=%s) must be between 0 and %s"%(i,self.nrows()-1)             # <<<<<<<<<<<<<<
 *                 if j < 0 or j >= glength(self.g):
 *                     raise IndexError, "column j(=%s) must be between 0 and %s"%(j,self.ncols()-1)
 */
        __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nrows); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (__pyx_t_5) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else {
          __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        }
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __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 = 1322; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_6 = 0;
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_row_i_s_must_be_between_0_and_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_4, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }

      /* "cypari_src/gen.pyx":1323
 *                 if i < 0 or i >= glength(<GEN>(self.g[1])):
 *                     raise IndexError, "row i(=%s) must be between 0 and %s"%(i,self.nrows()-1)
 *                 if j < 0 or j >= glength(self.g):             # <<<<<<<<<<<<<<
 *                     raise IndexError, "column j(=%s) must be between 0 and %s"%(j,self.ncols()-1)
 *                 self._refers_to[ind] = x
 */
      __pyx_t_2 = ((__pyx_v_j < 0) != 0);
      if (!__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_2 = ((__pyx_v_j >= glength(__pyx_v_self->g)) != 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L14_bool_binop_done:;
      if (__pyx_t_1) {

        /* "cypari_src/gen.pyx":1324
 *                     raise IndexError, "row i(=%s) must be between 0 and %s"%(i,self.nrows()-1)
 *                 if j < 0 or j >= glength(self.g):
 *                     raise IndexError, "column j(=%s) must be between 0 and %s"%(j,self.ncols()-1)             # <<<<<<<<<<<<<<
 *                 self._refers_to[ind] = x
 * 
 */
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ncols); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (__pyx_t_5) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else {
          __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        }
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __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 = 1324; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_4 = 0;
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_column_j_s_must_be_between_0_and, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_6, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }

      /* "cypari_src/gen.pyx":1325
 *                 if j < 0 or j >= glength(self.g):
 *                     raise IndexError, "column j(=%s) must be between 0 and %s"%(j,self.ncols()-1)
 *                 self._refers_to[ind] = x             # <<<<<<<<<<<<<<
 * 
 *                 (<GEN>(self.g)[j+1])[i+1] = <long>(x.g)
 */
      if (unlikely(PyObject_SetItem(__pyx_v_self->_refers_to, __pyx_v_ind, ((PyObject *)__pyx_v_x)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L4_error;}

      /* "cypari_src/gen.pyx":1327
 *                 self._refers_to[ind] = x
 * 
 *                 (<GEN>(self.g)[j+1])[i+1] = <long>(x.g)             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
      (((GEN)(__pyx_v_self->g[(__pyx_v_j + 1)]))[(__pyx_v_i + 1)]) = ((long)__pyx_v_x->g);

      /* "cypari_src/gen.pyx":1328
 * 
 *                 (<GEN>(self.g)[j+1])[i+1] = <long>(x.g)
 *                 return             # <<<<<<<<<<<<<<
 * 
 *             elif isinstance(n, slice):
 */
      __pyx_r = 0;
      goto __pyx_L3_return;
    }

    /* "cypari_src/gen.pyx":1330
 *                 return
 * 
 *             elif isinstance(n, slice):             # <<<<<<<<<<<<<<
 *                 l = glength(self.g)
 *                 inds = xrange(*n.indices(l))
 */
    __pyx_t_1 = PySlice_Check(__pyx_v_n); 
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1331
 * 
 *             elif isinstance(n, slice):
 *                 l = glength(self.g)             # <<<<<<<<<<<<<<
 *                 inds = xrange(*n.indices(l))
 *                 k = len(inds)
 */
      __pyx_v_l = glength(__pyx_v_self->g);

      /* "cypari_src/gen.pyx":1332
 *             elif isinstance(n, slice):
 *                 l = glength(self.g)
 *                 inds = xrange(*n.indices(l))             # <<<<<<<<<<<<<<
 *                 k = len(inds)
 *                 if k > len(y):
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_xrange); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_l); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_inds = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "cypari_src/gen.pyx":1333
 *                 l = glength(self.g)
 *                 inds = xrange(*n.indices(l))
 *                 k = len(inds)             # <<<<<<<<<<<<<<
 *                 if k > len(y):
 *                     raise ValueError, "attempt to assign sequence of size %s to slice of size %s"%(len(y), k)
 */
      __pyx_t_7 = PyObject_Length(__pyx_v_inds); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __pyx_v_k = __pyx_t_7;

      /* "cypari_src/gen.pyx":1334
 *                 inds = xrange(*n.indices(l))
 *                 k = len(inds)
 *                 if k > len(y):             # <<<<<<<<<<<<<<
 *                     raise ValueError, "attempt to assign sequence of size %s to slice of size %s"%(len(y), k)
 * 
 */
      __pyx_t_7 = PyObject_Length(__pyx_v_y); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __pyx_t_2 = ((__pyx_v_k > __pyx_t_7) != 0);
      if (__pyx_t_2) {

        /* "cypari_src/gen.pyx":1335
 *                 k = len(inds)
 *                 if k > len(y):
 *                     raise ValueError, "attempt to assign sequence of size %s to slice of size %s"%(len(y), k)             # <<<<<<<<<<<<<<
 * 
 *                 # actually set the values
 */
        __pyx_t_7 = PyObject_Length(__pyx_v_y); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_3 = 0;
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_attempt_to_assign_sequence_of_si, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_4, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }

      /* "cypari_src/gen.pyx":1338
 * 
 *                 # actually set the values
 *                 for i,j in enumerate(inds):             # <<<<<<<<<<<<<<
 *                     self[j] = y[i]
 *                 return
 */
      __pyx_t_8 = 0;
      if (likely(PyList_CheckExact(__pyx_v_inds)) || PyTuple_CheckExact(__pyx_v_inds)) {
        __pyx_t_4 = __pyx_v_inds; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_inds); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_11(__pyx_t_4);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_j = __pyx_t_12;
        __pyx_v_i = __pyx_t_8;
        __pyx_t_8 = (__pyx_t_8 + 1);

        /* "cypari_src/gen.pyx":1339
 *                 # actually set the values
 *                 for i,j in enumerate(inds):
 *                     self[j] = y[i]             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_y, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_self), __pyx_v_j, __pyx_t_6, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cypari_src/gen.pyx":1338
 * 
 *                 # actually set the values
 *                 for i,j in enumerate(inds):             # <<<<<<<<<<<<<<
 *                     self[j] = y[i]
 *                 return
 */
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cypari_src/gen.pyx":1340
 *                 for i,j in enumerate(inds):
 *                     self[j] = y[i]
 *                 return             # <<<<<<<<<<<<<<
 * 
 *             i = int(n)
 */
      __pyx_r = 0;
      goto __pyx_L3_return;
    }

    /* "cypari_src/gen.pyx":1342
 *                 return
 * 
 *             i = int(n)             # <<<<<<<<<<<<<<
 * 
 *             if i < 0 or i >= glength(self.g):
 */
    __pyx_t_4 = PyNumber_Int(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_i = __pyx_t_8;

    /* "cypari_src/gen.pyx":1344
 *             i = int(n)
 * 
 *             if i < 0 or i >= glength(self.g):             # <<<<<<<<<<<<<<
 *                 raise IndexError, "index (%s) must be between 0 and %s"%(i,glength(self.g)-1)
 * 
 */
    __pyx_t_1 = ((__pyx_v_i < 0) != 0);
    if (!__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L20_bool_binop_done;
    }
    __pyx_t_1 = ((__pyx_v_i >= glength(__pyx_v_self->g)) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L20_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1345
 * 
 *             if i < 0 or i >= glength(self.g):
 *                 raise IndexError, "index (%s) must be between 0 and %s"%(i,glength(self.g)-1)             # <<<<<<<<<<<<<<
 * 
 *             # so python memory manager will work correctly
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyInt_From_long((glength(__pyx_v_self->g) - 1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_index_s_must_be_between_0_and_s, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_6, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }

    /* "cypari_src/gen.pyx":1350
 *             # and not free x if PARI part of self is the
 *             # only thing pointing to it.
 *             self._refers_to[i] = x             # <<<<<<<<<<<<<<
 * 
 *             ## correct indexing for t_POLs
 */
    if (unlikely(__Pyx_SetItemInt(__pyx_v_self->_refers_to, __pyx_v_i, ((PyObject *)__pyx_v_x), int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L4_error;}

    /* "cypari_src/gen.pyx":1353
 * 
 *             ## correct indexing for t_POLs
 *             if typ(self.g) == t_POL:             # <<<<<<<<<<<<<<
 *                 i = i + 1
 * 
 */
    __pyx_t_2 = ((typ(__pyx_v_self->g) == t_POL) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1354
 *             ## correct indexing for t_POLs
 *             if typ(self.g) == t_POL:
 *                 i = i + 1             # <<<<<<<<<<<<<<
 * 
 *             ## actually set the value
 */
      __pyx_v_i = (__pyx_v_i + 1);
      goto __pyx_L22;
    }
    __pyx_L22:;

    /* "cypari_src/gen.pyx":1358
 *             ## actually set the value
 *             #sig_on() better place?
 *             (self.g)[i+1] = <long>(x.g)             # <<<<<<<<<<<<<<
 *             return
 *         finally:
 */
    (__pyx_v_self->g[(__pyx_v_i + 1)]) = ((long)__pyx_v_x->g);

    /* "cypari_src/gen.pyx":1359
 *             #sig_on() better place?
 *             (self.g)[i+1] = <long>(x.g)
 *             return             # <<<<<<<<<<<<<<
 *         finally:
 *             #sig_off()
 */
    __pyx_r = 0;
    goto __pyx_L3_return;
  }

  /* "cypari_src/gen.pyx":1362
 *         finally:
 *             #sig_off()
 *             pass             # <<<<<<<<<<<<<<
 * 
 *     def __len__(gen self):
 */
  /*finally:*/ {
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __pyx_t_8 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
      {
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
      }
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
      __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
      goto __pyx_L1_error;
    }
    __pyx_L3_return: {
      __pyx_t_20 = __pyx_r;
      __pyx_r = __pyx_t_20;
      goto __pyx_L0;
    }
  }

  /* "cypari_src/gen.pyx":1211
 *         return lg(self.g)
 * 
 *     def __setitem__(gen self, n, y):             # <<<<<<<<<<<<<<
 *         r"""
 *         Set the nth entry to a reference to y.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cypari_src.gen.gen.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_ind);
  __Pyx_XDECREF(__pyx_v_inds);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1364
 *             pass
 * 
 *     def __len__(gen self):             # <<<<<<<<<<<<<<
 *         return glength(self.g)
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_10cypari_src_3gen_3gen_79__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_10cypari_src_3gen_3gen_79__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_78__len__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_10cypari_src_3gen_3gen_78__len__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "cypari_src/gen.pyx":1365
 * 
 *     def __len__(gen self):
 *         return glength(self.g)             # <<<<<<<<<<<<<<
 * 
 *     ###########################################
 */
  __pyx_r = glength(__pyx_v_self->g);
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1364
 *             pass
 * 
 *     def __len__(gen self):             # <<<<<<<<<<<<<<
 *         return glength(self.g)
 * 
 */

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

/* "cypari_src/gen.pyx":1373
 *     # memory-leaking and slow stuff occurs.
 *     ###########################################
 *     def __richcmp__(self, other, int op):             # <<<<<<<<<<<<<<
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_81__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_81__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_80__richcmp__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_80__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_v_left = NULL;
  PyObject *__pyx_v_right = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "cypari_src/gen.pyx":1374
 *     ###########################################
 *     def __richcmp__(self, other, int op):
 *         left = self if isinstance(self, gen) else P(self)             # <<<<<<<<<<<<<<
 *         right = other if isinstance(other, gen) else P(other)
 *         return bool(gen.compare(left, right, op))
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_self, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    __Pyx_INCREF(__pyx_v_self);
    __pyx_t_1 = __pyx_v_self;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __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 = NULL;
      __Pyx_INCREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_left = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":1375
 *     def __richcmp__(self, other, int op):
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)             # <<<<<<<<<<<<<<
 *         return bool(gen.compare(left, right, op))
 * 
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
  if ((__pyx_t_2 != 0)) {
    __Pyx_INCREF(__pyx_v_other);
    __pyx_t_1 = __pyx_v_other;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
    __pyx_t_4 = ((PyObject *)__pyx_v_10cypari_src_3gen_P); __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_right = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":1376
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)
 *         return bool(gen.compare(left, right, op))             # <<<<<<<<<<<<<<
 * 
 *     cdef int compare(left, gen right, int op) except -2:
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(((__pyx_v_left) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_left, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_v_right) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_right, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __pyx_f_10cypari_src_3gen_3gen_compare(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_left), ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_right), __pyx_v_op); if (unlikely(__pyx_t_7 == -2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1373
 *     # memory-leaking and slow stuff occurs.
 *     ###########################################
 *     def __richcmp__(self, other, int op):             # <<<<<<<<<<<<<<
 *         left = self if isinstance(self, gen) else P(self)
 *         right = other if isinstance(other, gen) else P(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cypari_src.gen.gen.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_left);
  __Pyx_XDECREF(__pyx_v_right);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1378
 *         return bool(gen.compare(left, right, op))
 * 
 *     cdef int compare(left, gen right, int op) except -2:             # <<<<<<<<<<<<<<
 *         """
 *         Comparisons
 */

static int __pyx_f_10cypari_src_3gen_3gen_compare(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_left, struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_right, int __pyx_v_op) {
  int __pyx_v_result;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compare", 0);

  /* "cypari_src/gen.pyx":1418
 *             True
 *         """
 *         result = gcmp_sage(left.g, (<gen>right).g)             # <<<<<<<<<<<<<<
 *         # < : -1; > : +1; == : 0
 *         if   op == 0: # <
 */
  __pyx_v_result = gcmp_sage(__pyx_v_left->g, __pyx_v_right->g);

  /* "cypari_src/gen.pyx":1430
 *         elif op == 4: # >
 *             return result > 0
 *         elif op == 5: # >=             # <<<<<<<<<<<<<<
 *             return result >= 0
 * 
 */
  switch (__pyx_v_op) {

    /* "cypari_src/gen.pyx":1420
 *         result = gcmp_sage(left.g, (<gen>right).g)
 *         # < : -1; > : +1; == : 0
 *         if   op == 0: # <             # <<<<<<<<<<<<<<
 *             return result < 0
 *         elif op == 1: # <=
 */
    case 0:

    /* "cypari_src/gen.pyx":1421
 *         # < : -1; > : +1; == : 0
 *         if   op == 0: # <
 *             return result < 0             # <<<<<<<<<<<<<<
 *         elif op == 1: # <=
 *             return result <= 0
 */
    __pyx_r = (__pyx_v_result < 0);
    goto __pyx_L0;
    break;

    /* "cypari_src/gen.pyx":1422
 *         if   op == 0: # <
 *             return result < 0
 *         elif op == 1: # <=             # <<<<<<<<<<<<<<
 *             return result <= 0
 *         elif op == 2: # ==
 */
    case 1:

    /* "cypari_src/gen.pyx":1423
 *             return result < 0
 *         elif op == 1: # <=
 *             return result <= 0             # <<<<<<<<<<<<<<
 *         elif op == 2: # ==
 *             return result == 0
 */
    __pyx_r = (__pyx_v_result <= 0);
    goto __pyx_L0;
    break;

    /* "cypari_src/gen.pyx":1424
 *         elif op == 1: # <=
 *             return result <= 0
 *         elif op == 2: # ==             # <<<<<<<<<<<<<<
 *             return result == 0
 *         elif op == 3: # !=
 */
    case 2:

    /* "cypari_src/gen.pyx":1425
 *             return result <= 0
 *         elif op == 2: # ==
 *             return result == 0             # <<<<<<<<<<<<<<
 *         elif op == 3: # !=
 *             return result != 0
 */
    __pyx_r = (__pyx_v_result == 0);
    goto __pyx_L0;
    break;

    /* "cypari_src/gen.pyx":1426
 *         elif op == 2: # ==
 *             return result == 0
 *         elif op == 3: # !=             # <<<<<<<<<<<<<<
 *             return result != 0
 *         elif op == 4: # >
 */
    case 3:

    /* "cypari_src/gen.pyx":1427
 *             return result == 0
 *         elif op == 3: # !=
 *             return result != 0             # <<<<<<<<<<<<<<
 *         elif op == 4: # >
 *             return result > 0
 */
    __pyx_r = (__pyx_v_result != 0);
    goto __pyx_L0;
    break;

    /* "cypari_src/gen.pyx":1428
 *         elif op == 3: # !=
 *             return result != 0
 *         elif op == 4: # >             # <<<<<<<<<<<<<<
 *             return result > 0
 *         elif op == 5: # >=
 */
    case 4:

    /* "cypari_src/gen.pyx":1429
 *             return result != 0
 *         elif op == 4: # >
 *             return result > 0             # <<<<<<<<<<<<<<
 *         elif op == 5: # >=
 *             return result >= 0
 */
    __pyx_r = (__pyx_v_result > 0);
    goto __pyx_L0;
    break;

    /* "cypari_src/gen.pyx":1430
 *         elif op == 4: # >
 *             return result > 0
 *         elif op == 5: # >=             # <<<<<<<<<<<<<<
 *             return result >= 0
 * 
 */
    case 5:

    /* "cypari_src/gen.pyx":1431
 *             return result > 0
 *         elif op == 5: # >=
 *             return result >= 0             # <<<<<<<<<<<<<<
 * 
 *     def __copy__(gen self):
 */
    __pyx_r = (__pyx_v_result >= 0);
    goto __pyx_L0;
    break;
    default: break;
  }

  /* "cypari_src/gen.pyx":1378
 *         return bool(gen.compare(left, right, op))
 * 
 *     cdef int compare(left, gen right, int op) except -2:             # <<<<<<<<<<<<<<
 *         """
 *         Comparisons
 */

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

/* "cypari_src/gen.pyx":1433
 *             return result >= 0
 * 
 *     def __copy__(gen self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gcopy(self.g))
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_83__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_83__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_82__copy__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_82__copy__(struct __pyx_obj_10cypari_src_3gen_gen *__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("__copy__", 0);

  /* "cypari_src/gen.pyx":1434
 * 
 *     def __copy__(gen self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gcopy(self.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":1435
 *     def __copy__(gen self):
 *         sig_on()
 *         return P.new_gen(gcopy(self.g))             # <<<<<<<<<<<<<<
 * 
 *     ###########################################
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gcopy(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1433
 *             return result >= 0
 * 
 *     def __copy__(gen self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gcopy(self.g))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1443
 *     ###########################################
 * 
 *     def list_str(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return str that might correctly evaluate to a Python-list.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_85list_str(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_84list_str[] = "\n        Return str that might correctly evaluate to a Python-list.\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_85list_str(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_str (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_84list_str(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_84list_str(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  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("list_str", 0);

  /* "cypari_src/gen.pyx":1447
 *         Return str that might correctly evaluate to a Python-list.
 *         """
 *         s = str(self)             # <<<<<<<<<<<<<<
 *         if s[:4] == "Mat(":
 *             s = "[" + s[4:-1] + "]"
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __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_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_s = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cypari_src/gen.pyx":1448
 *         """
 *         s = str(self)
 *         if s[:4] == "Mat(":             # <<<<<<<<<<<<<<
 *             s = "[" + s[4:-1] + "]"
 *         s = s.replace("~","")
 */
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_s, 0, 4, NULL, NULL, &__pyx_slice__7, 0, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_Mat, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "cypari_src/gen.pyx":1449
 *         s = str(self)
 *         if s[:4] == "Mat(":
 *             s = "[" + s[4:-1] + "]"             # <<<<<<<<<<<<<<
 *         s = s.replace("~","")
 *         if s.find(";") != -1:
 */
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_s, 4, -1, NULL, NULL, &__pyx_slice__9, 1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Add(__pyx_kp_s__8, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cypari_src/gen.pyx":1450
 *         if s[:4] == "Mat(":
 *             s = "[" + s[4:-1] + "]"
 *         s = s.replace("~","")             # <<<<<<<<<<<<<<
 *         if s.find(";") != -1:
 *             s = s.replace(";","], [")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":1451
 *             s = "[" + s[4:-1] + "]"
 *         s = s.replace("~","")
 *         if s.find(";") != -1:             # <<<<<<<<<<<<<<
 *             s = s.replace(";","], [")
 *             s = "[" + s + "]"
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_find); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "cypari_src/gen.pyx":1452
 *         s = s.replace("~","")
 *         if s.find(";") != -1:
 *             s = s.replace(";","], [")             # <<<<<<<<<<<<<<
 *             s = "[" + s + "]"
 *             return eval(s)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":1453
 *         if s.find(";") != -1:
 *             s = s.replace(";","], [")
 *             s = "[" + s + "]"             # <<<<<<<<<<<<<<
 *             return eval(s)
 *         else:
 */
    __pyx_t_2 = PyNumber_Add(__pyx_kp_s__8, __pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":1454
 *             s = s.replace(";","], [")
 *             s = "[" + s + "]"
 *             return eval(s)             # <<<<<<<<<<<<<<
 *         else:
 *             return eval(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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 = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_v_s) {
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_s, __pyx_v_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (((PyObject *)__pyx_v_self)) {
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_s);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_s);
    __Pyx_GIVEREF(__pyx_v_s);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "cypari_src/gen.pyx":1456
 *             return eval(s)
 *         else:
 *             return eval(s)             # <<<<<<<<<<<<<<
 * 
 *     def __index__(gen self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_v_s) {
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_s, __pyx_v_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (((PyObject *)__pyx_v_self)) {
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_self, ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_s);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
    __Pyx_GIVEREF(__pyx_v_s);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":1443
 *     ###########################################
 * 
 *     def list_str(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return str that might correctly evaluate to a Python-list.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cypari_src.gen.gen.list_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1458
 *             return eval(s)
 * 
 *     def __index__(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a python integer representing self.  Used by the hex builtin.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_87__index__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_86__index__[] = "\n        Return a python integer representing self.  Used by the hex builtin.\n        \n        EXAMPLES::\n        \n            >>> print( hex(pari(0)) )\n            0x0\n            >>> print( hex(pari(15)) )\n            0xf\n            >>> print( hex(pari(16)) )\n            0x10\n            >>> print( hex(pari(16938402384092843092843098243)) )\n            0x36bb1e3929d1a8fe2802f083\n            >>> print( hex(pari(-16938402384092843092843098243)) )\n            -0x36bb1e3929d1a8fe2802f083\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_10cypari_src_3gen_3gen_86__index__;
#endif
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_87__index__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__index__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_86__index__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_86__index__(struct __pyx_obj_10cypari_src_3gen_gen *__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("__index__", 0);

  /* "cypari_src/gen.pyx":1475
 *             -0x36bb1e3929d1a8fe2802f083
 *         """
 *         return int(self)             # <<<<<<<<<<<<<<
 * 
 *     def hex(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1458
 *             return eval(s)
 * 
 *     def __index__(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a python integer representing self.  Used by the hex builtin.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.__index__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1477
 *         return int(self)
 * 
 *     def hex(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a string containing the hexadecimal digits of self, with sign.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_89hex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_88hex[] = "\n        Return a string containing the hexadecimal digits of self, with sign.\n        \n        EXAMPLES::\n        \n            >>> print( pari(0).hex() )\n            0\n            >>> print( pari(15).hex() )\n            f\n            >>> print( pari(16).hex() )\n            10\n            >>> print( pari(16938402384092843092843098243).hex() )\n            36bb1e3929d1a8fe2802f083\n            >>> print( hex(16938402384092843092843098243) )\n            0x36bb1e3929d1a8fe2802f083\n            >>> print( pari(-16938402384092843092843098243).hex() )\n            -36bb1e3929d1a8fe2802f083\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_89hex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hex (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_88hex(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_88hex(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hex", 0);

  /* "cypari_src/gen.pyx":1496
 *             -36bb1e3929d1a8fe2802f083
 *         """
 *         return hex(self).replace('0x', '')             # <<<<<<<<<<<<<<
 * 
 *     def __int__(gen self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_hex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1477
 *         return int(self)
 * 
 *     def hex(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a string containing the hexadecimal digits of self, with sign.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cypari_src.gen.gen.hex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1498
 *         return hex(self).replace('0x', '')
 * 
 *     def __int__(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return Python int. Very fast, and if the number is too large to fit
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_91__int__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_90__int__[] = "\n        Return Python int. Very fast, and if the number is too large to fit\n        into a C int, a Python long is returned instead.\n        \n        EXAMPLES::\n        \n            >>> int(pari(0))\n            0\n            >>> int(pari(10))\n            10\n            >>> int(pari(-10))\n            -10\n            >>> print( int(pari(123456789012345678901234567890)) )\n            123456789012345678901234567890\n            >>> print( int(pari(-123456789012345678901234567890)) )\n            -123456789012345678901234567890\n            >>> int(pari('2^31-1'))\n            2147483647\n            >>> int(pari('-2^31'))\n            -2147483648\n            >>> int(pari(\"Pol(10)\"))\n            10\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_10cypari_src_3gen_3gen_90__int__;
#endif
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_91__int__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__int__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_90__int__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_90__int__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  GEN __pyx_v_x;
  long __pyx_v_lx;
  long *__pyx_v_xp;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  GEN __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__int__", 0);

  /* "cypari_src/gen.pyx":1524
 *         cdef GEN x
 *         cdef long lx, *xp
 *         if  typ(self.g)==t_POL and self.poldegree()<=0:             # <<<<<<<<<<<<<<
 *             # Change a constant polynomial to its constant term
 *             x = constant_term(self.g)
 */
  __pyx_t_2 = ((typ(__pyx_v_self->g) == t_POL) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_poldegree); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1526
 *         if  typ(self.g)==t_POL and self.poldegree()<=0:
 *             # Change a constant polynomial to its constant term
 *             x = constant_term(self.g)             # <<<<<<<<<<<<<<
 *         else:
 *             x = self.g
 */
    __pyx_v_x = constant_term(__pyx_v_self->g);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "cypari_src/gen.pyx":1528
 *             x = constant_term(self.g)
 *         else:
 *             x = self.g             # <<<<<<<<<<<<<<
 *         if typ(x) != t_INT:
 *             raise TypeError, "gen must be of PARI type t_INT or t_POL of degree 0"
 */
    __pyx_t_6 = __pyx_v_self->g;
    __pyx_v_x = __pyx_t_6;
  }
  __pyx_L3:;

  /* "cypari_src/gen.pyx":1529
 *         else:
 *             x = self.g
 *         if typ(x) != t_INT:             # <<<<<<<<<<<<<<
 *             raise TypeError, "gen must be of PARI type t_INT or t_POL of degree 0"
 *         if not signe(x):
 */
  __pyx_t_1 = ((typ(__pyx_v_x) != t_INT) != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1530
 *             x = self.g
 *         if typ(x) != t_INT:
 *             raise TypeError, "gen must be of PARI type t_INT or t_POL of degree 0"             # <<<<<<<<<<<<<<
 *         if not signe(x):
 *             return 0
 */
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_gen_must_be_of_PARI_type_t_INT_o, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cypari_src/gen.pyx":1531
 *         if typ(x) != t_INT:
 *             raise TypeError, "gen must be of PARI type t_INT or t_POL of degree 0"
 *         if not signe(x):             # <<<<<<<<<<<<<<
 *             return 0
 *         lx = lgefint(x)-3   # take 1 to account for the MSW
 */
  __pyx_t_1 = ((!(signe(__pyx_v_x) != 0)) != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1532
 *             raise TypeError, "gen must be of PARI type t_INT or t_POL of degree 0"
 *         if not signe(x):
 *             return 0             # <<<<<<<<<<<<<<
 *         lx = lgefint(x)-3   # take 1 to account for the MSW
 *         xp = int_MSW(x)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":1533
 *         if not signe(x):
 *             return 0
 *         lx = lgefint(x)-3   # take 1 to account for the MSW             # <<<<<<<<<<<<<<
 *         xp = int_MSW(x)
 *         # special case 1 word so we return int if it fits
 */
  __pyx_v_lx = (lgefint(__pyx_v_x) - 3);

  /* "cypari_src/gen.pyx":1534
 *             return 0
 *         lx = lgefint(x)-3   # take 1 to account for the MSW
 *         xp = int_MSW(x)             # <<<<<<<<<<<<<<
 *         # special case 1 word so we return int if it fits
 *         if not lx:
 */
  __pyx_v_xp = int_MSW(__pyx_v_x);

  /* "cypari_src/gen.pyx":1536
 *         xp = int_MSW(x)
 *         # special case 1 word so we return int if it fits
 *         if not lx:             # <<<<<<<<<<<<<<
 *             if   signe(x) |  xp[0] > 0:     # both positive
 *                 return xp[0]
 */
  __pyx_t_1 = ((!(__pyx_v_lx != 0)) != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1537
 *         # special case 1 word so we return int if it fits
 *         if not lx:
 *             if   signe(x) |  xp[0] > 0:     # both positive             # <<<<<<<<<<<<<<
 *                 return xp[0]
 *             elif signe(x) & -xp[0] < 0:     # both negative
 */
    __pyx_t_1 = (((signe(__pyx_v_x) | (__pyx_v_xp[0])) > 0) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":1538
 *         if not lx:
 *             if   signe(x) |  xp[0] > 0:     # both positive
 *                 return xp[0]             # <<<<<<<<<<<<<<
 *             elif signe(x) & -xp[0] < 0:     # both negative
 *                 return -xp[0]
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_xp[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":1539
 *             if   signe(x) |  xp[0] > 0:     # both positive
 *                 return xp[0]
 *             elif signe(x) & -xp[0] < 0:     # both negative             # <<<<<<<<<<<<<<
 *                 return -xp[0]
 *         i = <ulong>xp[0]
 */
    __pyx_t_1 = (((signe(__pyx_v_x) & (-(__pyx_v_xp[0]))) < 0) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":1540
 *                 return xp[0]
 *             elif signe(x) & -xp[0] < 0:     # both negative
 *                 return -xp[0]             # <<<<<<<<<<<<<<
 *         i = <ulong>xp[0]
 *         while lx:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyInt_From_long((-(__pyx_v_xp[0]))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "cypari_src/gen.pyx":1541
 *             elif signe(x) & -xp[0] < 0:     # both negative
 *                 return -xp[0]
 *         i = <ulong>xp[0]             # <<<<<<<<<<<<<<
 *         while lx:
 *             xp = int_precW(xp)
 */
  __pyx_t_4 = __Pyx_PyInt_From_unsigned_long(((__pyx_t_10cypari_src_3gen_ulong)(__pyx_v_xp[0]))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_i = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":1542
 *                 return -xp[0]
 *         i = <ulong>xp[0]
 *         while lx:             # <<<<<<<<<<<<<<
 *             xp = int_precW(xp)
 *             i = i << BITS_IN_LONG | <ulong>xp[0]
 */
  while (1) {
    __pyx_t_1 = (__pyx_v_lx != 0);
    if (!__pyx_t_1) break;

    /* "cypari_src/gen.pyx":1543
 *         i = <ulong>xp[0]
 *         while lx:
 *             xp = int_precW(xp)             # <<<<<<<<<<<<<<
 *             i = i << BITS_IN_LONG | <ulong>xp[0]
 *             lx = lx-1
 */
    __pyx_v_xp = int_precW(__pyx_v_xp);

    /* "cypari_src/gen.pyx":1544
 *         while lx:
 *             xp = int_precW(xp)
 *             i = i << BITS_IN_LONG | <ulong>xp[0]             # <<<<<<<<<<<<<<
 *             lx = lx-1
 *         if signe(x) > 0:
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(BITS_IN_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Lshift(__pyx_v_i, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_long(((__pyx_t_10cypari_src_3gen_ulong)(__pyx_v_xp[0]))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Or(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cypari_src/gen.pyx":1545
 *             xp = int_precW(xp)
 *             i = i << BITS_IN_LONG | <ulong>xp[0]
 *             lx = lx-1             # <<<<<<<<<<<<<<
 *         if signe(x) > 0:
 *             return i
 */
    __pyx_v_lx = (__pyx_v_lx - 1);
  }

  /* "cypari_src/gen.pyx":1546
 *             i = i << BITS_IN_LONG | <ulong>xp[0]
 *             lx = lx-1
 *         if signe(x) > 0:             # <<<<<<<<<<<<<<
 *             return i
 *         else:
 */
  __pyx_t_1 = ((signe(__pyx_v_x) > 0) != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1547
 *             lx = lx-1
 *         if signe(x) > 0:
 *             return i             # <<<<<<<<<<<<<<
 *         else:
 *             return -i
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_i);
    __pyx_r = __pyx_v_i;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "cypari_src/gen.pyx":1549
 *             return i
 *         else:
 *             return -i             # <<<<<<<<<<<<<<
 *         # NOTE: Could use int_unsafe below, which would be much faster, but
 *         # the default PARI prints annoying stuff to the screen when
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = PyNumber_Negative(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "cypari_src/gen.pyx":1498
 *         return hex(self).replace('0x', '')
 * 
 *     def __int__(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return Python int. Very fast, and if the number is too large to fit
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cypari_src.gen.gen.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1554
 *         # the number is large.
 * 
 *     def int_unsafe(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns int form of self, but raises an exception if int does not
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_93int_unsafe(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_92int_unsafe[] = "\n        Returns int form of self, but raises an exception if int does not\n        fit into a long integer.\n        \n        This is about 5 times faster than the usual int conversion.\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_93int_unsafe(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int_unsafe (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_92int_unsafe(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_92int_unsafe(struct __pyx_obj_10cypari_src_3gen_gen *__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("int_unsafe", 0);

  /* "cypari_src/gen.pyx":1561
 *         This is about 5 times faster than the usual int conversion.
 *         """
 *         return gtolong(self.g)             # <<<<<<<<<<<<<<
 * 
 *     def intvec_unsafe(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_long(gtolong(__pyx_v_self->g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1554
 *         # the number is large.
 * 
 *     def int_unsafe(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns int form of self, but raises an exception if int does not
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.int_unsafe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1563
 *         return gtolong(self.g)
 * 
 *     def intvec_unsafe(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns Python int list form of entries of self, but raises an
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_95intvec_unsafe(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_94intvec_unsafe[] = "\n        Returns Python int list form of entries of self, but raises an\n        exception if int does not fit into a long integer. Here self must\n        be a vector.\n        \n        EXAMPLES::\n        \n            >>> pari('[3,4,5]').type()\n            't_VEC'\n            >>> pari('[3,4,5]').intvec_unsafe()\n            [3, 4, 5]\n            >>> isinstance(pari('[3,4,5]').intvec_unsafe()[0], int)\n            True\n        \n        TESTS::\n        \n            >>> pari(3).intvec_unsafe()\n            Traceback (most recent call last):\n            ...\n            TypeError: gen must be of PARI type t_VEC\n            >>> pari('[2^150,1]').intvec_unsafe()\n            Traceback (most recent call last):\n            ...\n            PariError:  (15)\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_95intvec_unsafe(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("intvec_unsafe (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_94intvec_unsafe(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_94intvec_unsafe(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  int __pyx_v_n;
  int __pyx_v_L;
  PyObject *__pyx_v_v = 0;
  GEN __pyx_v_g;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GEN __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("intvec_unsafe", 0);

  /* "cypari_src/gen.pyx":1592
 *         cdef object v
 *         cdef GEN g
 *         g = self.g             # <<<<<<<<<<<<<<
 *         if typ(g) != t_VEC:
 *             raise TypeError, "gen must be of PARI type t_VEC"
 */
  __pyx_t_1 = __pyx_v_self->g;
  __pyx_v_g = __pyx_t_1;

  /* "cypari_src/gen.pyx":1593
 *         cdef GEN g
 *         g = self.g
 *         if typ(g) != t_VEC:             # <<<<<<<<<<<<<<
 *             raise TypeError, "gen must be of PARI type t_VEC"
 * 
 */
  __pyx_t_2 = ((typ(__pyx_v_g) != t_VEC) != 0);
  if (__pyx_t_2) {

    /* "cypari_src/gen.pyx":1594
 *         g = self.g
 *         if typ(g) != t_VEC:
 *             raise TypeError, "gen must be of PARI type t_VEC"             # <<<<<<<<<<<<<<
 * 
 *         sig_on()
 */
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_gen_must_be_of_PARI_type_t_VEC, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cypari_src/gen.pyx":1596
 *             raise TypeError, "gen must be of PARI type t_VEC"
 * 
 *         sig_on()             # <<<<<<<<<<<<<<
 *         L = glength(g)
 *         v = []
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":1597
 * 
 *         sig_on()
 *         L = glength(g)             # <<<<<<<<<<<<<<
 *         v = []
 *         for n from 0 <= n < L:
 */
  __pyx_v_L = glength(__pyx_v_g);

  /* "cypari_src/gen.pyx":1598
 *         sig_on()
 *         L = glength(g)
 *         v = []             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < L:
 *             v.append(gtolong(<GEN> (g[n+1])))
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_v = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cypari_src/gen.pyx":1599
 *         L = glength(g)
 *         v = []
 *         for n from 0 <= n < L:             # <<<<<<<<<<<<<<
 *             v.append(gtolong(<GEN> (g[n+1])))
 *         sig_off()
 */
  __pyx_t_4 = __pyx_v_L;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) {

    /* "cypari_src/gen.pyx":1600
 *         v = []
 *         for n from 0 <= n < L:
 *             v.append(gtolong(<GEN> (g[n+1])))             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return v
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(gtolong(((GEN)(__pyx_v_g[(__pyx_v_n + 1)])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_v, __pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "cypari_src/gen.pyx":1601
 *         for n from 0 <= n < L:
 *             v.append(gtolong(<GEN> (g[n+1])))
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return v
 * 
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":1602
 *             v.append(gtolong(<GEN> (g[n+1])))
 *         sig_off()
 *         return v             # <<<<<<<<<<<<<<
 * 
 *     def python_list_small(gen self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_v);
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1563
 *         return gtolong(self.g)
 * 
 *     def intvec_unsafe(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns Python int list form of entries of self, but raises an
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cypari_src.gen.gen.intvec_unsafe", __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;
}

/* "cypari_src/gen.pyx":1604
 *         return v
 * 
 *     def python_list_small(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a Python list of the PARI gens. This object must be of type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_97python_list_small(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_96python_list_small[] = "\n        Return a Python list of the PARI gens. This object must be of type\n        t_VECSMALL, and the resulting list contains python 'int's\n        \n        EXAMPLES::\n        \n            >>> v=pari([1,2,3,10,102,10]).Vecsmall()\n            >>> w = v.python_list_small()\n            >>> w\n            [1, 2, 3, 10, 102, 10]\n            >>> isinstance(w[0], int)\n            True\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_97python_list_small(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("python_list_small (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_96python_list_small(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_96python_list_small(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  long __pyx_v_n;
  PyObject *__pyx_v_V = NULL;
  long __pyx_v_m;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("python_list_small", 0);

  /* "cypari_src/gen.pyx":1619
 *         """
 *         cdef long n
 *         if typ(self.g) != t_VECSMALL:             # <<<<<<<<<<<<<<
 *             raise TypeError, "Object (=%s) must be of type t_VECSMALL."%self
 *         V = []
 */
  __pyx_t_1 = ((typ(__pyx_v_self->g) != t_VECSMALL) != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1620
 *         cdef long n
 *         if typ(self.g) != t_VECSMALL:
 *             raise TypeError, "Object (=%s) must be of type t_VECSMALL."%self             # <<<<<<<<<<<<<<
 *         V = []
 *         m = glength(self.g)
 */
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Object_s_must_be_of_type_t_VECSM, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cypari_src/gen.pyx":1621
 *         if typ(self.g) != t_VECSMALL:
 *             raise TypeError, "Object (=%s) must be of type t_VECSMALL."%self
 *         V = []             # <<<<<<<<<<<<<<
 *         m = glength(self.g)
 *         for n from 0 <= n < m:
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_V = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cypari_src/gen.pyx":1622
 *             raise TypeError, "Object (=%s) must be of type t_VECSMALL."%self
 *         V = []
 *         m = glength(self.g)             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < m:
 *             V.append(self.g[n+1])
 */
  __pyx_v_m = glength(__pyx_v_self->g);

  /* "cypari_src/gen.pyx":1623
 *         V = []
 *         m = glength(self.g)
 *         for n from 0 <= n < m:             # <<<<<<<<<<<<<<
 *             V.append(self.g[n+1])
 *         return V
 */
  __pyx_t_3 = __pyx_v_m;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_3; __pyx_v_n++) {

    /* "cypari_src/gen.pyx":1624
 *         m = glength(self.g)
 *         for n from 0 <= n < m:
 *             V.append(self.g[n+1])             # <<<<<<<<<<<<<<
 *         return V
 * 
 */
    __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_self->g[(__pyx_v_n + 1)])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_V, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cypari_src/gen.pyx":1625
 *         for n from 0 <= n < m:
 *             V.append(self.g[n+1])
 *         return V             # <<<<<<<<<<<<<<
 * 
 *     def python_list(gen self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_V);
  __pyx_r = __pyx_v_V;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1604
 *         return v
 * 
 *     def python_list_small(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a Python list of the PARI gens. This object must be of type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.gen.python_list_small", __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;
}

/* "cypari_src/gen.pyx":1627
 *         return V
 * 
 *     def python_list(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a Python list of the PARI gens. This object must be of type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_99python_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_98python_list[] = "\n        Return a Python list of the PARI gens. This object must be of type\n        t_VEC\n        \n        INPUT: NoneOUTPUT:\n        \n        \n        -  ``list`` - Python list whose elements are the\n           elements of the input gen.\n        \n        \n        EXAMPLES::\n        \n            >>> v=pari([1,2,3,10,102,10])\n            >>> w = v.python_list()\n            >>> w\n            [1, 2, 3, 10, 102, 10]\n            >>> isinstance(w[0], gen)\n            True\n            >>> pari(\"[1,2,3]\").python_list()\n            [1, 2, 3]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_99python_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("python_list (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_98python_list(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_98python_list(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  long __pyx_v_n;
  long __pyx_v_m;
  PyObject *__pyx_v_V = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("python_list", 0);

  /* "cypari_src/gen.pyx":1653
 *         cdef gen t
 * 
 *         if typ(self.g) != t_VEC:             # <<<<<<<<<<<<<<
 *             raise TypeError, "Object (=%s) must be of type t_VEC."%self
 *         m = glength(self.g)
 */
  __pyx_t_1 = ((typ(__pyx_v_self->g) != t_VEC) != 0);
  if (__pyx_t_1) {

    /* "cypari_src/gen.pyx":1654
 * 
 *         if typ(self.g) != t_VEC:
 *             raise TypeError, "Object (=%s) must be of type t_VEC."%self             # <<<<<<<<<<<<<<
 *         m = glength(self.g)
 *         V = []
 */
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Object_s_must_be_of_type_t_VEC, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cypari_src/gen.pyx":1655
 *         if typ(self.g) != t_VEC:
 *             raise TypeError, "Object (=%s) must be of type t_VEC."%self
 *         m = glength(self.g)             # <<<<<<<<<<<<<<
 *         V = []
 *         for n from 0 <= n < m:
 */
  __pyx_v_m = glength(__pyx_v_self->g);

  /* "cypari_src/gen.pyx":1656
 *             raise TypeError, "Object (=%s) must be of type t_VEC."%self
 *         m = glength(self.g)
 *         V = []             # <<<<<<<<<<<<<<
 *         for n from 0 <= n < m:
 * ##            t = P.new_ref(<GEN> (self.g[n+1]), V)
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_V = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cypari_src/gen.pyx":1657
 *         m = glength(self.g)
 *         V = []
 *         for n from 0 <= n < m:             # <<<<<<<<<<<<<<
 * ##            t = P.new_ref(<GEN> (self.g[n+1]), V)
 * ##            V.append(t)
 */
  __pyx_t_3 = __pyx_v_m;
  for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_3; __pyx_v_n++) {

    /* "cypari_src/gen.pyx":1660
 * ##            t = P.new_ref(<GEN> (self.g[n+1]), V)
 * ##            V.append(t)
 *             V.append(self.__getitem__(n))             # <<<<<<<<<<<<<<
 *         return V
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_V, __pyx_t_2); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cypari_src/gen.pyx":1661
 * ##            V.append(t)
 *             V.append(self.__getitem__(n))
 *         return V             # <<<<<<<<<<<<<<
 * 
 *     def __float__(gen self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_V);
  __pyx_r = __pyx_v_V;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1627
 *         return V
 * 
 *     def python_list(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a Python list of the PARI gens. This object must be of type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cypari_src.gen.gen.python_list", __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;
}

/* "cypari_src/gen.pyx":1663
 *         return V
 * 
 *     def __float__(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_101__float__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_100__float__[] = "\n        Return Python float.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_10cypari_src_3gen_3gen_100__float__;
#endif
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_101__float__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__float__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_100__float__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_100__float__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  double __pyx_v_d;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__float__", 0);

  /* "cypari_src/gen.pyx":1668
 *         """
 *         cdef double d
 *         sig_on()             # <<<<<<<<<<<<<<
 *         d = gtodouble(self.g)
 *         sig_off()
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":1669
 *         cdef double d
 *         sig_on()
 *         d = gtodouble(self.g)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return d
 */
  __pyx_v_d = gtodouble(__pyx_v_self->g);

  /* "cypari_src/gen.pyx":1670
 *         sig_on()
 *         d = gtodouble(self.g)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return d
 * 
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":1671
 *         d = gtodouble(self.g)
 *         sig_off()
 *         return d             # <<<<<<<<<<<<<<
 * 
 *     def __complex__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1663
 *         return V
 * 
 *     def __float__(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1673
 *         return d
 * 
 *     def __complex__(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         Return ``self`` as a Python ``complex``
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_103__complex__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_102__complex__[] = "\n        Return ``self`` as a Python ``complex``\n        value.\n        \n        EXAMPLES::\n        \n            >>> g = pari('(-1.0)^(1/5)'); g\n            0.809016994374947 + 0.587785252292473*I\n            >>> g.__complex__()\n            (0.8090169943749475+0.5877852522924731j)\n            >>> complex(g)            \n            (0.8090169943749475+0.5877852522924731j)\n        \n        ::\n        \n            >>> g = pari('Mod(3,5)'); g\n            Mod(3, 5)\n            >>> complex(g)\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_103__complex__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__complex__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_102__complex__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_102__complex__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  double __pyx_v_re;
  double __pyx_v_im;
  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("__complex__", 0);

  /* "cypari_src/gen.pyx":1697
 *         """
 *         cdef double re, im
 *         sig_on()             # <<<<<<<<<<<<<<
 *         re = gtodouble(greal(self.g))
 *         im = gtodouble(gimag(self.g))
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":1698
 *         cdef double re, im
 *         sig_on()
 *         re = gtodouble(greal(self.g))             # <<<<<<<<<<<<<<
 *         im = gtodouble(gimag(self.g))
 *         sig_off()
 */
  __pyx_v_re = gtodouble(greal(__pyx_v_self->g));

  /* "cypari_src/gen.pyx":1699
 *         sig_on()
 *         re = gtodouble(greal(self.g))
 *         im = gtodouble(gimag(self.g))             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return complex(re, im)
 */
  __pyx_v_im = gtodouble(gimag(__pyx_v_self->g));

  /* "cypari_src/gen.pyx":1700
 *         re = gtodouble(greal(self.g))
 *         im = gtodouble(gimag(self.g))
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return complex(re, im)
 * 
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":1701
 *         im = gtodouble(gimag(self.g))
 *         sig_off()
 *         return complex(re, im)             # <<<<<<<<<<<<<<
 * 
 *     def __nonzero__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_im); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __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 = 1701; __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_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyComplex_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1673
 *         return d
 * 
 *     def __complex__(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         Return ``self`` as a Python ``complex``
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cypari_src.gen.gen.__complex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1703
 *         return complex(re, im)
 * 
 *     def __nonzero__(self):             # <<<<<<<<<<<<<<
 *         """
 *         EXAMPLES::
 */

/* Python wrapper */
static int __pyx_pw_10cypari_src_3gen_3gen_105__nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10cypari_src_3gen_3gen_105__nonzero__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_104__nonzero__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static int __pyx_pf_10cypari_src_3gen_3gen_104__nonzero__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__nonzero__", 0);

  /* "cypari_src/gen.pyx":1717
 *             False
 *         """
 *         return not gequal0(self.g)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (!(gequal0(__pyx_v_self->g) != 0));
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1703
 *         return complex(re, im)
 * 
 *     def __nonzero__(self):             # <<<<<<<<<<<<<<
 *         """
 *         EXAMPLES::
 */

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

/* "cypari_src/gen.pyx":1724
 *     ###########################################
 * 
 *     def gequal(gen a, b):             # <<<<<<<<<<<<<<
 *         r"""
 *         Check whether `a` and `b` are equal using PARI's ``gequal``.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_107gequal(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_106gequal[] = "\n        Check whether `a` and `b` are equal using PARI's ``gequal``.\n        \n        EXAMPLES::\n            \n            >>> a = pari(1); b = pari(1.0); c = pari('\"some_string\"')\n            >>> a.gequal(a)\n            True\n            >>> b.gequal(b)\n            True\n            >>> c.gequal(c)\n            True\n            >>> a.gequal(b)\n            True\n            >>> a.gequal(c)\n            False\n        \n        WARNING: this relation is not transitive::\n            \n            >>> a = pari('[0]'); b = pari(0); c = pari('[0,0]')\n            >>> a.gequal(b)\n            True\n            >>> b.gequal(c)\n            True\n            >>> a.gequal(c)\n            False\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_107gequal(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gequal (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_106gequal(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_a), ((PyObject *)__pyx_v_b));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_106gequal(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_a, PyObject *__pyx_v_b) {
  int __pyx_v_ret;
  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("gequal", 0);

  /* "cypari_src/gen.pyx":1752
 *             False
 *         """
 *         t0GEN(b)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         cdef int ret = gequal(a.g, t0)
 */
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":1753
 *         """
 *         t0GEN(b)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         cdef int ret = gequal(a.g, t0)
 *         sig_off()
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":1754
 *         t0GEN(b)
 *         sig_on()
 *         cdef int ret = gequal(a.g, t0)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return ret != 0
 */
  __pyx_v_ret = gequal(__pyx_v_a->g, __pyx_v_10cypari_src_3gen_t0);

  /* "cypari_src/gen.pyx":1755
 *         sig_on()
 *         cdef int ret = gequal(a.g, t0)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return ret != 0
 * 
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":1756
 *         cdef int ret = gequal(a.g, t0)
 *         sig_off()
 *         return ret != 0             # <<<<<<<<<<<<<<
 * 
 *     def gequal0(gen a):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_ret != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1724
 *     ###########################################
 * 
 *     def gequal(gen a, b):             # <<<<<<<<<<<<<<
 *         r"""
 *         Check whether `a` and `b` are equal using PARI's ``gequal``.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.gequal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1758
 *         return ret != 0
 * 
 *     def gequal0(gen a):             # <<<<<<<<<<<<<<
 *         r"""
 *         Check whether `a` is equal to zero.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_109gequal0(PyObject *__pyx_v_a, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_108gequal0[] = "\n        Check whether `a` is equal to zero.\n        \n        EXAMPLES::\n            \n            >>> pari(0).gequal0()\n            True\n            >>> pari(1).gequal0()\n            False\n            >>> pari(1e-100).gequal0()\n            False\n            >>> pari(\"0.0 + 0.0*I\").gequal0()\n            True\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_109gequal0(PyObject *__pyx_v_a, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gequal0 (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_108gequal0(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_a));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_108gequal0(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_a) {
  int __pyx_v_ret;
  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("gequal0", 0);

  /* "cypari_src/gen.pyx":1773
 *             True
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         cdef int ret = gequal0(a.g)
 *         sig_off()
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":1774
 *         """
 *         sig_on()
 *         cdef int ret = gequal0(a.g)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return ret != 0
 */
  __pyx_v_ret = gequal0(__pyx_v_a->g);

  /* "cypari_src/gen.pyx":1775
 *         sig_on()
 *         cdef int ret = gequal0(a.g)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return ret != 0
 * 
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":1776
 *         cdef int ret = gequal0(a.g)
 *         sig_off()
 *         return ret != 0             # <<<<<<<<<<<<<<
 * 
 *     def gequal_long(gen a, long b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_ret != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1758
 *         return ret != 0
 * 
 *     def gequal0(gen a):             # <<<<<<<<<<<<<<
 *         r"""
 *         Check whether `a` is equal to zero.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.gequal0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1778
 *         return ret != 0
 * 
 *     def gequal_long(gen a, long b):             # <<<<<<<<<<<<<<
 *         r"""
 *         Check whether `a` is equal to the ``long int`` `b` using PARI's ``gequalsg``.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_111gequal_long(PyObject *__pyx_v_a, PyObject *__pyx_arg_b); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_110gequal_long[] = "\n        Check whether `a` is equal to the ``long int`` `b` using PARI's ``gequalsg``.\n        \n        EXAMPLES::\n            \n            >>> a = pari(1); b = pari(2.0); c = pari('3*matid(3)')\n            >>> a.gequal_long(1)\n            True\n            >>> a.gequal_long(-1)\n            False\n            >>> a.gequal_long(0)\n            False\n            >>> b.gequal_long(2)\n            True\n            >>> b.gequal_long(-2)\n            False\n            >>> c.gequal_long(3)\n            True\n            >>> c.gequal_long(-3)\n            False\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_111gequal_long(PyObject *__pyx_v_a, PyObject *__pyx_arg_b) {
  long __pyx_v_b;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gequal_long (wrapper)", 0);
  assert(__pyx_arg_b); {
    __pyx_v_b = __Pyx_PyInt_As_long(__pyx_arg_b); if (unlikely((__pyx_v_b == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.gequal_long", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_110gequal_long(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_a), ((long)__pyx_v_b));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_110gequal_long(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_a, long __pyx_v_b) {
  int __pyx_v_ret;
  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("gequal_long", 0);

  /* "cypari_src/gen.pyx":1800
 *             False
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         cdef int ret = gequalsg(b, a.g)
 *         sig_off()
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":1801
 *         """
 *         sig_on()
 *         cdef int ret = gequalsg(b, a.g)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return ret != 0
 */
  __pyx_v_ret = gequalsg(__pyx_v_b, __pyx_v_a->g);

  /* "cypari_src/gen.pyx":1802
 *         sig_on()
 *         cdef int ret = gequalsg(b, a.g)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return ret != 0
 * 
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":1803
 *         cdef int ret = gequalsg(b, a.g)
 *         sig_off()
 *         return ret != 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_ret != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1778
 *         return ret != 0
 * 
 *     def gequal_long(gen a, long b):             # <<<<<<<<<<<<<<
 *         r"""
 *         Check whether `a` is equal to the ``long int`` `b` using PARI's ``gequalsg``.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.gequal_long", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1809
 *     # arith1.c
 *     ###########################################
 *     def isprime(gen self, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         isprime(x, flag=0): Returns True if x is a PROVEN prime number, and
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_113isprime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_112isprime[] = "\n        isprime(x, flag=0): Returns True if x is a PROVEN prime number, and\n        False otherwise.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - int 0 (default): use a combination of\n           algorithms. 1: certify primality using the Pocklington-Lehmer Test.\n           2: certify primality using the APRCL test.\n        \n        \n        OUTPUT:\n        \n        \n        -  ``bool`` - True or False\n        \n        \n        EXAMPLES::\n        \n            >>> pari(9).isprime()\n            False\n            >>> pari(17).isprime()\n            True\n            >>> n = pari(561)    # smallest Carmichael number\n            >>> n.isprime()      # not just a pseudo-primality test!\n            False\n            >>> n.isprime(1)\n            False\n            >>> n.isprime(2)\n            False\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_113isprime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_flag = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isprime (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_flag);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isprime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __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_flag = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isprime", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.isprime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_112isprime(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_112isprime(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag) {
  int __pyx_v_t;
  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("isprime", 0);

  /* "cypari_src/gen.pyx":1843
 *         """
 *         cdef bint t
 *         sig_on()             # <<<<<<<<<<<<<<
 *         t = (signe(gisprime(self.g, flag)) != 0)
 *         sig_off()
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":1844
 *         cdef bint t
 *         sig_on()
 *         t = (signe(gisprime(self.g, flag)) != 0)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return t
 */
  __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_t = (signe(gisprime(__pyx_v_self->g, __pyx_t_1)) != 0);

  /* "cypari_src/gen.pyx":1845
 *         sig_on()
 *         t = (signe(gisprime(self.g, flag)) != 0)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return t
 * 
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":1846
 *         t = (signe(gisprime(self.g, flag)) != 0)
 *         sig_off()
 *         return t             # <<<<<<<<<<<<<<
 * 
 *     def qfbhclassno(gen n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1809
 *     # arith1.c
 *     ###########################################
 *     def isprime(gen self, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         isprime(x, flag=0): Returns True if x is a PROVEN prime number, and
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.gen.isprime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1848
 *         return t
 * 
 *     def qfbhclassno(gen n):             # <<<<<<<<<<<<<<
 *         r"""
 *         Computes the Hurwitz-Kronecker class number of `n`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_115qfbhclassno(PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_114qfbhclassno[] = "\n        Computes the Hurwitz-Kronecker class number of `n`.\n\n        INPUT:\n\n        - `n` (gen) -- a non-negative integer\n        \n        .. note::\n\n           If `n` is large (more than `5*10^5`), the result is\n           conditional upon GRH.\n        \n        EXAMPLES:\n\n        The Hurwitx class number is 0 is n is congruent to 1 or 2 modulo 4::\n            >>> pari(-10007).qfbhclassno()\n            0\n            >>> pari(-2).qfbhclassno()\n            0\n\n        It is -1/12 for n=0::\n\n            >>> pari(0).qfbhclassno()\n            -1/12\n\n        Otherwise it is the number of classes of positive definite\n        binary quadratic forms with discriminant `-n`, weighted by\n        `1/m` where `m` is the number of automorphisms of the form::\n        \n            >>> pari(4).qfbhclassno()\n            1/2\n            >>> pari(3).qfbhclassno()\n            1/3\n            >>> pari(23).qfbhclassno()\n            3\n        \n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_115qfbhclassno(PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("qfbhclassno (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_114qfbhclassno(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_n));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_114qfbhclassno(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("qfbhclassno", 0);

  /* "cypari_src/gen.pyx":1886
 * 
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(hclassno(n.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":1887
 *         """
 *         sig_on()
 *         return P.new_gen(hclassno(n.g))             # <<<<<<<<<<<<<<
 * 
 *     def ispseudoprime(gen self, flag=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, hclassno(__pyx_v_n->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1848
 *         return t
 * 
 *     def qfbhclassno(gen n):             # <<<<<<<<<<<<<<
 *         r"""
 *         Computes the Hurwitz-Kronecker class number of `n`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.qfbhclassno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1889
 *         return P.new_gen(hclassno(n.g))
 * 
 *     def ispseudoprime(gen self, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         ispseudoprime(x, flag=0): Returns True if x is a pseudo-prime
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_117ispseudoprime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_116ispseudoprime[] = "\n        ispseudoprime(x, flag=0): Returns True if x is a pseudo-prime\n        number, and False otherwise.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - int 0 (default): checks whether x is a\n           Baillie-Pomerance-Selfridge-Wagstaff pseudo prime (strong\n           Rabin-Miller pseudo prime for base 2, followed by strong Lucas test\n           for the sequence (P,-1), P smallest positive integer such that\n           `P^2 - 4` is not a square mod x). 0: checks whether x is a\n           strong Miller-Rabin pseudo prime for flag randomly chosen bases\n           (with end-matching to catch square roots of -1).\n        \n        \n        OUTPUT:\n        \n        \n        -  ``bool`` - True or False\n        \n        \n        EXAMPLES::\n        \n            >>> pari(9).ispseudoprime()\n            False\n            >>> pari(17).ispseudoprime()\n            True\n            >>> n = pari(561)     # smallest Carmichael number\n            >>> n.ispseudoprime(2)\n            False\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_117ispseudoprime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_flag = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ispseudoprime (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_flag);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ispseudoprime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __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_flag = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ispseudoprime", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.ispseudoprime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_116ispseudoprime(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_116ispseudoprime(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag) {
  long __pyx_v_z;
  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("ispseudoprime", 0);

  /* "cypari_src/gen.pyx":1923
 *         """
 *         cdef long z
 *         sig_on()             # <<<<<<<<<<<<<<
 *         z = ispseudoprime(self.g, flag)
 *         sig_off()
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":1924
 *         cdef long z
 *         sig_on()
 *         z = ispseudoprime(self.g, flag)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return (z != 0)
 */
  __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_z = ispseudoprime(__pyx_v_self->g, __pyx_t_1);

  /* "cypari_src/gen.pyx":1925
 *         sig_on()
 *         z = ispseudoprime(self.g, flag)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return (z != 0)
 * 
 */
  __pyx_f_10cypari_src_3gen_sig_off();

  /* "cypari_src/gen.pyx":1926
 *         z = ispseudoprime(self.g, flag)
 *         sig_off()
 *         return (z != 0)             # <<<<<<<<<<<<<<
 * 
 *     def ispower(gen self, k=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_z != 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1889
 *         return P.new_gen(hclassno(n.g))
 * 
 *     def ispseudoprime(gen self, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         ispseudoprime(x, flag=0): Returns True if x is a pseudo-prime
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.gen.ispseudoprime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1928
 *         return (z != 0)
 * 
 *     def ispower(gen self, k=None):             # <<<<<<<<<<<<<<
 *         r"""
 *         Determine whether or not self is a perfect k-th power. If k is not
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_119ispower(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_118ispower[] = "\n        Determine whether or not self is a perfect k-th power. If k is not\n        specified, find the largest k so that self is a k-th power.\n        \n        .. note:::\n\n           There is a BUG in the PARI C-library function (at least in\n           PARI 2.2.12-beta) that is used to implement this function! This is\n           in GP::\n        \n              ? p=nextprime(10^100); n=p^100; m=p^2; m^50==n; ispower(n,50)\n                    \n        \n        INPUT:\n        \n        \n        -  ``k`` - int (optional)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``power`` - int, what power it is\n        \n        -  ``g`` - what it is a power of\n        \n        \n        EXAMPLES::\n        \n            >>> pari(9).ispower()\n            (2, 3)\n            >>> pari(17).ispower()\n            (1, 17)\n            >>> pari(17).ispower(2)\n            (False, None)\n            >>> pari(17).ispower(1)\n            (1, 17)\n            >>> pari(2).ispower()\n            (1, 2)\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_119ispower(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_k = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ispower (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,0};
    PyObject* values[1] = {0};
    values[0] = ((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  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_k);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ispower") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __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_k = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ispower", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.ispower", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_118ispower(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_k);

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_118ispower(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_k) {
  int __pyx_v_n;
  GEN __pyx_v_x;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ispower", 0);
  __Pyx_INCREF(__pyx_v_k);

  /* "cypari_src/gen.pyx":1972
 *         cdef GEN x
 * 
 *         if k is None:             # <<<<<<<<<<<<<<
 *             sig_on()
 *             n = gisanypower(self.g, &x)
 */
  __pyx_t_1 = (__pyx_v_k == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cypari_src/gen.pyx":1973
 * 
 *         if k is None:
 *             sig_on()             # <<<<<<<<<<<<<<
 *             n = gisanypower(self.g, &x)
 *             if n == 0:
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":1974
 *         if k is None:
 *             sig_on()
 *             n = gisanypower(self.g, &x)             # <<<<<<<<<<<<<<
 *             if n == 0:
 *                 sig_off()
 */
    __pyx_v_n = gisanypower(__pyx_v_self->g, (&__pyx_v_x));

    /* "cypari_src/gen.pyx":1975
 *             sig_on()
 *             n = gisanypower(self.g, &x)
 *             if n == 0:             # <<<<<<<<<<<<<<
 *                 sig_off()
 *                 return 1, self
 */
    __pyx_t_2 = ((__pyx_v_n == 0) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1976
 *             n = gisanypower(self.g, &x)
 *             if n == 0:
 *                 sig_off()             # <<<<<<<<<<<<<<
 *                 return 1, self
 *             else:
 */
      __pyx_f_10cypari_src_3gen_sig_off();

      /* "cypari_src/gen.pyx":1977
 *             if n == 0:
 *                 sig_off()
 *                 return 1, self             # <<<<<<<<<<<<<<
 *             else:
 *                 return n, P.new_gen(x)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":1979
 *                 return 1, self
 *             else:
 *                 return n, P.new_gen(x)             # <<<<<<<<<<<<<<
 *         else:
 *             k = int(k)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_v_x)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "cypari_src/gen.pyx":1981
 *                 return n, P.new_gen(x)
 *         else:
 *             k = int(k)             # <<<<<<<<<<<<<<
 *             t0GEN(k)
 *             sig_on()
 */
    __pyx_t_5 = PyNumber_Int(__pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cypari_src/gen.pyx":1982
 *         else:
 *             k = int(k)
 *             t0GEN(k)             # <<<<<<<<<<<<<<
 *             sig_on()
 *             n = ispower(self.g, t0, &x)
 */
    __pyx_t_5 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cypari_src/gen.pyx":1983
 *             k = int(k)
 *             t0GEN(k)
 *             sig_on()             # <<<<<<<<<<<<<<
 *             n = ispower(self.g, t0, &x)
 *             if n == 0:
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":1984
 *             t0GEN(k)
 *             sig_on()
 *             n = ispower(self.g, t0, &x)             # <<<<<<<<<<<<<<
 *             if n == 0:
 *                 sig_off()
 */
    __pyx_v_n = ispower(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, (&__pyx_v_x));

    /* "cypari_src/gen.pyx":1985
 *             sig_on()
 *             n = ispower(self.g, t0, &x)
 *             if n == 0:             # <<<<<<<<<<<<<<
 *                 sig_off()
 *                 return False, None
 */
    __pyx_t_2 = ((__pyx_v_n == 0) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":1986
 *             n = ispower(self.g, t0, &x)
 *             if n == 0:
 *                 sig_off()             # <<<<<<<<<<<<<<
 *                 return False, None
 *             else:
 */
      __pyx_f_10cypari_src_3gen_sig_off();

      /* "cypari_src/gen.pyx":1987
 *             if n == 0:
 *                 sig_off()
 *                 return False, None             # <<<<<<<<<<<<<<
 *             else:
 *                 return k, P.new_gen(x)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__19);
      __pyx_r = __pyx_tuple__19;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":1989
 *                 return False, None
 *             else:
 *                 return k, P.new_gen(x)             # <<<<<<<<<<<<<<
 * 
 *     ###########################################
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_v_x)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_k);
      __Pyx_GIVEREF(__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
  }

  /* "cypari_src/gen.pyx":1928
 *         return (z != 0)
 * 
 *     def ispower(gen self, k=None):             # <<<<<<<<<<<<<<
 *         r"""
 *         Determine whether or not self is a perfect k-th power. If k is not
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cypari_src.gen.gen.ispower", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":1994
 *     # 1: Standard monadic or dyadic OPERATORS
 *     ###########################################
 *     def divrem(gen x, y, var=-1):             # <<<<<<<<<<<<<<
 *         """
 *         divrem(x, y, v): Euclidean division of x by y giving as a
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_121divrem(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_120divrem[] = "\n        divrem(x, y, v): Euclidean division of x by y giving as a\n        2-dimensional column vector the quotient and the remainder, with\n        respect to v (to main variable if v is omitted).\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_121divrem(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_var = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("divrem (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_var,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_y)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "divrem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_y = values[0];
    __pyx_v_var = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("divrem", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.divrem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_120divrem(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_y, __pyx_v_var);

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_120divrem(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_var) {
  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("divrem", 0);

  /* "cypari_src/gen.pyx":2000
 *         respect to v (to main variable if v is omitted).
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(divrem(x.g, t0, P.get_var(var)))
 */
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":2001
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(divrem(x.g, t0, P.get_var(var)))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2002
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(divrem(x.g, t0, P.get_var(var)))             # <<<<<<<<<<<<<<
 * 
 *     def lex(gen x, y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, divrem(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_var)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":1994
 *     # 1: Standard monadic or dyadic OPERATORS
 *     ###########################################
 *     def divrem(gen x, y, var=-1):             # <<<<<<<<<<<<<<
 *         """
 *         divrem(x, y, v): Euclidean division of x by y giving as a
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.divrem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2004
 *         return P.new_gen(divrem(x.g, t0, P.get_var(var)))
 * 
 *     def lex(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         lex(x,y): Compare x and y lexicographically (1 if xy, 0 if x==y, -1
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_123lex(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_122lex[] = "\n        lex(x,y): Compare x and y lexicographically (1 if xy, 0 if x==y, -1\n        if xy)\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_123lex(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lex (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_122lex(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_122lex(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
  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("lex", 0);

  /* "cypari_src/gen.pyx":2009
 *         if xy)
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return lexcmp(x.g, t0)
 */
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":2010
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return lexcmp(x.g, t0)
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2011
 *         t0GEN(y)
 *         sig_on()
 *         return lexcmp(x.g, t0)             # <<<<<<<<<<<<<<
 * 
 *     def max(gen x, y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(lexcmp(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2004
 *         return P.new_gen(divrem(x.g, t0, P.get_var(var)))
 * 
 *     def lex(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         lex(x,y): Compare x and y lexicographically (1 if xy, 0 if x==y, -1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.lex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2013
 *         return lexcmp(x.g, t0)
 * 
 *     def max(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         max(x,y): Return the maximum of x and y.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_125max(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_124max[] = "\n        max(x,y): Return the maximum of x and y.\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_125max(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("max (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_124max(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_124max(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
  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("max", 0);

  /* "cypari_src/gen.pyx":2017
 *         max(x,y): Return the maximum of x and y.
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gmax(x.g, t0))
 */
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":2018
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gmax(x.g, t0))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2019
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(gmax(x.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def min(gen x, y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gmax(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2013
 *         return lexcmp(x.g, t0)
 * 
 *     def max(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         max(x,y): Return the maximum of x and y.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2021
 *         return P.new_gen(gmax(x.g, t0))
 * 
 *     def min(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         min(x,y): Return the minimum of x and y.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_127min(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_126min[] = "\n        min(x,y): Return the minimum of x and y.\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_127min(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("min (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_126min(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_126min(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
  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("min", 0);

  /* "cypari_src/gen.pyx":2025
 *         min(x,y): Return the minimum of x and y.
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gmin(x.g, t0))
 */
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":2026
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gmin(x.g, t0))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2027
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(gmin(x.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def shift(gen x, long n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gmin(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2021
 *         return P.new_gen(gmax(x.g, t0))
 * 
 *     def min(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         min(x,y): Return the minimum of x and y.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2029
 *         return P.new_gen(gmin(x.g, t0))
 * 
 *     def shift(gen x, long n):             # <<<<<<<<<<<<<<
 *         """
 *         shift(x,n): shift x left n bits if n=0, right -n bits if n0.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_129shift(PyObject *__pyx_v_x, PyObject *__pyx_arg_n); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_128shift[] = "\n        shift(x,n): shift x left n bits if n=0, right -n bits if n0.\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_129shift(PyObject *__pyx_v_x, PyObject *__pyx_arg_n) {
  long __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shift (wrapper)", 0);
  assert(__pyx_arg_n); {
    __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.shift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_128shift(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((long)__pyx_v_n));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_128shift(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shift", 0);

  /* "cypari_src/gen.pyx":2033
 *         shift(x,n): shift x left n bits if n=0, right -n bits if n0.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gshift(x.g, n))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2034
 *         """
 *         sig_on()
 *         return P.new_gen(gshift(x.g, n))             # <<<<<<<<<<<<<<
 * 
 *     def shiftmul(gen x, long n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gshift(__pyx_v_x->g, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2029
 *         return P.new_gen(gmin(x.g, t0))
 * 
 *     def shift(gen x, long n):             # <<<<<<<<<<<<<<
 *         """
 *         shift(x,n): shift x left n bits if n=0, right -n bits if n0.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.shift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2036
 *         return P.new_gen(gshift(x.g, n))
 * 
 *     def shiftmul(gen x, long n):             # <<<<<<<<<<<<<<
 *         """
 *         shiftmul(x,n): Return the product of x by `2^n`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_131shiftmul(PyObject *__pyx_v_x, PyObject *__pyx_arg_n); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_130shiftmul[] = "\n        shiftmul(x,n): Return the product of x by `2^n`.\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_131shiftmul(PyObject *__pyx_v_x, PyObject *__pyx_arg_n) {
  long __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shiftmul (wrapper)", 0);
  assert(__pyx_arg_n); {
    __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.shiftmul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_130shiftmul(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((long)__pyx_v_n));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_130shiftmul(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shiftmul", 0);

  /* "cypari_src/gen.pyx":2040
 *         shiftmul(x,n): Return the product of x by `2^n`.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gmul2n(x.g, n))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2041
 *         """
 *         sig_on()
 *         return P.new_gen(gmul2n(x.g, n))             # <<<<<<<<<<<<<<
 * 
 *     def moebius(gen x):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gmul2n(__pyx_v_x->g, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2036
 *         return P.new_gen(gshift(x.g, n))
 * 
 *     def shiftmul(gen x, long n):             # <<<<<<<<<<<<<<
 *         """
 *         shiftmul(x,n): Return the product of x by `2^n`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.shiftmul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2043
 *         return P.new_gen(gmul2n(x.g, n))
 * 
 *     def moebius(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         moebius(x): Moebius function of x.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_133moebius(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_132moebius[] = "\n        moebius(x): Moebius function of x.\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_133moebius(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("moebius (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_132moebius(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_132moebius(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("moebius", 0);

  /* "cypari_src/gen.pyx":2047
 *         moebius(x): Moebius function of x.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gmoebius(x.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2048
 *         """
 *         sig_on()
 *         return P.new_gen(gmoebius(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def sign(gen x):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gmoebius(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2043
 *         return P.new_gen(gmul2n(x.g, n))
 * 
 *     def moebius(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         moebius(x): Moebius function of x.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.moebius", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2050
 *         return P.new_gen(gmoebius(x.g))
 * 
 *     def sign(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         sign(x): Return the sign of x, where x is of type integer, real or
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_135sign(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_134sign[] = "\n        sign(x): Return the sign of x, where x is of type integer, real or\n        fraction.\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_135sign(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sign (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_134sign(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_134sign(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sign", 0);

  /* "cypari_src/gen.pyx":2057
 *         # PARI throws an error if you attempt to take the sign of
 *         # a complex number.
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return gsigne(x.g)
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2058
 *         # a complex number.
 *         sig_on()
 *         return gsigne(x.g)             # <<<<<<<<<<<<<<
 * 
 *     def vecmax(gen x):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(gsigne(__pyx_v_x->g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2050
 *         return P.new_gen(gmoebius(x.g))
 * 
 *     def sign(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         sign(x): Return the sign of x, where x is of type integer, real or
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.sign", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2060
 *         return gsigne(x.g)
 * 
 *     def vecmax(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         vecmax(x): Return the maximum of the elements of the vector/matrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_137vecmax(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_136vecmax[] = "\n        vecmax(x): Return the maximum of the elements of the vector/matrix\n        x.\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_137vecmax(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("vecmax (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_136vecmax(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_136vecmax(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vecmax", 0);

  /* "cypari_src/gen.pyx":2065
 *         x.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(vecmax(x.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2066
 *         """
 *         sig_on()
 *         return P.new_gen(vecmax(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def vecmin(gen x):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, vecmax(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2060
 *         return gsigne(x.g)
 * 
 *     def vecmax(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         vecmax(x): Return the maximum of the elements of the vector/matrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.vecmax", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2068
 *         return P.new_gen(vecmax(x.g))
 * 
 *     def vecmin(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         vecmin(x): Return the maximum of the elements of the vector/matrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_139vecmin(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_138vecmin[] = "\n        vecmin(x): Return the maximum of the elements of the vector/matrix\n        x.\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_139vecmin(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("vecmin (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_138vecmin(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_138vecmin(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vecmin", 0);

  /* "cypari_src/gen.pyx":2073
 *         x.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(vecmin(x.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2074
 *         """
 *         sig_on()
 *         return P.new_gen(vecmin(x.g))             # <<<<<<<<<<<<<<
 * 
 *     ###########################################
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, vecmin(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2068
 *         return P.new_gen(vecmax(x.g))
 * 
 *     def vecmin(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         vecmin(x): Return the maximum of the elements of the vector/matrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.vecmin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2080
 *     ###########################################
 * 
 *     def Col(gen x, long n = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Transform the object `x` into a column vector with minimal size `|n|`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_141Col(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_140Col[] = "\n        Transform the object `x` into a column vector with minimal size `|n|`.\n        \n        INPUT:\n        \n        - ``x`` -- gen\n        \n        - ``n`` -- Make the column vector of minimal length `|n|`. If `n > 0`,\n          append zeros; if `n < 0`, prepend zeros.\n        \n        OUTPUT:\n        \n        A PARI column vector (type ``t_COL``)\n        \n        EXAMPLES::\n        \n            >>> pari(1.5).Col()\n            [1.50000000000000]~\n            >>> pari([1,2,3,4]).Col()\n            [1, 2, 3, 4]~\n            >>> pari('[1,2; 3,4]').Col()\n            [[1, 2], [3, 4]]~\n            >>> pari('\"Sage\"').Col()\n            [\"S\", \"a\", \"g\", \"e\"]~\n            >>> pari('x + 3*x^3').Col()\n            [3, 0, 1, 0]~\n            >>> pari('x + 3*x^3 + O(x^5)').Col()\n            [1, 0, 3, 0]~\n\n        We demonstate the `n` argument::\n\n            >>> pari([1,2,3,4]).Col(2)\n            [1, 2, 3, 4]~\n            >>> pari([1,2,3,4]).Col(-2)\n            [1, 2, 3, 4]~\n            >>> pari([1,2,3,4]).Col(6)\n            [1, 2, 3, 4, 0, 0]~\n            >>> pari([1,2,3,4]).Col(-6)\n            [0, 0, 1, 2, 3, 4]~\n\n        See also :meth:`Vec` (create a row vector) for more examples\n        and :meth:`Colrev` (create a column in reversed order).\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_141Col(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Col (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_n);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Col") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __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;
      }
    }
    if (values[0]) {
      __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_n = ((long)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Col", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.Col", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_140Col(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_n);

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_140Col(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Col", 0);

  /* "cypari_src/gen.pyx":2124
 *         and :meth:`Colrev` (create a column in reversed order).
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(_Vec_append(gtocol(x.g), gen_0, n))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2125
 *         """
 *         sig_on()
 *         return P.new_gen(_Vec_append(gtocol(x.g), gen_0, n))             # <<<<<<<<<<<<<<
 * 
 *     def Colrev(gen x, long n = 0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_f_10cypari_src_3gen__Vec_append(gtocol(__pyx_v_x->g), gen_0, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2080
 *     ###########################################
 * 
 *     def Col(gen x, long n = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Transform the object `x` into a column vector with minimal size `|n|`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.Col", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2127
 *         return P.new_gen(_Vec_append(gtocol(x.g), gen_0, n))
 * 
 *     def Colrev(gen x, long n = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Transform the object `x` into a column vector with minimal size `|n|`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_143Colrev(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_142Colrev[] = "\n        Transform the object `x` into a column vector with minimal size `|n|`.\n        The order of the resulting vector is reversed compared to :meth:`Col`.\n        \n        INPUT:\n        \n        - ``x`` -- gen\n        \n        - ``n`` -- Make the vector of minimal length `|n|`. If `n > 0`,\n          prepend zeros; if `n < 0`, append zeros.\n        \n        OUTPUT:\n        \n        A PARI column vector (type ``t_COL``)\n        \n        EXAMPLES::\n        \n            >>> pari(1.5).Colrev()\n            [1.50000000000000]~\n            >>> pari([1,2,3,4]).Colrev()\n            [4, 3, 2, 1]~\n            >>> pari('[1,2; 3,4]').Colrev()\n            [[3, 4], [1, 2]]~\n            >>> pari('x + 3*x^3').Colrev()\n            [0, 1, 0, 3]~\n\n        We demonstate the `n` argument::\n\n            >>> pari([1,2,3,4]).Colrev(2)\n            [4, 3, 2, 1]~\n            >>> pari([1,2,3,4]).Colrev(-2)\n            [4, 3, 2, 1]~\n            >>> pari([1,2,3,4]).Colrev(6)\n            [0, 0, 4, 3, 2, 1]~\n            >>> pari([1,2,3,4]).Colrev(-6)\n            [4, 3, 2, 1, 0, 0]~\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_143Colrev(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Colrev (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_n);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Colrev") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __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;
      }
    }
    if (values[0]) {
      __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_n = ((long)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Colrev", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.Colrev", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_142Colrev(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_n);

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_142Colrev(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
  GEN __pyx_v_v;
  GEN __pyx_v_L;
  GEN __pyx_v_R;
  long __pyx_v_t;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Colrev", 0);

  /* "cypari_src/gen.pyx":2165
 *             [4, 3, 2, 1, 0, 0]~
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # Create a non-reversed column vector
 *         cdef GEN v = _Vec_append(gtocol(x.g), gen_0, n)
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2167
 *         sig_on()
 *         # Create a non-reversed column vector
 *         cdef GEN v = _Vec_append(gtocol(x.g), gen_0, n)             # <<<<<<<<<<<<<<
 *         # Reverse it in-place
 *         cdef GEN L = v + 1
 */
  __pyx_v_v = __pyx_f_10cypari_src_3gen__Vec_append(gtocol(__pyx_v_x->g), gen_0, __pyx_v_n);

  /* "cypari_src/gen.pyx":2169
 *         cdef GEN v = _Vec_append(gtocol(x.g), gen_0, n)
 *         # Reverse it in-place
 *         cdef GEN L = v + 1             # <<<<<<<<<<<<<<
 *         cdef GEN R = v + (lg(v)-1)
 *         cdef long t
 */
  __pyx_v_L = (__pyx_v_v + 1);

  /* "cypari_src/gen.pyx":2170
 *         # Reverse it in-place
 *         cdef GEN L = v + 1
 *         cdef GEN R = v + (lg(v)-1)             # <<<<<<<<<<<<<<
 *         cdef long t
 *         while (L < R):
 */
  __pyx_v_R = (__pyx_v_v + (lg(__pyx_v_v) - 1));

  /* "cypari_src/gen.pyx":2172
 *         cdef GEN R = v + (lg(v)-1)
 *         cdef long t
 *         while (L < R):             # <<<<<<<<<<<<<<
 *             t = L[0]
 *             L[0] = R[0]
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_L < __pyx_v_R) != 0);
    if (!__pyx_t_1) break;

    /* "cypari_src/gen.pyx":2173
 *         cdef long t
 *         while (L < R):
 *             t = L[0]             # <<<<<<<<<<<<<<
 *             L[0] = R[0]
 *             R[0] = t
 */
    __pyx_v_t = (__pyx_v_L[0]);

    /* "cypari_src/gen.pyx":2174
 *         while (L < R):
 *             t = L[0]
 *             L[0] = R[0]             # <<<<<<<<<<<<<<
 *             R[0] = t
 *             L += 1
 */
    (__pyx_v_L[0]) = (__pyx_v_R[0]);

    /* "cypari_src/gen.pyx":2175
 *             t = L[0]
 *             L[0] = R[0]
 *             R[0] = t             # <<<<<<<<<<<<<<
 *             L += 1
 *             R -= 1
 */
    (__pyx_v_R[0]) = __pyx_v_t;

    /* "cypari_src/gen.pyx":2176
 *             L[0] = R[0]
 *             R[0] = t
 *             L += 1             # <<<<<<<<<<<<<<
 *             R -= 1
 *         return P.new_gen(v)
 */
    __pyx_v_L = (__pyx_v_L + 1);

    /* "cypari_src/gen.pyx":2177
 *             R[0] = t
 *             L += 1
 *             R -= 1             # <<<<<<<<<<<<<<
 *         return P.new_gen(v)
 * 
 */
    __pyx_v_R = (__pyx_v_R - 1);
  }

  /* "cypari_src/gen.pyx":2178
 *             L += 1
 *             R -= 1
 *         return P.new_gen(v)             # <<<<<<<<<<<<<<
 * 
 *     def List(gen x):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_v_v)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2127
 *         return P.new_gen(_Vec_append(gtocol(x.g), gen_0, n))
 * 
 *     def Colrev(gen x, long n = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Transform the object `x` into a column vector with minimal size `|n|`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cypari_src.gen.gen.Colrev", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2180
 *         return P.new_gen(v)
 * 
 *     def List(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         List(x): transforms the PARI vector or list x into a list.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_145List(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_144List[] = "\n        List(x): transforms the PARI vector or list x into a list.\n        \n        EXAMPLES::\n        \n            >>> v = pari([1,2,3])\n            >>> v\n            [1, 2, 3]\n            >>> v.type()\n            't_VEC'\n            >>> w = v.List()\n            >>> w\n            List([1, 2, 3])\n            >>> w.type()\n            't_LIST'\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_145List(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("List (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_144List(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_144List(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("List", 0);

  /* "cypari_src/gen.pyx":2197
 *             't_LIST'
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gtolist(x.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2198
 *         """
 *         sig_on()
 *         return P.new_gen(gtolist(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def Mat(gen x):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gtolist(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2180
 *         return P.new_gen(v)
 * 
 *     def List(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         List(x): transforms the PARI vector or list x into a list.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.List", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2200
 *         return P.new_gen(gtolist(x.g))
 * 
 *     def Mat(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Mat(x): Returns the matrix defined by x.
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_147Mat(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_146Mat[] = "\n        Mat(x): Returns the matrix defined by x.\n        \n        - If x is already a matrix, a copy of x is created and returned.\n        \n        - If x is not a vector or a matrix, this function returns a 1x1\n          matrix.\n        \n        - If x is a row (resp. column) vector, this functions returns\n          a 1-row (resp. 1-column) matrix, *unless* all elements are\n          column (resp. row) vectors of the same length, in which case\n          the vectors are concatenated sideways and the associated big\n          matrix is returned.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - a PARI matrix\n        \n        \n        EXAMPLES::\n        \n            >>> x = pari(5)\n            >>> x.type()\n            't_INT'\n            >>> y = x.Mat()\n            >>> y\n            Mat(5)\n            >>> y.type()\n            't_MAT'\n            >>> x = pari('[1,2;3,4]')\n            >>> x.type()\n            't_MAT'\n            >>> x = pari('[1,2,3,4]')\n            >>> x.type()\n            't_VEC'\n            >>> y = x.Mat()\n            >>> y\n            Mat([1, 2, 3, 4])\n            >>> y.type()\n            't_MAT'\n        \n        ::\n        \n            >>> v = pari('[1,2;3,4]').Vec(); v\n            [[1, 3]~, [2, 4]~]\n            >>> v.Mat()\n            [1, 2; 3, 4]\n            >>> v = pari('[1,2;3,4]').Col(); v\n            [[1, 2], [3, 4]]~\n            >>> v.Mat()\n            [1, 2; 3, 4]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_147Mat(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Mat (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_146Mat(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_146Mat(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Mat", 0);

  /* "cypari_src/gen.pyx":2260
 *             [1, 2; 3, 4]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gtomat(x.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2261
 *         """
 *         sig_on()
 *         return P.new_gen(gtomat(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def Mod(gen x, y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gtomat(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2200
 *         return P.new_gen(gtolist(x.g))
 * 
 *     def Mat(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Mat(x): Returns the matrix defined by x.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.Mat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2263
 *         return P.new_gen(gtomat(x.g))
 * 
 *     def Mod(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Mod(x, y): Returns the object x modulo y, denoted Mod(x, y).
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_149Mod(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_148Mod[] = "\n        Mod(x, y): Returns the object x modulo y, denoted Mod(x, y).\n        \n        The input y must be a an integer or a polynomial:\n        \n        - If y is an INTEGER, x must also be an integer, a rational\n          number, or a p-adic number compatible with the modulus y.\n        \n        - If y is a POLYNOMIAL, x must be a scalar (which is not a\n          polmod), a polynomial, a rational function, or a power\n          series.\n        \n        .. warning::\n\n           This function is not the same as ``x % y`` which is an\n           integer or a polynomial.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``y`` - integer or polynomial\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - intmod or polmod\n        \n        \n        EXAMPLES::\n        \n            >>> z = pari(3)\n            >>> x = z.Mod(pari(7))\n            >>> x\n            Mod(3, 7)\n            >>> x**2\n            Mod(2, 7)\n            >>> x**100\n            Mod(4, 7)\n            >>> x.type()\n            't_INTMOD'\n        \n        ::\n        \n            >>> f = pari(\"x^2 + x + 1\")\n            >>> g = pari(\"x\")\n            >>> a = g.Mod(f)\n            >>> a\n            Mod(x, x^2 + x + 1)\n            >>> a*a\n            Mod(-x - 1, x^2 + x + 1)\n            >>> a.type()\n            't_POLMOD'\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_149Mod(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Mod (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_148Mod(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_148Mod(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Mod", 0);

  /* "cypari_src/gen.pyx":2320
 *             't_POLMOD'
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gmodulo(x.g,t0))
 */
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":2321
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gmodulo(x.g,t0))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2322
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(gmodulo(x.g,t0))             # <<<<<<<<<<<<<<
 * 
 *     def Pol(self, v=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gmodulo(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2263
 *         return P.new_gen(gtomat(x.g))
 * 
 *     def Mod(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Mod(x, y): Returns the object x modulo y, denoted Mod(x, y).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.Mod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2324
 *         return P.new_gen(gmodulo(x.g,t0))
 * 
 *     def Pol(self, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Pol(x, v): convert x into a polynomial with main variable v and
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_151Pol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_150Pol[] = "\n        Pol(x, v): convert x into a polynomial with main variable v and\n        return the result.\n        \n        - If x is a scalar, returns a constant polynomial.\n        \n        - If x is a power series, the effect is identical to\n          ``truncate``, i.e. it chops off the `O(X^k)`.\n        \n        - If x is a vector, this function creates the polynomial whose\n          coefficients are given in x, with x[0] being the leading\n          coefficient (which can be zero).\n        \n        .. warning::\n\n           This is *not* a substitution function. It will not\n           transform an object containing variables of higher priority\n           than v::\n        \n               >>>\n               Traceback (most recent call last):\n               ...\n               PariError:  (5)\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``v`` - (optional) which variable, defaults to 'x'\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - a polynomial\n        \n        \n        EXAMPLES::\n        \n            >>> v = pari(\"[1,2,3,4]\")\n            >>> f = v.Pol()\n            >>> f\n            x^3 + 2*x^2 + 3*x + 4\n            >>> f*f\n            x^6 + 4*x^5 + 10*x^4 + 20*x^3 + 25*x^2 + 24*x + 16\n        \n        ::\n        \n            >>> v = pari(\"[1,2;3,4]\")\n            >>> v.Pol()\n            [1, 3]~*x + [2, 4]~\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_151Pol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Pol (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_v);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Pol") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __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_v = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Pol", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.Pol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_150Pol(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_v);

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_150Pol(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v) {
  int __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Pol", 0);

  /* "cypari_src/gen.pyx":2379
 *         """
 *         cdef int n
 *         n = P.get_var(v)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gtopoly(self.g, n))
 */
  __pyx_v_n = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_v);

  /* "cypari_src/gen.pyx":2380
 *         cdef int n
 *         n = P.get_var(v)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gtopoly(self.g, n))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2381
 *         n = P.get_var(v)
 *         sig_on()
 *         return P.new_gen(gtopoly(self.g, n))             # <<<<<<<<<<<<<<
 * 
 *     def Polrev(self, v=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gtopoly(__pyx_v_self->g, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2324
 *         return P.new_gen(gmodulo(x.g,t0))
 * 
 *     def Pol(self, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Pol(x, v): convert x into a polynomial with main variable v and
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.Pol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2383
 *         return P.new_gen(gtopoly(self.g, n))
 * 
 *     def Polrev(self, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Polrev(x, v): Convert x into a polynomial with main variable v and
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_153Polrev(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_152Polrev[] = "\n        Polrev(x, v): Convert x into a polynomial with main variable v and\n        return the result. This is the reverse of Pol if x is a vector,\n        otherwise it is identical to Pol. By \"reverse\" we mean that the\n        coefficients are reversed.\n        \n        INPUT:\n        \n        -  ``x`` - gen\n        \n        OUTPUT:\n        \n        -  ``gen`` - a polynomial\n        \n        EXAMPLES::\n        \n            >>> v = pari(\"[1,2,3,4]\")\n            >>> f = v.Polrev()\n            >>> f\n            4*x^3 + 3*x^2 + 2*x + 1\n            >>> v.Pol()\n            x^3 + 2*x^2 + 3*x + 4\n            >>> v.Polrev('y')\n            4*y^3 + 3*y^2 + 2*y + 1\n        \n        Note that Polrev does *not* reverse the coefficients of a\n        polynomial! ::\n        \n            >>> f\n            4*x^3 + 3*x^2 + 2*x + 1\n            >>> f.Polrev()\n            4*x^3 + 3*x^2 + 2*x + 1\n            >>> v = pari(\"[1,2;3,4]\")\n            >>> v.Polrev()\n            [2, 4]~*x + [1, 3]~\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_153Polrev(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Polrev (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_v);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Polrev") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __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_v = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Polrev", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.Polrev", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_152Polrev(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_v);

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_152Polrev(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v) {
  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("Polrev", 0);

  /* "cypari_src/gen.pyx":2420
 *             [2, 4]~*x + [1, 3]~
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gtopolyrev(self.g, P.get_var(v)))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2421
 *         """
 *         sig_on()
 *         return P.new_gen(gtopolyrev(self.g, P.get_var(v)))             # <<<<<<<<<<<<<<
 * 
 *     def Qfb(gen a, b, c, D=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gtopolyrev(__pyx_v_self->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_v)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2383
 *         return P.new_gen(gtopoly(self.g, n))
 * 
 *     def Polrev(self, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Polrev(x, v): Convert x into a polynomial with main variable v and
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.Polrev", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2423
 *         return P.new_gen(gtopolyrev(self.g, P.get_var(v)))
 * 
 *     def Qfb(gen a, b, c, D=0):             # <<<<<<<<<<<<<<
 *         """
 *         Qfb(a,b,c,D=0.): Returns the binary quadratic form
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_155Qfb(PyObject *__pyx_v_a, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_154Qfb[] = "\n        Qfb(a,b,c,D=0.): Returns the binary quadratic form\n        \n        .. math::\n        \n                                ax^2 + bxy + cy^2.         \n        \n        \n        The optional D is 0 by default and initializes Shank's distance if\n        `b^2 - 4ac > 0`.  The discriminant of the quadratic form must not\n        be a perfect square.\n        \n        .. note::\n\n           Negative definite forms are not implemented, so use their\n           positive definite counterparts instead. (I.e., if f is a\n           negative definite quadratic form, then -f is positive\n           definite.)\n        \n        INPUT:\n        \n        \n        -  ``a`` - gen\n        \n        -  ``b`` - gen\n        \n        -  ``c`` - gen\n        \n        -  ``D`` - gen (optional, defaults to 0)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - binary quadratic form\n        \n        \n        EXAMPLES::\n        \n            >>> pari(3).Qfb(7, 1)\n            Qfb(3, 7, 1, 0.E-19)\n            >>> pari(3).Qfb(7, 2)  # discriminant is 25\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_155Qfb(PyObject *__pyx_v_a, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_b = 0;
  PyObject *__pyx_v_c = 0;
  PyObject *__pyx_v_D = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Qfb (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_c,&__pyx_n_s_D,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_b)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("Qfb", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_D);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Qfb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_b = values[0];
    __pyx_v_c = values[1];
    __pyx_v_D = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Qfb", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.Qfb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_154Qfb(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_a), __pyx_v_b, __pyx_v_c, __pyx_v_D);

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_154Qfb(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_D) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Qfb", 0);

  /* "cypari_src/gen.pyx":2470
 *             PariError:  (5)
 *         """
 *         t0GEN(b); t1GEN(c); t2GEN(D)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(Qfb0(a.g, t0, t1, t2, prec))
 */
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_c); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_10cypari_src_3gen_t2GEN(__pyx_v_D); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":2471
 *         """
 *         t0GEN(b); t1GEN(c); t2GEN(D)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(Qfb0(a.g, t0, t1, t2, prec))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2472
 *         t0GEN(b); t1GEN(c); t2GEN(D)
 *         sig_on()
 *         return P.new_gen(Qfb0(a.g, t0, t1, t2, prec))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, Qfb0(__pyx_v_a->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, __pyx_v_10cypari_src_3gen_t2, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2423
 *         return P.new_gen(gtopolyrev(self.g, P.get_var(v)))
 * 
 *     def Qfb(gen a, b, c, D=0):             # <<<<<<<<<<<<<<
 *         """
 *         Qfb(a,b,c,D=0.): Returns the binary quadratic form
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.Qfb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2475
 * 
 * 
 *     def Ser(gen x, v=-1, long seriesprecision = 16):             # <<<<<<<<<<<<<<
 *         """
 *         Ser(x,v=x): Create a power series from x with main variable v and
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_157Ser(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_156Ser[] = "\n        Ser(x,v=x): Create a power series from x with main variable v and\n        return the result.\n        \n        - If x is a scalar, this gives a constant power series with\n          precision given by the default series precision, as returned\n          by get_series_precision().\n        \n        - If x is a polynomial, the precision is the greatest of\n          get_series_precision() and the degree of the polynomial.\n        \n        - If x is a vector, the precision is similarly given, and the\n          coefficients of the vector are understood to be the\n          coefficients of the power series starting from the constant\n          term (i.e. the reverse of the function Pol).\n        \n        .. warning::\n\n           This is *not* a substitution function. It will not\n           transform an object containing variables of higher priority\n           than v.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``v`` - PARI variable (default: x)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - PARI object of PARI type t_SER\n        \n        \n        EXAMPLES::\n        \n            >>> pari(2).Ser()\n            2 + O(x^16)\n            >>> x = pari([1,2,3,4,5])\n            >>> x.Ser()\n            1 + 2*x + 3*x^2 + 4*x^3 + 5*x^4 + O(x^5)\n            >>> f = x.Ser('v'); print(f)\n            1 + 2*v + 3*v^2 + 4*v^3 + 5*v^4 + O(v^5)\n            >>> pari(1)/f\n            1 - 2*v + v^2 + O(v^5)\n            >>> pari('x^5').Ser(seriesprecision = 20)\n            x^5 + O(x^25)\n            >>> pari('1/x').Ser(seriesprecision = 1)\n            x^-1 + O(x^0)\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_157Ser(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  long __pyx_v_seriesprecision;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Ser (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_seriesprecision,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_v);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seriesprecision);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Ser") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2475; __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_v = values[0];
    if (values[1]) {
      __pyx_v_seriesprecision = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_seriesprecision == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2475; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_seriesprecision = ((long)16);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Ser", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2475; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cypari_src.gen.gen.Ser", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_156Ser(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_v, __pyx_v_seriesprecision);

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_156Ser(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_v, long __pyx_v_seriesprecision) {
  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("Ser", 0);

  /* "cypari_src/gen.pyx":2528
 *             x^-1 + O(x^0)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gtoser(x.g, P.get_var(v), seriesprecision))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2529
 *         """
 *         sig_on()
 *         return P.new_gen(gtoser(x.g, P.get_var(v), seriesprecision))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gtoser(__pyx_v_x->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_v), __pyx_v_seriesprecision))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2475
 * 
 * 
 *     def Ser(gen x, v=-1, long seriesprecision = 16):             # <<<<<<<<<<<<<<
 *         """
 *         Ser(x,v=x): Create a power series from x with main variable v and
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.Ser", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2532
 * 
 * 
 *     def Set(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Set(x): convert x into a set, i.e. a row vector of strings in
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_159Set(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_158Set[] = "\n        Set(x): convert x into a set, i.e. a row vector of strings in\n        increasing lexicographic order.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - a vector of strings in increasing\n           lexicographic order.\n        \n        \n        EXAMPLES::\n        \n            >>> pari([1,5,2]).Set()\n            [\"1\", \"2\", \"5\"]\n            >>> pari([]).Set()     # the empty set\n            []\n            >>> pari([1,1,-1,-1,3,3]).Set()\n            [\"-1\", \"1\", \"3\"]\n            >>> pari(1).Set()\n            [\"1\"]\n            >>> pari('1/(x*y)').Set()\n            [\"1/(y*x)\"]\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_159Set(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Set (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_158Set(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_158Set(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Set", 0);

  /* "cypari_src/gen.pyx":2563
 *             ["1/(y*x)"]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gtoset(x.g))
 * 
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2564
 *         """
 *         sig_on()
 *         return P.new_gen(gtoset(x.g))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gtoset(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2532
 * 
 * 
 *     def Set(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Set(x): convert x into a set, i.e. a row vector of strings in
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.Set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2567
 * 
 * 
 *     def Str(self):             # <<<<<<<<<<<<<<
 *         """
 *         Str(self): Return the print representation of self as a PARI
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_161Str(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_160Str[] = "\n        Str(self): Return the print representation of self as a PARI\n        object.\n        \n        INPUT:\n        \n        \n        -  ``self`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - a PARI gen of type t_STR, i.e., a PARI\n           string\n        \n        \n        EXAMPLES::\n        \n            >>> pari([1,2,['abc',1]]).Str()\n            \"[1, 2, [abc, 1]]\"\n            >>> pari([1,1, 1.54]).Str()\n            \"[1, 1, 1.54000000000000]\"\n            >>> pari(1).Str()       # 1 is automatically converted to string rep\n            \"1\"\n            >>> x = pari('x')       # PARI variable \"x\"\n            >>> x.Str()             # is converted to string rep.\n            \"x\"\n            >>> x.Str().type()\n            't_STR'\n        ";
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_161Str(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Str (wrapper)", 0);
  __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_160Str(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

static PyObject *__pyx_pf_10cypari_src_3gen_3gen_160Str(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
  char *__pyx_v_c;
  struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_v = NULL;
  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("Str", 0);

  /* "cypari_src/gen.pyx":2600
 *         """
 *         cdef char* c
 *         sig_on()             # <<<<<<<<<<<<<<
 *         c = GENtostr(self.g)
 *         v = self.new_gen(strtoGENstr(c))
 */
  SIG_ON_MACRO();

  /* "cypari_src/gen.pyx":2601
 *         cdef char* c
 *         sig_on()
 *         c = GENtostr(self.g)             # <<<<<<<<<<<<<<
 *         v = self.new_gen(strtoGENstr(c))
 *         pari_free(c)
 */
  __pyx_v_c = GENtostr(__pyx_v_self->g);

  /* "cypari_src/gen.pyx":2602
 *         sig_on()
 *         c = GENtostr(self.g)
 *         v = self.new_gen(strtoGENstr(c))             # <<<<<<<<<<<<<<
 *         pari_free(c)
 *         return v
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, strtoGENstr(__pyx_v_c))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_v = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cypari_src/gen.pyx":2603
 *         c = GENtostr(self.g)
 *         v = self.new_gen(strtoGENstr(c))
 *         pari_free(c)             # <<<<<<<<<<<<<<
 *         return v
 * 
 */
  pari_free(__pyx_v_c);

  /* "cypari_src/gen.pyx":2604
 *         v = self.new_gen(strtoGENstr(c))
 *         pari_free(c)
 *         return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_v));
  __pyx_r = ((PyObject *)__pyx_v_v);
  goto __pyx_L0;

  /* "cypari_src/gen.pyx":2567
 * 
 * 
 *     def Str(self):             # <<<<<<<<<<<<<<
 *         """
 *         Str(self): Return the print representation of self as a PARI
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cypari_src.gen.gen.Str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cypari_src/gen.pyx":2607
 * 
 * 
 *     def Strchr(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Strchr(x): converts x to a string, translating each integer into a
 */

/* Python wrapper */
static PyObject *__pyx_pw_10cypari_src_3gen_3gen_163Strchr(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10cypari_src_3gen_3gen_162Strchr[] = "\n        Strchr(x): converts x to a string, translating each integer into a\n        character (in ASCII).\n        \n        .. note::\n\n           :meth:`.Vecsmall` is (essentially) the inverse to :meth:`.Strchr`.\n        \n        INPUT:\n        \n        \n        -  ``x`` - PARI vector of integers\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - a PARI string\n        \n        \n        EXAMPLES::\n        \n            >>> pari([65,66,123]).Strchr()\n            \"AB{\"\n            >>> pari('\"Sage\"').Vecsmall()   # pari('\"Sage\"') --> PARI t_STR\n            Vecsmall([83, 97, 103, 101])\n            >>> _.Strchr()\n            \"Sage\"\n            >>> pari([83, 97, 103, 101]).Strchr()\n            \"Sage\"\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_163Strchr(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("Strchr (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_162Strchr(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_162Strchr(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("Strchr", 0);

    /* "cypari_src/gen.pyx":2639
 *             "Sage"
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(Strchr(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":2640
 *         """
 *         sig_on()
 *         return P.new_gen(Strchr(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def Strexpand(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, Strchr(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2607
 * 
 * 
 *     def Strchr(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Strchr(x): converts x to a string, translating each integer into a
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.Strchr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":2642
 *         return P.new_gen(Strchr(x.g))
 * 
 *     def Strexpand(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Strexpand(x): Concatenate the entries of the vector x into a single
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_165Strexpand(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_164Strexpand[] = "\n        Strexpand(x): Concatenate the entries of the vector x into a single\n        string, performing tilde expansion.\n        \n        .. note::\n\n           I have no clue what the point of this function is. - William\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_165Strexpand(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("Strexpand (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_164Strexpand(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_164Strexpand(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("Strexpand", 0);

    /* "cypari_src/gen.pyx":2651
 *            I have no clue what the point of this function is. - William
 *         """
 *         if typ(x.g) != t_VEC:             # <<<<<<<<<<<<<<
 *             raise TypeError, "x must be of type t_VEC."
 *         sig_on()
 */
    __pyx_t_1 = ((typ(__pyx_v_x->g) != t_VEC) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":2652
 *         """
 *         if typ(x.g) != t_VEC:
 *             raise TypeError, "x must be of type t_VEC."             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(Strexpand(x.g))
 */
      __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_x_must_be_of_type_t_VEC, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":2653
 *         if typ(x.g) != t_VEC:
 *             raise TypeError, "x must be of type t_VEC."
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(Strexpand(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":2654
 *             raise TypeError, "x must be of type t_VEC."
 *         sig_on()
 *         return P.new_gen(Strexpand(x.g))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, Strexpand(__pyx_v_x->g))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2642
 *         return P.new_gen(Strchr(x.g))
 * 
 *     def Strexpand(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Strexpand(x): Concatenate the entries of the vector x into a single
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.Strexpand", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":2657
 * 
 * 
 *     def Strtex(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         Strtex(x): Translates the vector x of PARI gens to TeX format and
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_167Strtex(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_166Strtex[] = "\n        Strtex(x): Translates the vector x of PARI gens to TeX format and\n        returns the resulting concatenated strings as a PARI t_STR.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - PARI t_STR (string)\n        \n        \n        EXAMPLES::\n        \n            >>> v=pari('x^2')\n            >>> v.Strtex()\n            \"x^2\"\n            >>> v=pari(['1/x^2','x'])\n            >>> v.Strtex()\n            \"\\\\frac{1}{x^2}x\"\n            >>> v=pari(['1 + 1/x + 1/(y+1)','x-1'])\n            >>> v.Strtex()\n            \"\\\\frac{ \\\\left(y\\n + 2\\\\right)  x\\n + \\\\left(y\\n + 1\\\\right) }{ \\\\left(y\\n + 1\\\\right)  x}x\\n - 1\"\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_167Strtex(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("Strtex (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_166Strtex(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_166Strtex(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    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;
    Py_ssize_t __pyx_t_6;
    PyObject *__pyx_t_7 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("Strtex", 0);
    __Pyx_INCREF((PyObject *)__pyx_v_x);

    /* "cypari_src/gen.pyx":2686
 *             "\\frac{ \\left(y\n + 2\\right)  x\n + \\left(y\n + 1\\right) }{ \\left(y\n + 1\\right)  x}x\n - 1"
 *         """
 *         if typ(x.g) != t_VEC:             # <<<<<<<<<<<<<<
 *             x = P.vector(1, [x])
 *         sig_on()
 */
    __pyx_t_1 = ((typ(__pyx_v_x->g) != t_VEC) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":2687
 *         """
 *         if typ(x.g) != t_VEC:
 *             x = P.vector(1, [x])             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(Strtex(x.g))
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_10cypari_src_3gen_P), __pyx_n_s_vector); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(((PyObject *)__pyx_v_x));
      PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_x));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_x));
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_x, ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_2));
      __pyx_t_2 = 0;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":2688
 *         if typ(x.g) != t_VEC:
 *             x = P.vector(1, [x])
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(Strtex(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":2689
 *             x = P.vector(1, [x])
 *         sig_on()
 *         return P.new_gen(Strtex(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def printtex(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, Strtex(__pyx_v_x->g))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2657
 * 
 * 
 *     def Strtex(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         Strtex(x): Translates the vector x of PARI gens to TeX format and
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_AddTraceback("cypari_src.gen.gen.Strtex", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_x);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":2691
 *         return P.new_gen(Strtex(x.g))
 * 
 *     def printtex(gen x):             # <<<<<<<<<<<<<<
 *         return x.Strtex()
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_169printtex(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_169printtex(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("printtex (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_168printtex(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_168printtex(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("printtex", 0);

    /* "cypari_src/gen.pyx":2692
 * 
 *     def printtex(gen x):
 *         return x.Strtex()             # <<<<<<<<<<<<<<
 * 
 *     def Vec(gen x, long n = 0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_x), __pyx_n_s_Strtex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2691
 *         return P.new_gen(Strtex(x.g))
 * 
 *     def printtex(gen x):             # <<<<<<<<<<<<<<
 *         return x.Strtex()
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.printtex", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":2694
 *         return x.Strtex()
 * 
 *     def Vec(gen x, long n = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Transform the object `x` into a vector with minimal size `|n|`.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_171Vec(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_170Vec[] = "\n        Transform the object `x` into a vector with minimal size `|n|`.\n        \n        INPUT:\n        \n        - ``x`` -- gen\n        \n        - ``n`` -- Make the vector of minimal length `|n|`. If `n > 0`,\n          append zeros; if `n < 0`, prepend zeros.\n        \n        OUTPUT:\n        \n        A PARI vector (type ``t_VEC``)\n        \n        EXAMPLES::\n        \n            >>> pari(1).Vec()\n            [1]\n            >>> pari('x^3').Vec()\n            [1, 0, 0, 0]\n            >>> pari('x^3 + 3*x - 2').Vec()\n            [1, 0, 3, -2]\n            >>> pari([1,2,3]).Vec()\n            [1, 2, 3]\n            >>> pari('[1, 2; 3, 4]').Vec()\n            [[1, 3]~, [2, 4]~]\n            >>> pari('\"Sage\"').Vec()\n            [\"S\", \"a\", \"g\", \"e\"]\n            >>> pari('2*x^2 + 3*x^3 + O(x^5)').Vec()\n            [2, 3, 0]\n            >>> pari('2*x^-2 + 3*x^3 + O(x^5)').Vec()\n            [2, 0, 0, 0, 0, 3, 0]\n\n        Note the different term ordering for polynomials and series::\n\n            >>> pari('1 + x + 3*x^3 + O(x^5)').Vec()\n            [1, 1, 0, 3, 0]\n            >>> pari('1 + x + 3*x^3').Vec()\n            [3, 0, 1, 1]\n\n        We demonstate the `n` argument::\n\n            >>> pari([1,2,3,4]).Vec(2)\n            [1, 2, 3, 4]\n            >>> pari([1,2,3,4]).Vec(-2)\n            [1, 2, 3, 4]\n            >>> pari([1,2,3,4]).Vec(6)\n            [1, 2, 3, 4, 0, 0]\n            >>> pari([1,2,3,4]).Vec(-6)\n            [0, 0, 1, 2, 3, 4]\n\n        See also :meth:`Col` (create a column vector) and :meth:`Vecrev`\n        (create a vector in reversed order).\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_171Vec(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("Vec (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_n);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Vec") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2694; __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;
        }
      }
      if (values[0]) {
        __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_n = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("Vec", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.Vec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_170Vec(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_n);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_170Vec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("Vec", 0);

    /* "cypari_src/gen.pyx":2749
 *         (create a vector in reversed order).
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(_Vec_append(gtovec(x.g), gen_0, n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":2750
 *         """
 *         sig_on()
 *         return P.new_gen(_Vec_append(gtovec(x.g), gen_0, n))             # <<<<<<<<<<<<<<
 * 
 *     def Vecrev(gen x, long n = 0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_f_10cypari_src_3gen__Vec_append(gtovec(__pyx_v_x->g), gen_0, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2694
 *         return x.Strtex()
 * 
 *     def Vec(gen x, long n = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Transform the object `x` into a vector with minimal size `|n|`.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.Vec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":2752
 *         return P.new_gen(_Vec_append(gtovec(x.g), gen_0, n))
 * 
 *     def Vecrev(gen x, long n = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Transform the object `x` into a vector with minimal size `|n|`.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_173Vecrev(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_172Vecrev[] = "\n        Transform the object `x` into a vector with minimal size `|n|`.\n        The order of the resulting vector is reversed compared to :meth:`Vec`.\n        \n        INPUT:\n        \n        - ``x`` -- gen\n        \n        - ``n`` -- Make the vector of minimal length `|n|`. If `n > 0`,\n          prepend zeros; if `n < 0`, append zeros.\n        \n        OUTPUT:\n        \n        A PARI vector (type ``t_VEC``)\n        \n        EXAMPLES::\n        \n            >>> pari(1).Vecrev()\n            [1]\n            >>> pari('x^3').Vecrev()\n            [0, 0, 0, 1]\n            >>> pari('x^3 + 3*x - 2').Vecrev()\n            [-2, 3, 0, 1]\n            >>> pari([1, 2, 3]).Vecrev()\n            [3, 2, 1]\n            >>> pari('Col([1, 2, 3])').Vecrev()\n            [3, 2, 1]\n            >>> pari('[1, 2; 3, 4]').Vecrev()\n            [[2, 4]~, [1, 3]~]\n            >>> pari('\"Sage\"').Vecrev()\n            [\"e\", \"g\", \"a\", \"S\"]\n\n        We demonstate the `n` argument::\n\n            >>> pari([1,2,3,4]).Vecrev(2)\n            [4, 3, 2, 1]\n            >>> pari([1,2,3,4]).Vecrev(-2)\n            [4, 3, 2, 1]\n            >>> pari([1,2,3,4]).Vecrev(6)\n            [0, 0, 4, 3, 2, 1]\n            >>> pari([1,2,3,4]).Vecrev(-6)\n            [4, 3, 2, 1, 0, 0]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_173Vecrev(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("Vecrev (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_n);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Vecrev") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; __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;
        }
      }
      if (values[0]) {
        __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_n = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("Vecrev", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.Vecrev", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_172Vecrev(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_n);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_172Vecrev(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("Vecrev", 0);

    /* "cypari_src/gen.pyx":2796
 *             [4, 3, 2, 1, 0, 0]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(_Vec_append(gtovecrev(x.g), gen_0, -n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":2797
 *         """
 *         sig_on()
 *         return P.new_gen(_Vec_append(gtovecrev(x.g), gen_0, -n))             # <<<<<<<<<<<<<<
 * 
 *     def Vecsmall(gen x, long n = 0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_f_10cypari_src_3gen__Vec_append(gtovecrev(__pyx_v_x->g), gen_0, (-__pyx_v_n)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2752
 *         return P.new_gen(_Vec_append(gtovec(x.g), gen_0, n))
 * 
 *     def Vecrev(gen x, long n = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Transform the object `x` into a vector with minimal size `|n|`.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.Vecrev", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":2799
 *         return P.new_gen(_Vec_append(gtovecrev(x.g), gen_0, -n))
 * 
 *     def Vecsmall(gen x, long n = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Transform the object `x` into a ``t_VECSMALL`` with minimal size `|n|`.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_175Vecsmall(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_174Vecsmall[] = "\n        Transform the object `x` into a ``t_VECSMALL`` with minimal size `|n|`.\n        \n        INPUT:\n        \n        - ``x`` -- gen\n        \n        - ``n`` -- Make the vector of minimal length `|n|`. If `n > 0`,\n          append zeros; if `n < 0`, prepend zeros.\n        \n        OUTPUT:\n        \n        A PARI vector of small integers (type ``t_VECSMALL``)\n        \n        EXAMPLES::\n        \n            >>> pari([1,2,3]).Vecsmall()\n            Vecsmall([1, 2, 3])\n            >>> pari('\"Sage\"').Vecsmall()\n            Vecsmall([83, 97, 103, 101])\n            >>> pari(1234).Vecsmall()\n            Vecsmall([1234])\n            >>> pari('x^2 + 2*x + 3').Vecsmall()\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n\n        We demonstate the `n` argument::\n\n            >>> pari([1,2,3]).Vecsmall(2)\n            Vecsmall([1, 2, 3])\n            >>> pari([1,2,3]).Vecsmall(-2)\n            Vecsmall([1, 2, 3])\n            >>> pari([1,2,3]).Vecsmall(6)\n            Vecsmall([1, 2, 3, 0, 0, 0])\n            >>> pari([1,2,3]).Vecsmall(-6)\n            Vecsmall([0, 0, 0, 1, 2, 3])\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_175Vecsmall(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("Vecsmall (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_n);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Vecsmall") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; __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;
        }
      }
      if (values[0]) {
        __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_n = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("Vecsmall", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.Vecsmall", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_174Vecsmall(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_n);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_174Vecsmall(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("Vecsmall", 0);

    /* "cypari_src/gen.pyx":2838
 *             Vecsmall([0, 0, 0, 1, 2, 3])
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(_Vec_append(gtovecsmall(x.g), <GEN>0, n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":2839
 *         """
 *         sig_on()
 *         return P.new_gen(_Vec_append(gtovecsmall(x.g), <GEN>0, n))             # <<<<<<<<<<<<<<
 * 
 *     def binary(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_f_10cypari_src_3gen__Vec_append(gtovecsmall(__pyx_v_x->g), ((GEN)0), __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2799
 *         return P.new_gen(_Vec_append(gtovecrev(x.g), gen_0, -n))
 * 
 *     def Vecsmall(gen x, long n = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Transform the object `x` into a ``t_VECSMALL`` with minimal size `|n|`.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.Vecsmall", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":2841
 *         return P.new_gen(_Vec_append(gtovecsmall(x.g), <GEN>0, n))
 * 
 *     def binary(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         binary(x): gives the vector formed by the binary digits of abs(x),
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_177binary(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_176binary[] = "\n        binary(x): gives the vector formed by the binary digits of abs(x),\n        where x is of type t_INT.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen of type t_INT\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - of type t_VEC\n        \n        \n        EXAMPLES::\n        \n            >>> pari(0).binary()\n            [0]\n            >>> pari(-5).binary()\n            [1, 0, 1]\n            >>> pari(5).binary()\n            [1, 0, 1]\n            >>> pari(2005).binary()\n            [1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1]\n        \n        ::\n        \n            >>> pari('\"2\"').binary()\n            Traceback (most recent call last):\n            ...\n            TypeError: x (=\"2\") must be of type t_INT, but is of type t_STR.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_177binary(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("binary (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_176binary(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_176binary(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("binary", 0);

    /* "cypari_src/gen.pyx":2876
 *             TypeError: x (="2") must be of type t_INT, but is of type t_STR.
 *         """
 *         if typ(x.g) != t_INT:             # <<<<<<<<<<<<<<
 *             raise TypeError, "x (=%s) must be of type t_INT, but is of type %s."%(x,x.type())
 *         sig_on()
 */
    __pyx_t_1 = ((typ(__pyx_v_x->g) != t_INT) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":2877
 *         """
 *         if typ(x.g) != t_INT:
 *             raise TypeError, "x (=%s) must be of type t_INT, but is of type %s."%(x,x.type())             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(binaire(x.g))
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_x), __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __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 = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_x));
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_x));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_x));
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_x_s_must_be_of_type_t_INT_but_is, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_2, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":2878
 *         if typ(x.g) != t_INT:
 *             raise TypeError, "x (=%s) must be of type t_INT, but is of type %s."%(x,x.type())
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(binaire(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":2879
 *             raise TypeError, "x (=%s) must be of type t_INT, but is of type %s."%(x,x.type())
 *         sig_on()
 *         return P.new_gen(binaire(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def bitand(gen x, y):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, binaire(__pyx_v_x->g))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2841
 *         return P.new_gen(_Vec_append(gtovecsmall(x.g), <GEN>0, n))
 * 
 *     def binary(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         binary(x): gives the vector formed by the binary digits of abs(x),
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.binary", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":2881
 *         return P.new_gen(binaire(x.g))
 * 
 *     def bitand(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         bitand(x,y): Bitwise and of two integers x and y. Negative numbers
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_179bitand(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_178bitand[] = "\n        bitand(x,y): Bitwise and of two integers x and y. Negative numbers\n        behave as if modulo some large power of 2.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (of type t_INT)\n        \n        -  ``y`` - coercible to gen (of type t_INT)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - of type type t_INT\n        \n        \n        EXAMPLES::\n        \n            >>> pari(8).bitand(4)\n            0\n            >>> pari(8).bitand(8)\n            8\n            >>> pari(6).binary()\n            [1, 1, 0]\n            >>> pari(7).binary()\n            [1, 1, 1]\n            >>> pari(6).bitand(7)\n            6\n            >>> pari(19).bitand(-1)\n            19\n            >>> pari(-1).bitand(-1)\n            -1\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_179bitand(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bitand (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_178bitand(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_178bitand(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
    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("bitand", 0);

    /* "cypari_src/gen.pyx":2917
 *             -1
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gbitand(x.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":2918
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gbitand(x.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":2919
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(gbitand(x.g, t0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gbitand(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2881
 *         return P.new_gen(binaire(x.g))
 * 
 *     def bitand(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         bitand(x,y): Bitwise and of two integers x and y. Negative numbers
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bitand", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":2922
 * 
 * 
 *     def bitneg(gen x, long n=-1):             # <<<<<<<<<<<<<<
 *         r"""
 *         bitneg(x,n=-1): Bitwise negation of the integer x truncated to n
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_181bitneg(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_180bitneg[] = "\n        bitneg(x,n=-1): Bitwise negation of the integer x truncated to n\n        bits. n=-1 (the default) represents an infinite sequence of the bit\n        1. Negative numbers behave as if modulo some large power of 2.\n        \n        With n=-1, this function returns -n-1. With n = 0, it returns a\n        number a such that `a\\cong -n-1 \\pmod{2^n}`.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (t_INT)\n        \n        -  ``n`` - long, default = -1\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - t_INT\n        \n        \n        EXAMPLES::\n        \n            >>> pari(10).bitneg()\n            -11\n            >>> pari(1).bitneg()\n            -2\n            >>> pari(-2).bitneg()\n            1\n            >>> pari(-1).bitneg()\n            0\n            >>> pari(569).bitneg()\n            -570\n            >>> pari(569).bitneg(10)\n            454\n            >>> 454 % 2**10\n            454\n            >>> -570 % 2**10\n            454\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_181bitneg(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bitneg (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_n);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bitneg") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __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;
        }
      }
      if (values[0]) {
        __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_n = ((long)-1);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("bitneg", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.bitneg", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_180bitneg(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_n);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_180bitneg(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("bitneg", 0);

    /* "cypari_src/gen.pyx":2964
 *             454
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gbitneg(x.g,n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":2965
 *         """
 *         sig_on()
 *         return P.new_gen(gbitneg(x.g,n))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gbitneg(__pyx_v_x->g, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2922
 * 
 * 
 *     def bitneg(gen x, long n=-1):             # <<<<<<<<<<<<<<
 *         r"""
 *         bitneg(x,n=-1): Bitwise negation of the integer x truncated to n
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bitneg", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":2968
 * 
 * 
 *     def bitnegimply(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         bitnegimply(x,y): Bitwise negated imply of two integers x and y, in
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_183bitnegimply(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_182bitnegimply[] = "\n        bitnegimply(x,y): Bitwise negated imply of two integers x and y, in\n        other words, x BITAND BITNEG(y). Negative numbers behave as if\n        modulo big power of 2.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (of type t_INT)\n        \n        -  ``y`` - coercible to gen (of type t_INT)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - of type type t_INT\n        \n        \n        EXAMPLES::\n        \n            >>> pari(14).bitnegimply(0)    \n            14\n            >>> pari(8).bitnegimply(8)\n            0\n            >>> pari(8+4).bitnegimply(8)\n            4\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_183bitnegimply(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bitnegimply (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_182bitnegimply(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_182bitnegimply(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
    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("bitnegimply", 0);

    /* "cypari_src/gen.pyx":2997
 *             4
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gbitnegimply(x.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":2998
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gbitnegimply(x.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":2999
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(gbitnegimply(x.g, t0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gbitnegimply(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":2968
 * 
 * 
 *     def bitnegimply(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         bitnegimply(x,y): Bitwise negated imply of two integers x and y, in
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bitnegimply", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3002
 * 
 * 
 *     def bitor(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         bitor(x,y): Bitwise or of two integers x and y. Negative numbers
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_185bitor(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_184bitor[] = "\n        bitor(x,y): Bitwise or of two integers x and y. Negative numbers\n        behave as if modulo big power of 2.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (of type t_INT)\n        \n        -  ``y`` - coercible to gen (of type t_INT)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - of type type t_INT\n        \n        \n        EXAMPLES::\n        \n            >>> pari(14).bitor(0)\n            14\n            >>> pari(8).bitor(4)\n            12\n            >>> pari(12).bitor(1)\n            13\n            >>> pari(13).bitor(1)\n            13\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_185bitor(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bitor (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_184bitor(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_184bitor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
    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("bitor", 0);

    /* "cypari_src/gen.pyx":3032
 *             13
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gbitor(x.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":3033
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gbitor(x.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3034
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(gbitor(x.g, t0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gbitor(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3002
 * 
 * 
 *     def bitor(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         bitor(x,y): Bitwise or of two integers x and y. Negative numbers
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3037
 * 
 * 
 *     def bittest(gen x, long n):             # <<<<<<<<<<<<<<
 *         """
 *         bittest(x, long n): Returns bit number n (coefficient of
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_187bittest(PyObject *__pyx_v_x, PyObject *__pyx_arg_n); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_186bittest[] = "\n        bittest(x, long n): Returns bit number n (coefficient of\n        `2^n` in binary) of the integer x. Negative numbers behave\n        as if modulo a big power of 2.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (pari integer)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``bool`` - a Python bool\n        \n        \n        EXAMPLES::\n        \n            >>> x = pari(6)\n            >>> x.bittest(0)\n            False\n            >>> x.bittest(1)\n            True\n            >>> x.bittest(2)\n            True\n            >>> x.bittest(3)\n            False\n            >>> pari(-3).bittest(0)\n            True\n            >>> pari(-3).bittest(1)\n            False\n            >>> [pari(-3).bittest(n) for n in range(10)]\n            [True, False, True, True, True, True, True, True, True, True]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_187bittest(PyObject *__pyx_v_x, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bittest (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.bittest", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_186bittest(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_186bittest(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
    PyObject *__pyx_v_b = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("bittest", 0);

    /* "cypari_src/gen.pyx":3073
 *             [True, False, True, True, True, True, True, True, True, True]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         b = bool(bittest(x.g, n))
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3074
 *         """
 *         sig_on()
 *         b = bool(bittest(x.g, n))             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return b
 */
    __pyx_t_1 = __Pyx_PyInt_From_long(bittest(__pyx_v_x->g, __pyx_v_n)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_b = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":3075
 *         sig_on()
 *         b = bool(bittest(x.g, n))
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return b
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":3076
 *         b = bool(bittest(x.g, n))
 *         sig_off()
 *         return b             # <<<<<<<<<<<<<<
 * 
 *     def bitxor(gen x, y):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_b);
    __pyx_r = __pyx_v_b;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3037
 * 
 * 
 *     def bittest(gen x, long n):             # <<<<<<<<<<<<<<
 *         """
 *         bittest(x, long n): Returns bit number n (coefficient of
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bittest", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_b);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3078
 *         return b
 * 
 *     def bitxor(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         bitxor(x,y): Bitwise exclusive or of two integers x and y. Negative
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_189bitxor(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_188bitxor[] = "\n        bitxor(x,y): Bitwise exclusive or of two integers x and y. Negative\n        numbers behave as if modulo big power of 2.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (of type t_INT)\n        \n        -  ``y`` - coercible to gen (of type t_INT)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - of type type t_INT\n        \n        \n        EXAMPLES::\n        \n            >>> pari(6).bitxor(4)\n            2\n            >>> pari(0).bitxor(4)\n            4\n            >>> pari(6).bitxor(0)\n            6\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_189bitxor(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bitxor (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_188bitxor(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_188bitxor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
    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("bitxor", 0);

    /* "cypari_src/gen.pyx":3106
 *             6
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gbitxor(x.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":3107
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gbitxor(x.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3108
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(gbitxor(x.g, t0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gbitxor(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3078
 *         return b
 * 
 *     def bitxor(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         bitxor(x,y): Bitwise exclusive or of two integers x and y. Negative
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bitxor", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3111
 * 
 * 
 *     def ceil(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         For real x: return the smallest integer = x. For rational
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_191ceil(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_190ceil[] = "\n        For real x: return the smallest integer = x. For rational\n        functions: the quotient of numerator by denominator. For lists:\n        apply componentwise.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - depends on type of x\n        \n        \n        EXAMPLES::\n        \n            >>> pari(1.4).ceil()\n            2\n            >>> pari(-1.4).ceil()\n            -1\n            >>> pari('3/4').ceil()\n            1\n            >>> pari('x').ceil()\n            x\n            >>> pari('(x^2+x+1)/x').ceil()\n            x + 1\n        \n        This may be unexpected: but it is correct, treating the argument as\n        a rational function in RR(x).\n        \n        ::\n        \n            >>> pari('x^2+5*x+2.5').ceil()\n            x^2 + 5*x + 2.50000000000000\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_191ceil(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_190ceil(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_190ceil(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ceil", 0);

    /* "cypari_src/gen.pyx":3150
 *             x^2 + 5*x + 2.50000000000000
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gceil(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3151
 *         """
 *         sig_on()
 *         return P.new_gen(gceil(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def centerlift(gen x, v=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gceil(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3111
 * 
 * 
 *     def ceil(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         For real x: return the smallest integer = x. For rational
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3153
 *         return P.new_gen(gceil(x.g))
 * 
 *     def centerlift(gen x, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         centerlift(x,v): Centered lift of x. This function returns exactly
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_193centerlift(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_192centerlift[] = "\n        centerlift(x,v): Centered lift of x. This function returns exactly\n        the same thing as lift, except if x is an integer mod.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``v`` - var (default: x)\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> x = pari(-2).Mod(5)\n            >>> x.centerlift()\n            -2\n            >>> x.lift()\n            3\n            >>> f = pari('x-1').Mod('x^2 + 1')\n            >>> f.centerlift()\n            x - 1\n            >>> f.lift()\n            x - 1\n            >>> f = pari('x-y').Mod('x^2+1')\n            >>> f\n            Mod(x - y, x^2 + 1)\n            >>> f.centerlift('x')\n            x - y\n            >>> f.centerlift('y')\n            Mod(x - y, x^2 + 1)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_193centerlift(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("centerlift (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_v);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "centerlift") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __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_v = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("centerlift", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3153; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.centerlift", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_192centerlift(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_192centerlift(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_v) {
    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("centerlift", 0);

    /* "cypari_src/gen.pyx":3188
 *             Mod(x - y, x^2 + 1)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(centerlift0(x.g, P.get_var(v)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3189
 *         """
 *         sig_on()
 *         return P.new_gen(centerlift0(x.g, P.get_var(v)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, centerlift0(__pyx_v_x->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_v)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3153
 *         return P.new_gen(gceil(x.g))
 * 
 *     def centerlift(gen x, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         centerlift(x,v): Centered lift of x. This function returns exactly
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.centerlift", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3192
 * 
 * 
 *     def component(gen x, long n):             # <<<<<<<<<<<<<<
 *         """
 *         component(x, long n): Return n'th component of the internal
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_195component(PyObject *__pyx_v_x, PyObject *__pyx_arg_n); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_194component[] = "\n        component(x, long n): Return n'th component of the internal\n        representation of x. This function is 1-based instead of 0-based.\n        \n        .. note::\n\n           For vectors or matrices, it is simpler to use x[n-1]. For\n           list objects such as is output by nfinit, it is easier to\n           use member functions.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``n`` - C long (coercible to)\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari([0,1,2,3,4]).component(1)\n            0\n            >>> pari([0,1,2,3,4]).component(2)\n            1\n            >>> pari([0,1,2,3,4]).component(4)\n            3\n            >>> pari('x^3 + 2').component(1)\n            2\n            >>> pari('x^3 + 2').component(2)\n            0\n            >>> pari('x^3 + 2').component(4)\n            1\n        \n        ::\n        \n            >>> pari('x').component(0)\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_195component(PyObject *__pyx_v_x, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("component (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.component", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_194component(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_194component(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("component", 0);

    /* "cypari_src/gen.pyx":3235
 *             PariError:  (5)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(compo(x.g, n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3236
 *         """
 *         sig_on()
 *         return P.new_gen(compo(x.g, n))             # <<<<<<<<<<<<<<
 * 
 *     def conj(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, compo(__pyx_v_x->g, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3192
 * 
 * 
 *     def component(gen x, long n):             # <<<<<<<<<<<<<<
 *         """
 *         component(x, long n): Return n'th component of the internal
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.component", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3238
 *         return P.new_gen(compo(x.g, n))
 * 
 *     def conj(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         conj(x): Return the algebraic conjugate of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_197conj(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_196conj[] = "\n        conj(x): Return the algebraic conjugate of x.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('x+1').conj()\n            x + 1\n            >>> pari('x+I').conj()\n            x - I\n            >>> pari('1/(2*x+3*I)').conj()\n            1/(2*x - 3*I)\n            >>> pari([1,2,'2-I','Mod(x,x^2+1)', 'Mod(x,x^2-2)']).conj()\n            [1, 2, 2 + I, Mod(-x, x^2 + 1), Mod(-x, x^2 - 2)]\n            >>> pari('Mod(x,x^2-2)').conj()\n            Mod(-x, x^2 - 2)\n            >>> pari('Mod(x,x^3-3)').conj()\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_197conj(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("conj (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_196conj(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_196conj(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("conj", 0);

    /* "cypari_src/gen.pyx":3267
 *             PariError: incorrect type (11)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gconj(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3268
 *         """
 *         sig_on()
 *         return P.new_gen(gconj(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def conjvec(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gconj(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3238
 *         return P.new_gen(compo(x.g, n))
 * 
 *     def conj(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         conj(x): Return the algebraic conjugate of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.conj", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3270
 *         return P.new_gen(gconj(x.g))
 * 
 *     def conjvec(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         conjvec(x): Returns the vector of all conjugates of the algebraic
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_199conjvec(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_198conjvec[] = "\n        conjvec(x): Returns the vector of all conjugates of the algebraic\n        number x. An algebraic number is a polynomial over Q modulo an\n        irreducible polynomial.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('Mod(1+x,x^2-2)').conjvec()\n            [-0.414213562373095, 2.41421356237310]~\n            >>> pari('Mod(x,x^3-3)').conjvec()\n            [1.44224957030741, -0.721124785153704 + 1.24902476648341*I, -0.721124785153704 - 1.24902476648341*I]~\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_199conjvec(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("conjvec (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_198conjvec(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_198conjvec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("conjvec", 0);

    /* "cypari_src/gen.pyx":3291
 *             [1.44224957030741, -0.721124785153704 + 1.24902476648341*I, -0.721124785153704 - 1.24902476648341*I]~
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(conjvec(x.g, prec))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3292
 *         """
 *         sig_on()
 *         return P.new_gen(conjvec(x.g, prec))             # <<<<<<<<<<<<<<
 * 
 *     def denominator(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, conjvec(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3270
 *         return P.new_gen(gconj(x.g))
 * 
 *     def conjvec(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         conjvec(x): Returns the vector of all conjugates of the algebraic
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.conjvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3294
 *         return P.new_gen(conjvec(x.g, prec))
 * 
 *     def denominator(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         denominator(x): Return the denominator of x. When x is a vector,
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_201denominator(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_200denominator[] = "\n        denominator(x): Return the denominator of x. When x is a vector,\n        this is the least common multiple of the denominators of the\n        components of x.\n        \n        what about poly? INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('5/9').denominator()\n            9\n            >>> pari('(x+1)/(x-2)').denominator()\n            x - 2\n            >>> pari('2/3 + 5/8*x + 7/3*x^2 + 1/5*y').denominator()\n            1\n            >>> pari('2/3*x').denominator()\n            1\n            >>> pari('[2/3, 5/8, 7/3, 1/5]').denominator()\n            120\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_201denominator(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("denominator (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_200denominator(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_200denominator(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("denominator", 0);

    /* "cypari_src/gen.pyx":3321
 *             120
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(denom(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3322
 *         """
 *         sig_on()
 *         return P.new_gen(denom(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def floor(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, denom(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3294
 *         return P.new_gen(conjvec(x.g, prec))
 * 
 *     def denominator(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         denominator(x): Return the denominator of x. When x is a vector,
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.denominator", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3324
 *         return P.new_gen(denom(x.g))
 * 
 *     def floor(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         For real x: return the largest integer = x. For rational functions:
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_203floor(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_202floor[] = "\n        For real x: return the largest integer = x. For rational functions:\n        the quotient of numerator by denominator. For lists: apply\n        componentwise.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('5/9').floor()\n            0\n            >>> pari('11/9').floor()\n            1\n            >>> pari(1.17).floor()\n            1\n            >>> pari([1.5,2.3,4.99]).floor()\n            [1, 2, 4]\n            >>> pari([[1.1,2.2],[3.3,4.4]]).floor()\n            [[1, 2], [3, 4]]\n            >>> pari('x').floor()\n            x\n            >>> pari('(x^2+x+1)/x').floor()\n            x + 1\n            >>> pari('x^2+5*x+2.5').floor()\n            x^2 + 5*x + 2.50000000000000\n        \n        ::\n        \n            >>> pari('\"hello world\"').floor()\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_203floor(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("floor (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_202floor(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_202floor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("floor", 0);

    /* "cypari_src/gen.pyx":3364
 *             PariError: incorrect type (11)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gfloor(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3365
 *         """
 *         sig_on()
 *         return P.new_gen(gfloor(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def frac(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gfloor(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3324
 *         return P.new_gen(denom(x.g))
 * 
 *     def floor(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         For real x: return the largest integer = x. For rational functions:
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3367
 *         return P.new_gen(gfloor(x.g))
 * 
 *     def frac(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         frac(x): Return the fractional part of x, which is x - floor(x).
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_205frac(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_204frac[] = "\n        frac(x): Return the fractional part of x, which is x - floor(x).\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari(1.75).frac()\n            0.750000000000000\n            >>> pari('sqrt(2)').frac()\n            0.414213562373095\n            >>> pari('sqrt(-2)').frac()\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_205frac(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("frac (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_204frac(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_204frac(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("frac", 0);

    /* "cypari_src/gen.pyx":3390
 *             PariError: incorrect type (11)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gfrac(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3391
 *         """
 *         sig_on()
 *         return P.new_gen(gfrac(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def imag(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gfrac(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3367
 *         return P.new_gen(gfloor(x.g))
 * 
 *     def frac(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         frac(x): Return the fractional part of x, which is x - floor(x).
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.frac", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3393
 *         return P.new_gen(gfrac(x.g))
 * 
 *     def imag(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         imag(x): Return the imaginary part of x. This function also works
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_207imag(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_206imag[] = "\n        imag(x): Return the imaginary part of x. This function also works\n        component-wise.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('1+2*I').imag()\n            2\n            >>> pari('sqrt(-2)').imag()\n            1.41421356237310\n            >>> pari('x+I').imag()\n            1\n            >>> pari('x+2*I').imag()\n            2\n            >>> pari('(1+I)*x^2+2*I').imag()\n            x^2 + 2\n            >>> pari('[1,2,3] + [4*I,5,6]').imag()\n            [4, 0, 0]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_207imag(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("imag (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_206imag(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_206imag(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("imag", 0);

    /* "cypari_src/gen.pyx":3421
 *             [4, 0, 0]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gimag(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3422
 *         """
 *         sig_on()
 *         return P.new_gen(gimag(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def length(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gimag(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3393
 *         return P.new_gen(gfrac(x.g))
 * 
 *     def imag(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         imag(x): Return the imaginary part of x. This function also works
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.imag", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3424
 *         return P.new_gen(gimag(x.g))
 * 
 *     def length(self):             # <<<<<<<<<<<<<<
 *         """
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_209length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_208length[] = "\n        \n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_209length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("length (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_208length(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_208length(struct __pyx_obj_10cypari_src_3gen_gen *__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("length", 0);

    /* "cypari_src/gen.pyx":3428
 * 
 *         """
 *         return glength(self.g)             # <<<<<<<<<<<<<<
 * 
 *     def lift(gen x, v=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(glength(__pyx_v_self->g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3424
 *         return P.new_gen(gimag(x.g))
 * 
 *     def length(self):             # <<<<<<<<<<<<<<
 *         """
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.length", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3430
 *         return glength(self.g)
 * 
 *     def lift(gen x, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         lift(x,v): Returns the lift of an element of Z/nZ to Z or R[x]/(P)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_211lift(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_210lift[] = "\n        lift(x,v): Returns the lift of an element of Z/nZ to Z or R[x]/(P)\n        to R[x] for a type R if v is omitted. If v is given, lift only\n        polymods with main variable v. If v does not occur in x, lift only\n        intmods.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``v`` - (optional) variable\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> x = pari(\"x\")\n            >>> a = x.Mod('x^3 + 17*x + 3')\n            >>> a\n            Mod(x, x^3 + 17*x + 3)\n            >>> b = a**4; b\n            Mod(-17*x^2 - 3*x, x^3 + 17*x + 3)\n            >>> b.lift()\n            -17*x^2 - 3*x\n        \n        \077\077? more examples\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_211lift(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("lift (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_v);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lift") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3430; __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_v = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("lift", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.lift", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_210lift(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_210lift(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_v) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("lift", 0);

    /* "cypari_src/gen.pyx":3460
 *         ??? more examples
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if v == -1:
 *             return P.new_gen(lift(x.g))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3461
 *         """
 *         sig_on()
 *         if v == -1:             # <<<<<<<<<<<<<<
 *             return P.new_gen(lift(x.g))
 *         return P.new_gen(lift0(x.g, P.get_var(v)))
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_v, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3461; __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 = 3461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":3462
 *         sig_on()
 *         if v == -1:
 *             return P.new_gen(lift(x.g))             # <<<<<<<<<<<<<<
 *         return P.new_gen(lift0(x.g, P.get_var(v)))
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, lift(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":3463
 *         if v == -1:
 *             return P.new_gen(lift(x.g))
 *         return P.new_gen(lift0(x.g, P.get_var(v)))             # <<<<<<<<<<<<<<
 * 
 *     def numbpart(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, lift0(__pyx_v_x->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_v)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3430
 *         return glength(self.g)
 * 
 *     def lift(gen x, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         lift(x,v): Returns the lift of an element of Z/nZ to Z or R[x]/(P)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.lift", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3465
 *         return P.new_gen(lift0(x.g, P.get_var(v)))
 * 
 *     def numbpart(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         numbpart(x): returns the number of partitions of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_213numbpart(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_212numbpart[] = "\n        numbpart(x): returns the number of partitions of x.\n        \n        EXAMPLES::\n        \n            >>> pari(20).numbpart()\n            627\n            >>> pari(100).numbpart()\n            190569292\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_213numbpart(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("numbpart (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_212numbpart(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_212numbpart(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("numbpart", 0);

    /* "cypari_src/gen.pyx":3476
 *             190569292
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(numbpart(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3477
 *         """
 *         sig_on()
 *         return P.new_gen(numbpart(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def numerator(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, numbpart(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3465
 *         return P.new_gen(lift0(x.g, P.get_var(v)))
 * 
 *     def numbpart(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         numbpart(x): returns the number of partitions of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.numbpart", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3479
 *         return P.new_gen(numbpart(x.g))
 * 
 *     def numerator(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         numerator(x): Returns the numerator of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_215numerator(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_214numerator[] = "\n        numerator(x): Returns the numerator of x.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES:\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_215numerator(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("numerator (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_214numerator(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_214numerator(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("numerator", 0);

    /* "cypari_src/gen.pyx":3493
 *         EXAMPLES:
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(numer(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3494
 *         """
 *         sig_on()
 *         return P.new_gen(numer(x.g))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, numer(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3479
 *         return P.new_gen(numbpart(x.g))
 * 
 *     def numerator(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         numerator(x): Returns the numerator of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.numerator", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3497
 * 
 * 
 *     def numtoperm(gen k, long n):             # <<<<<<<<<<<<<<
 *         """
 *         numtoperm(k, n): Return the permutation number k (mod n!) of n
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_217numtoperm(PyObject *__pyx_v_k, PyObject *__pyx_arg_n); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_216numtoperm[] = "\n        numtoperm(k, n): Return the permutation number k (mod n!) of n\n        letters, where n is an integer.\n        \n        INPUT:\n        \n        \n        -  ``k`` - gen, integer\n        \n        -  ``n`` - int\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - vector (permutation of 1,...,n)\n        \n        \n        EXAMPLES:\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_217numtoperm(PyObject *__pyx_v_k, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("numtoperm (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.numtoperm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_216numtoperm(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_k), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_216numtoperm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_k, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("numtoperm", 0);

    /* "cypari_src/gen.pyx":3518
 *         EXAMPLES:
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(numtoperm(n, k.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3519
 *         """
 *         sig_on()
 *         return P.new_gen(numtoperm(n, k.g))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, numtoperm(__pyx_v_n, __pyx_v_k->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3497
 * 
 * 
 *     def numtoperm(gen k, long n):             # <<<<<<<<<<<<<<
 *         """
 *         numtoperm(k, n): Return the permutation number k (mod n!) of n
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.numtoperm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3522
 * 
 * 
 *     def padicprec(gen x, p):             # <<<<<<<<<<<<<<
 *         """
 *         padicprec(x,p): Return the absolute p-adic precision of the object
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_219padicprec(PyObject *__pyx_v_x, PyObject *__pyx_v_p); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_218padicprec[] = "\n        padicprec(x,p): Return the absolute p-adic precision of the object\n        x.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: int\n        \n        EXAMPLES::\n\n            >>> y = pari('11^-10 + 5*11^-7 + 11^-6 +O(11^-5)')\n            >>> y.padicprec(11)\n            -5\n            >>> y.padicprec(17)\n            Traceback (most recent call last):\n            ...\n            ValueError: not the same prime in padicprec\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_219padicprec(PyObject *__pyx_v_x, PyObject *__pyx_v_p) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("padicprec (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_218padicprec(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_p));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_218padicprec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_p) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v__p = 0;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    int __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("padicprec", 0);

    /* "cypari_src/gen.pyx":3546
 *         """
 *         cdef gen _p
 *         _p = pari(p)             # <<<<<<<<<<<<<<
 *         if typ(_p.g) != t_INT:
 *             raise TypeError("p (=%s) must be of type t_INT, but is of type %s."%(
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_p);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_p);
      __Pyx_GIVEREF(__pyx_v_p);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v__p = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":3547
 *         cdef gen _p
 *         _p = pari(p)
 *         if typ(_p.g) != t_INT:             # <<<<<<<<<<<<<<
 *             raise TypeError("p (=%s) must be of type t_INT, but is of type %s."%(
 *                 _p, _p.type()))
 */
    __pyx_t_5 = ((typ(__pyx_v__p->g) != t_INT) != 0);
    if (__pyx_t_5) {

      /* "cypari_src/gen.pyx":3549
 *         if typ(_p.g) != t_INT:
 *             raise TypeError("p (=%s) must be of type t_INT, but is of type %s."%(
 *                 _p, _p.type()))             # <<<<<<<<<<<<<<
 *         if not gequal(gel(x.g, 2), _p.g):
 *             raise ValueError("not the same prime in padicprec")
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v__p), __pyx_n_s_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3549; __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 = 3549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v__p));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v__p));
      __Pyx_GIVEREF(((PyObject *)__pyx_v__p));
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":3548
 *         _p = pari(p)
 *         if typ(_p.g) != t_INT:
 *             raise TypeError("p (=%s) must be of type t_INT, but is of type %s."%(             # <<<<<<<<<<<<<<
 *                 _p, _p.type()))
 *         if not gequal(gel(x.g, 2), _p.g):
 */
      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_p_s_must_be_of_type_t_INT_but_is, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3548; __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(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3548; __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 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":3550
 *             raise TypeError("p (=%s) must be of type t_INT, but is of type %s."%(
 *                 _p, _p.type()))
 *         if not gequal(gel(x.g, 2), _p.g):             # <<<<<<<<<<<<<<
 *             raise ValueError("not the same prime in padicprec")
 *         return padicprec(x.g, _p.g)
 */
    __pyx_t_5 = ((!(gequal(gel(__pyx_v_x->g, 2), __pyx_v__p->g) != 0)) != 0);
    if (__pyx_t_5) {

      /* "cypari_src/gen.pyx":3551
 *                 _p, _p.type()))
 *         if not gequal(gel(x.g, 2), _p.g):
 *             raise ValueError("not the same prime in padicprec")             # <<<<<<<<<<<<<<
 *         return padicprec(x.g, _p.g)
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":3552
 *         if not gequal(gel(x.g, 2), _p.g):
 *             raise ValueError("not the same prime in padicprec")
 *         return padicprec(x.g, _p.g)             # <<<<<<<<<<<<<<
 * 
 *     def padicprime(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(padicprec(__pyx_v_x->g, __pyx_v__p->g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3522
 * 
 * 
 *     def padicprec(gen x, p):             # <<<<<<<<<<<<<<
 *         """
 *         padicprec(x,p): Return the absolute p-adic precision of the object
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.padicprec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v__p);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3554
 *         return padicprec(x.g, _p.g)
 * 
 *     def padicprime(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         The uniformizer of the p-adic ring this element lies in, as a t_INT.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_221padicprime(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_220padicprime[] = "\n        The uniformizer of the p-adic ring this element lies in, as a t_INT.\n\n        INPUT:\n\n        - ``x`` - gen, of type t_PADIC\n\n        OUTPUT:\n\n        - ``p`` - gen, of type t_INT\n\n        EXAMPLES::\n\n            >>> x = pari('11^-10 + 5*11^-7 + 11^-6 + O(11^-5)')\n            >>> x.padicprime()\n            11\n            >>> x.padicprime().type()\n            't_INT'\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_221padicprime(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("padicprime (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_220padicprime(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_220padicprime(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("padicprime", 0);

    /* "cypari_src/gen.pyx":3574
 *             't_INT'
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gel(x.g, 2))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3575
 *         """
 *         sig_on()
 *         return P.new_gen(gel(x.g, 2))             # <<<<<<<<<<<<<<
 * 
 *     def permtonum(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gel(__pyx_v_x->g, 2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3554
 *         return padicprec(x.g, _p.g)
 * 
 *     def padicprime(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         The uniformizer of the p-adic ring this element lies in, as a t_INT.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.padicprime", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3577
 *         return P.new_gen(gel(x.g, 2))
 * 
 *     def permtonum(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         permtonum(x): Return the ordinal (between 1 and n!) of permutation
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_223permtonum(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_222permtonum[] = "\n        permtonum(x): Return the ordinal (between 1 and n!) of permutation\n        vector x. \077\077? Huh \077\077? say more. what is a perm vector. 0 to n-1 or\n        1-n.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen (vector of integers)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - integer\n        \n        \n        EXAMPLES:\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_223permtonum(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("permtonum (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_222permtonum(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_222permtonum(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("permtonum", 0);

    /* "cypari_src/gen.pyx":3597
 *         EXAMPLES:
 *         """
 *         if typ(x.g) != t_VEC:             # <<<<<<<<<<<<<<
 *             raise TypeError, "x (=%s) must be of type t_VEC, but is of type %s."%(x,x.type())
 *         sig_on()
 */
    __pyx_t_1 = ((typ(__pyx_v_x->g) != t_VEC) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":3598
 *         """
 *         if typ(x.g) != t_VEC:
 *             raise TypeError, "x (=%s) must be of type t_VEC, but is of type %s."%(x,x.type())             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(permtonum(x.g))
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_x), __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __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 = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_x));
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_x));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_x));
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_x_s_must_be_of_type_t_VEC_but_is, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_2, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":3599
 *         if typ(x.g) != t_VEC:
 *             raise TypeError, "x (=%s) must be of type t_VEC, but is of type %s."%(x,x.type())
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(permtonum(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3600
 *             raise TypeError, "x (=%s) must be of type t_VEC, but is of type %s."%(x,x.type())
 *         sig_on()
 *         return P.new_gen(permtonum(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def precision(gen x, long n=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, permtonum(__pyx_v_x->g))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3577
 *         return P.new_gen(gel(x.g, 2))
 * 
 *     def permtonum(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         permtonum(x): Return the ordinal (between 1 and n!) of permutation
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.permtonum", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3602
 *         return P.new_gen(permtonum(x.g))
 * 
 *     def precision(gen x, long n=-1):             # <<<<<<<<<<<<<<
 *         """
 *         precision(x,n): Change the precision of x to be n, where n is a
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_225precision(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_224precision[] = "\n        precision(x,n): Change the precision of x to be n, where n is a\n        C-integer). If n is omitted, output the real precision of x.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``n`` - (optional) int\n        \n        \n        OUTPUT: nothing or gen if n is omitted\n        \n        EXAMPLES:\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_225precision(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("precision (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_n);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "precision") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __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;
        }
      }
      if (values[0]) {
        __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_n = ((long)-1);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("precision", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.precision", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_224precision(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_n);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_224precision(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("precision", 0);

    /* "cypari_src/gen.pyx":3619
 *         EXAMPLES:
 *         """
 *         if n <= -1:             # <<<<<<<<<<<<<<
 *             return precision(x.g)
 *         sig_on()
 */
    __pyx_t_1 = ((__pyx_v_n <= -1) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":3620
 *         """
 *         if n <= -1:
 *             return precision(x.g)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(precision0(x.g, n))
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyInt_From_long(precision(__pyx_v_x->g)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":3621
 *         if n <= -1:
 *             return precision(x.g)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(precision0(x.g, n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3622
 *             return precision(x.g)
 *         sig_on()
 *         return P.new_gen(precision0(x.g, n))             # <<<<<<<<<<<<<<
 * 
 *     def random(gen N):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, precision0(__pyx_v_x->g, __pyx_v_n))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3602
 *         return P.new_gen(permtonum(x.g))
 * 
 *     def precision(gen x, long n=-1):             # <<<<<<<<<<<<<<
 *         """
 *         precision(x,n): Change the precision of x to be n, where n is a
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.precision", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3624
 *         return P.new_gen(precision0(x.g, n))
 * 
 *     def random(gen N):             # <<<<<<<<<<<<<<
 *         r"""
 *         ``random(N=2^31)``: Return a pseudo-random integer
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_227random(PyObject *__pyx_v_N, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_226random[] = "\n        ``random(N=2^31)``: Return a pseudo-random integer\n        between 0 and `N-1`.\n        \n        INPUT:\n        \n        \n        -``N`` - gen, integer\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - integer\n        \n        \n        EXAMPLES:\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_227random(PyObject *__pyx_v_N, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("random (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_226random(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_N));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_226random(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_N) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("random", 0);

    /* "cypari_src/gen.pyx":3643
 *         EXAMPLES:
 *         """
 *         if typ(N.g) != t_INT:             # <<<<<<<<<<<<<<
 *             raise TypeError, "x (=%s) must be of type t_INT, but is of type %s."%(N,N.type())
 *         sig_on()
 */
    __pyx_t_1 = ((typ(__pyx_v_N->g) != t_INT) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":3644
 *         """
 *         if typ(N.g) != t_INT:
 *             raise TypeError, "x (=%s) must be of type t_INT, but is of type %s."%(N,N.type())             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(genrand(N.g))
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_N), __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __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 = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_N));
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_N));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_N));
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_x_s_must_be_of_type_t_INT_but_is, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_2, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":3645
 *         if typ(N.g) != t_INT:
 *             raise TypeError, "x (=%s) must be of type t_INT, but is of type %s."%(N,N.type())
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(genrand(N.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3646
 *             raise TypeError, "x (=%s) must be of type t_INT, but is of type %s."%(N,N.type())
 *         sig_on()
 *         return P.new_gen(genrand(N.g))             # <<<<<<<<<<<<<<
 * 
 *     def real(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, genrand(__pyx_v_N->g))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3624
 *         return P.new_gen(precision0(x.g, n))
 * 
 *     def random(gen N):             # <<<<<<<<<<<<<<
 *         r"""
 *         ``random(N=2^31)``: Return a pseudo-random integer
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.random", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3648
 *         return P.new_gen(genrand(N.g))
 * 
 *     def real(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         real(x): Return the real part of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_229real(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_228real[] = "\n        real(x): Return the real part of x.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES:\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_229real(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("real (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_228real(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_228real(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("real", 0);

    /* "cypari_src/gen.pyx":3662
 *         EXAMPLES:
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(greal(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3663
 *         """
 *         sig_on()
 *         return P.new_gen(greal(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def round(gen x, estimate=False):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, greal(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3648
 *         return P.new_gen(genrand(N.g))
 * 
 *     def real(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         real(x): Return the real part of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.real", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3665
 *         return P.new_gen(greal(x.g))
 * 
 *     def round(gen x, estimate=False):             # <<<<<<<<<<<<<<
 *         """
 *         round(x,estimate=False): If x is a real number, returns x rounded
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_231round(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_230round[] = "\n        round(x,estimate=False): If x is a real number, returns x rounded\n        to the nearest integer (rounding up). If the optional argument\n        estimate is True, also returns the binary exponent e of the\n        difference between the original and the rounded value (the\n        \"fractional part\") (this is the integer ceiling of log_2(error)).\n        \n        When x is a general PARI object, this function returns the result\n        of rounding every coefficient at every level of PARI object. Note\n        that this is different than what the truncate function does (see\n        the example below).\n        \n        One use of round is to get exact results after a long approximate\n        computation, when theory tells you that the coefficients must be\n        integers.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``estimate`` - (optional) bool, False by default\n        \n        \n        OUTPUT:\n\n        - if estimate is False, return a single gen.\n\n        - if estimate is True, return rounded version of x and error\n          estimate in bits, both as gens.\n        \n        EXAMPLES::\n        \n            >>> pari('1.5').round()\n            2\n            >>> pari('1.5').round(True)\n            (2, -1)\n            >>> pari('1.5 + 2.1*I').round()\n            2 + 2*I\n            >>> pari('1.0001').round(True)\n            (1, -14)\n            >>> pari('(2.4*x^2 - 1.7)/x').round()\n            (2*x^2 - 2)/x\n            >>> pari('(2.4*x^2 - 1.7)/x').truncate()\n            2.40000000000000*x\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_231round(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_estimate = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("round (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_estimate,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)Py_False);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_estimate);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "round") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3665; __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_estimate = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("round", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.round", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_230round(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_estimate);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_230round(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_estimate) {
    long __pyx_v_e;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_y = 0;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("round", 0);

    /* "cypari_src/gen.pyx":3715
 *         cdef long e
 *         cdef gen y
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if not estimate:
 *             return P.new_gen(ground(x.g))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3716
 *         cdef gen y
 *         sig_on()
 *         if not estimate:             # <<<<<<<<<<<<<<
 *             return P.new_gen(ground(x.g))
 *         y = P.new_gen(grndtoi(x.g, &e))
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_estimate); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((!__pyx_t_1) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":3717
 *         sig_on()
 *         if not estimate:
 *             return P.new_gen(ground(x.g))             # <<<<<<<<<<<<<<
 *         y = P.new_gen(grndtoi(x.g, &e))
 *         return y, e
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, ground(__pyx_v_x->g))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":3718
 *         if not estimate:
 *             return P.new_gen(ground(x.g))
 *         y = P.new_gen(grndtoi(x.g, &e))             # <<<<<<<<<<<<<<
 *         return y, e
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, grndtoi(__pyx_v_x->g, (&__pyx_v_e)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_y = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cypari_src/gen.pyx":3719
 *             return P.new_gen(ground(x.g))
 *         y = P.new_gen(grndtoi(x.g, &e))
 *         return y, e             # <<<<<<<<<<<<<<
 * 
 *     def simplify(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_e); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3719; __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 = 3719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_v_y));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_y));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_y));
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3665
 *         return P.new_gen(greal(x.g))
 * 
 *     def round(gen x, estimate=False):             # <<<<<<<<<<<<<<
 *         """
 *         round(x,estimate=False): If x is a real number, returns x rounded
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.round", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_y);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3721
 *         return y, e
 * 
 *     def simplify(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         simplify(x): Simplify the object x as much as possible, and return
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_233simplify(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_232simplify[] = "\n        simplify(x): Simplify the object x as much as possible, and return\n        the result.\n        \n        A complex or quadratic number whose imaginary part is an exact 0\n        (i.e., not an approximate one such as O(3) or 0.E-28) is converted\n        to its real part, and a a polynomial of degree 0 is converted to\n        its constant term. Simplification occurs recursively.\n        \n        This function is useful before using arithmetic functions, which\n        expect integer arguments:\n        \n        EXAMPLES::\n        \n            >>> y = pari('y')\n            >>> x = pari('9') + y - y\n            >>> x\n            9\n            >>> x.type()\n            't_POL'\n            >>> x.factor()\n            matrix(0,2)\n            >>> pari('9').factor()\n            Mat([3, 2])\n            >>> x.simplify()\n            9\n            >>> x.simplify().factor()\n            Mat([3, 2])\n            >>> x = pari('1.5 + 0*I')\n            >>> x.type()\n            't_REAL'\n            >>> x.simplify()\n            1.50000000000000\n            >>> y = x.simplify()\n            >>> y.type()\n            't_REAL'\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_233simplify(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("simplify (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_232simplify(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_232simplify(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("simplify", 0);

    /* "cypari_src/gen.pyx":3759
 *             't_REAL'
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(simplify(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3760
 *         """
 *         sig_on()
 *         return P.new_gen(simplify(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def sizeword(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, simplify(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3721
 *         return y, e
 * 
 *     def simplify(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         simplify(x): Simplify the object x as much as possible, and return
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.simplify", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3762
 *         return P.new_gen(simplify(x.g))
 * 
 *     def sizeword(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Return the total number of machine words occupied by the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_235sizeword(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_234sizeword[] = "\n        Return the total number of machine words occupied by the\n        complete tree of the object x.  A machine word is 32 or\n        64 bits, depending on the computer.\n        \n        INPUT:\n        \n        -  ``x`` - gen\n        \n        OUTPUT: int (a Python int)\n        \n        EXAMPLES::\n        \n            >>> pari('0').sizeword()\n            2\n            >>> pari('1').sizeword()\n            3\n            >>> pari('1000000').sizeword()\n            3\n            >>> pari('10^100').sizeword()  # 32-bit: 12\n            8\n            >>> pari(1.0).sizeword()    # 32-bit: 4\n            3\n            >>> pari('x').sizeword()\n            9\n            >>> pari('x^20').sizeword()\n            66\n            >>> pari('[x, I]').sizeword()\n            20\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_235sizeword(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sizeword (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_234sizeword(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_234sizeword(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("sizeword", 0);

    /* "cypari_src/gen.pyx":3793
 *             20
 *         """
 *         return gsizeword(x.g)             # <<<<<<<<<<<<<<
 * 
 *     def sizebyte(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(gsizeword(__pyx_v_x->g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3762
 *         return P.new_gen(simplify(x.g))
 * 
 *     def sizeword(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Return the total number of machine words occupied by the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.sizeword", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3795
 *         return gsizeword(x.g)
 * 
 *     def sizebyte(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Return the total number of bytes occupied by the complete tree
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_237sizebyte(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_236sizebyte[] = "\n        Return the total number of bytes occupied by the complete tree\n        of the object x. Note that this number depends on whether the\n        computer is 32-bit or 64-bit.\n        \n        INPUT:\n        \n        -  ``x`` - gen\n        \n        OUTPUT: int (a Python int)\n        \n        EXAMPLE::\n        \n            >>> pari('1').sizebyte()  # 32-bit: 12\n            24\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_237sizebyte(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sizebyte (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_236sizebyte(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_236sizebyte(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("sizebyte", 0);

    /* "cypari_src/gen.pyx":3812
 *             24
 *         """
 *         return gsizebyte(x.g)             # <<<<<<<<<<<<<<
 * 
 *     def sizedigit(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(gsizebyte(__pyx_v_x->g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3795
 *         return gsizeword(x.g)
 * 
 *     def sizebyte(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Return the total number of bytes occupied by the complete tree
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.sizebyte", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3814
 *         return gsizebyte(x.g)
 * 
 *     def sizedigit(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         sizedigit(x): Return a quick estimate for the maximal number of
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_239sizedigit(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_238sizedigit[] = "\n        sizedigit(x): Return a quick estimate for the maximal number of\n        decimal digits before the decimal point of any component of x.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``int`` - Python integer\n        \n        \n        EXAMPLES::\n        \n            >>> x = pari('10^100')\n            >>> x.Str().length()\n            101\n            >>> x.sizedigit()\n            101\n        \n        Note that digits after the decimal point are ignored.\n        \n        ::\n        \n            >>> x = pari('1.234')\n            >>> x\n            1.23400000000000\n            >>> x.sizedigit()\n            1\n        \n        The estimate can be one too big::\n        \n            >>> pari('7234.1').sizedigit()\n            4\n            >>> pari('9234.1').sizedigit()\n            5\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_239sizedigit(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sizedigit (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_238sizedigit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_238sizedigit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("sizedigit", 0);

    /* "cypari_src/gen.pyx":3856
 *             5
 *         """
 *         return sizedigit(x.g)             # <<<<<<<<<<<<<<
 * 
 *     def truncate(gen x, estimate=False):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(sizedigit(__pyx_v_x->g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3814
 *         return gsizebyte(x.g)
 * 
 *     def sizedigit(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         sizedigit(x): Return a quick estimate for the maximal number of
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.sizedigit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3858
 *         return sizedigit(x.g)
 * 
 *     def truncate(gen x, estimate=False):             # <<<<<<<<<<<<<<
 *         """
 *         truncate(x,estimate=False): Return the truncation of x. If estimate
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_241truncate(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_240truncate[] = "\n        truncate(x,estimate=False): Return the truncation of x. If estimate\n        is True, also return the number of error bits.\n        \n        When x is in the real numbers, this means that the part after the\n        decimal point is chopped away, e is the binary exponent of the\n        difference between the original and truncated value (the\n        \"fractional part\"). If x is a rational function, the result is the\n        integer part (Euclidean quotient of numerator by denominator) and\n        if requested the error estimate is 0.\n        \n        When truncate is applied to a power series (in X), it transforms it\n        into a polynomial or a rational function with denominator a power\n        of X, by chopping away the `O(X^k)`. Similarly, when\n        applied to a p-adic number, it transforms it into an integer or a\n        rational number by chopping away the `O(p^k)`.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``estimate`` - (optional) bool, which is False by\n           default\n        \n        \n        OUTPUT: \n\n        - if estimate is False, return a single gen.\n\n        - if estimate is True, return rounded version of x and error\n          estimate in bits, both as gens.\n\n        EXAMPLES::\n        \n            >>> pari('(x^2+1)/x').round()\n            (x^2 + 1)/x\n            >>> pari('(x^2+1)/x').truncate()\n            x\n            >>> pari('1.043').truncate()\n            1\n            >>> pari('1.043').truncate(True)\n            (1, -5)\n            >>> pari('1.6').truncate()\n            1\n            >>> pari('1.6').round()\n            2\n            >>> pari('1/3 + 2 + 3^2 + O(3^3)').truncate()\n            34/3\n            >>> pari('sin(x+O(x^10))').truncate()\n            1/362880*x^9 - 1/5040*x^7 + 1/120*x^5 - 1/6*x^3 + x\n            >>> pari('sin(x+O(x^10))').round()   # each coefficient has abs < 1\n            x + O(x^10)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_241truncate(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_estimate = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_estimate,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)Py_False);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_estimate);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3858; __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_estimate = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("truncate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_240truncate(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_estimate);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_240truncate(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_estimate) {
    long __pyx_v_e;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_y = 0;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("truncate", 0);

    /* "cypari_src/gen.pyx":3915
 *         cdef long e
 *         cdef gen y
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if not estimate:
 *             return P.new_gen(gtrunc(x.g))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3916
 *         cdef gen y
 *         sig_on()
 *         if not estimate:             # <<<<<<<<<<<<<<
 *             return P.new_gen(gtrunc(x.g))
 *         y = P.new_gen(gcvtoi(x.g, &e))
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_estimate); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((!__pyx_t_1) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":3917
 *         sig_on()
 *         if not estimate:
 *             return P.new_gen(gtrunc(x.g))             # <<<<<<<<<<<<<<
 *         y = P.new_gen(gcvtoi(x.g, &e))
 *         return y, e
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gtrunc(__pyx_v_x->g))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":3918
 *         if not estimate:
 *             return P.new_gen(gtrunc(x.g))
 *         y = P.new_gen(gcvtoi(x.g, &e))             # <<<<<<<<<<<<<<
 *         return y, e
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gcvtoi(__pyx_v_x->g, (&__pyx_v_e)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_y = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cypari_src/gen.pyx":3919
 *             return P.new_gen(gtrunc(x.g))
 *         y = P.new_gen(gcvtoi(x.g, &e))
 *         return y, e             # <<<<<<<<<<<<<<
 * 
 *     def valuation(gen x, p):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_e); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3919; __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 = 3919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_v_y));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_y));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_y));
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3858
 *         return sizedigit(x.g)
 * 
 *     def truncate(gen x, estimate=False):             # <<<<<<<<<<<<<<
 *         """
 *         truncate(x,estimate=False): Return the truncation of x. If estimate
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_y);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3921
 *         return y, e
 * 
 *     def valuation(gen x, p):             # <<<<<<<<<<<<<<
 *         """
 *         valuation(x,p): Return the valuation of x with respect to p.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_243valuation(PyObject *__pyx_v_x, PyObject *__pyx_v_p); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_242valuation[] = "\n        valuation(x,p): Return the valuation of x with respect to p.\n        \n        The valuation is the highest exponent of p dividing x.\n        \n        - If p is an integer, x must be an integer, an intmod whose\n          modulus is divisible by p, a rational number, a p-adic\n          number, or a polynomial or power series in which case the\n          valuation is the minimum of the valuations of the\n          coefficients.\n        \n        - If p is a polynomial, x must be a polynomial or a rational\n          function. If p is a monomial then x may also be a power\n          series.\n        \n        - If x is a vector, complex or quadratic number, then the\n          valuation is the minimum of the component valuations.\n        \n        - If x = 0, the result is `2^31-1` on 32-bit machines or\n          `2^63-1` on 64-bit machines if x is an exact\n          object. If x is a p-adic number or power series, the result\n          is the exponent of the zero.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``p`` - coercible to gen\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - integer\n        \n        \n        EXAMPLES::\n        \n            >>> pari(9).valuation(3)\n            2\n            >>> pari(9).valuation(9)\n            1\n            >>> x = pari(9).Mod(27); x.valuation(3)\n            2\n            >>> pari('5/3').valuation(3)\n            -1\n            >>> pari('9 + 3*x + 15*x^2').valuation(3)\n            1\n            >>> pari([9,3,15]).valuation(3)\n            1\n            >>> pari('9 + 3*x + 15*x^2 + O(x^5)').valuation(3)\n            1\n        \n        ::\n        \n            >>> pari('x^2*(x+1)^3').valuation(pari('x+1'))\n            3\n            >>> pari('x + O(x^5)').valuation('x')\n            1\n            >>> pari('2*x^2 + O(x^5)').valuation('x')\n            2\n        \n        ::\n        \n            >>> pari(0).valuation""(3)    # 32-bit:   2147483647\n            9223372036854775807\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_243valuation(PyObject *__pyx_v_x, PyObject *__pyx_v_p) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("valuation (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_242valuation(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_p));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_242valuation(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_p) {
    long __pyx_v_v;
    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("valuation", 0);

    /* "cypari_src/gen.pyx":3991
 *         """
 *         cdef long v
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         v = ggval(x.g, t0)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":3992
 *         cdef long v
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         v = ggval(x.g, t0)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":3993
 *         t0GEN(p)
 *         sig_on()
 *         v = ggval(x.g, t0)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return v
 */
    __pyx_v_v = ggval(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0);

    /* "cypari_src/gen.pyx":3994
 *         sig_on()
 *         v = ggval(x.g, t0)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return v
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":3995
 *         v = ggval(x.g, t0)
 *         sig_off()
 *         return v             # <<<<<<<<<<<<<<
 * 
 *     def _valp(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_v); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3921
 *         return y, e
 * 
 *     def valuation(gen x, p):             # <<<<<<<<<<<<<<
 *         """
 *         valuation(x,p): Return the valuation of x with respect to p.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.valuation", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":3997
 *         return v
 * 
 *     def _valp(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Return the valuation of x where x is a p-adic number (t_PADIC)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_245_valp(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_244_valp[] = "\n        Return the valuation of x where x is a p-adic number (t_PADIC)\n        or a laurent series (t_SER).  If x is a different type, this\n        will give a bogus number.\n        \n        EXAMPLES::\n            \n            >>> pari('1/x^2 + O(x^10)')._valp()\n            -2\n            >>> pari('O(x^10)')._valp()\n            10\n            >>> pari('(1145234796 + O(3^10))/771966234')._valp()\n            -2\n            >>> pari('O(2^10)')._valp()\n            10\n            >>> pari('x')._valp()   # random\n            -35184372088832\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_245_valp(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("_valp (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_244_valp(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_244_valp(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("_valp", 0);

    /* "cypari_src/gen.pyx":4017
 *         """
 *         # This is a simple macro, so we don't need sig_on()
 *         return valp(x.g)             # <<<<<<<<<<<<<<
 * 
 *     def variable(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(valp(__pyx_v_x->g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":3997
 *         return v
 * 
 *     def _valp(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Return the valuation of x where x is a p-adic number (t_PADIC)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen._valp", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4019
 *         return valp(x.g)
 * 
 *     def variable(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         variable(x): Return the main variable of the object x, or p if x is
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_247variable(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_246variable[] = "\n        variable(x): Return the main variable of the object x, or p if x is\n        a p-adic number.\n        \n        This function raises a TypeError exception on scalars, i.e., on\n        objects with no variable associated to them.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari('x^2 + x -2').variable()\n            x\n            >>> pari('1+2^3 + O(2^5)').variable()\n            2\n            >>> pari('x+y0').variable()\n            x\n            >>> pari('y0+z0').variable()\n            y0\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_247variable(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("variable (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_246variable(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_246variable(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("variable", 0);

    /* "cypari_src/gen.pyx":4046
 *             y0
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gpolvar(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4047
 *         """
 *         sig_on()
 *         return P.new_gen(gpolvar(x.g))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gpolvar(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4019
 *         return valp(x.g)
 * 
 *     def variable(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         variable(x): Return the main variable of the object x, or p if x is
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.variable", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4056
 *     ###########################################
 * 
 *     def abs(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the absolute value of x (its modulus, if x is complex).
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_249abs(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_248abs[] = "\n        Returns the absolute value of x (its modulus, if x is complex).\n        Rational functions are not allowed. Contrary to most transcendental\n        functions, an exact argument is not converted to a real number\n        before applying abs and an exact result is returned if possible.\n        \n        EXAMPLES::\n        \n            >>> x = pari(\"-27.1\")\n            >>> x.abs()\n            27.1000000000000\n        \n        If x is a polynomial, returns -x if the leading coefficient is real\n        and negative else returns x. For a power series, the constant\n        coefficient is considered instead.\n        \n        EXAMPLES::\n        \n            >>> pari('x-1.2*x^2').abs()\n            1.20000000000000*x^2 - x\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_249abs(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("abs (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_248abs(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_248abs(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("abs", 0);

    /* "cypari_src/gen.pyx":4078
 *             1.20000000000000*x^2 - x
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the prec parameter here has no effect
 *         return P.new_gen(gabs(x.g, prec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4080
 *         sig_on()
 *         # the prec parameter here has no effect
 *         return P.new_gen(gabs(x.g, prec))             # <<<<<<<<<<<<<<
 * 
 *     def acos(gen x, long precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gabs(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4056
 *     ###########################################
 * 
 *     def abs(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the absolute value of x (its modulus, if x is complex).
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4082
 *         return P.new_gen(gabs(x.g, prec))
 * 
 *     def acos(gen x, long precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\cos^{-1}(x)`, so that
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_251acos(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_250acos[] = "\n        The principal branch of `\\cos^{-1}(x)`, so that\n        `\\RR e(\\mathrm{acos}(x))` belongs to `[0,Pi]`. If `x`\n        is real and `|x| > 1`, then `\\mathrm{acos}(x)` is complex.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0.5).acos()\n            1.04719755119660\n            >>> pari('1/2').acos()\n            1.04719755119660\n            >>> pari(1.1).acos()\n            0.443568254385115*I\n            >>> pari('1.1+I').acos()\n            0.849343054245252 - 1.09770986682533*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_251acos(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_precision;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("acos (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "acos") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4082; __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;
        }
      }
      if (values[0]) {
        __pyx_v_precision = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_precision == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4082; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_precision = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("acos", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4082; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_250acos(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_250acos(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_precision) {
    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;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("acos", 0);

    /* "cypari_src/gen.pyx":4104
 *             0.849343054245252 - 1.09770986682533*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gacos(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4105
 *         """
 *         sig_on()
 *         return P.new_gen(gacos(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def acosh(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_precision); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gacos(__pyx_v_x->g, __pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4082
 *         return P.new_gen(gabs(x.g, prec))
 * 
 *     def acos(gen x, long precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\cos^{-1}(x)`, so that
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4107
 *         return P.new_gen(gacos(x.g, pbw(precision)))
 * 
 *     def acosh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\cosh^{-1}(x)`, so that
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_253acosh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_252acosh[] = "\n        The principal branch of `\\cosh^{-1}(x)`, so that\n        `\\Im(\\mathrm{acosh}(x))` belongs to `[0,Pi]`. If\n        `x` is real and `x < 1`, then\n        `\\mathrm{acosh}(x)` is complex.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).acosh()\n            1.31695789692482\n            >>> pari(0).acosh()\n            1.57079632679490*I\n            >>> pari('I').acosh()\n            0.881373587019543 + 1.57079632679490*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_253acosh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("acosh (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "acosh") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4107; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("acosh", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4107; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_252acosh(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_252acosh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("acosh", 0);

    /* "cypari_src/gen.pyx":4128
 *             0.881373587019543 + 1.57079632679490*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gach(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4129
 *         """
 *         sig_on()
 *         return P.new_gen(gach(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def agm(gen x, y, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gach(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4107
 *         return P.new_gen(gacos(x.g, pbw(precision)))
 * 
 *     def acosh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\cosh^{-1}(x)`, so that
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.acosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4131
 *         return P.new_gen(gach(x.g, pbw(precision)))
 * 
 *     def agm(gen x, y, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The arithmetic-geometric mean of x and y. In the case of complex or
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_255agm(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_254agm[] = "\n        The arithmetic-geometric mean of x and y. In the case of complex or\n        negative numbers, the principal square root is always chosen.\n        p-adic or power series arguments are also allowed. Note that a\n        p-adic AGM exists only if x/y is congruent to 1 modulo p (modulo 16\n        for p=2). x and y cannot both be vectors or matrices.\n        \n        If any of `x` or `y` is an exact argument, it is\n        first converted to a real or complex number using the optional\n        parameter precision (in bits). If the arguments are inexact (e.g.\n        real), the smallest of their two precisions is used in the\n        computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).agm(2)                  \n            2.00000000000000\n            >>> pari(0).agm(1)\n            0\n            >>> pari(1).agm(2)\n            1.45679103104691\n            >>> pari('1+I').agm(-3)\n            -0.964731722290876 + 1.15700282952632*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_255agm(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_y = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("agm (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_y)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "agm") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4131; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_y = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("agm", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4131; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.agm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_254agm(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_y, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_254agm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("agm", 0);

    /* "cypari_src/gen.pyx":4156
 *             -0.964731722290876 + 1.15700282952632*I
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(agm(x.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4157
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(agm(x.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4158
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(agm(x.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def arg(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, agm(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4131
 *         return P.new_gen(gach(x.g, pbw(precision)))
 * 
 *     def agm(gen x, y, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The arithmetic-geometric mean of x and y. In the case of complex or
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.agm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4160
 *         return P.new_gen(agm(x.g, t0, pbw(precision)))
 * 
 *     def arg(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         arg(x): argument of x,such that `-\pi < \arg(x) \leq \pi`.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_257arg(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_256arg[] = "\n        arg(x): argument of x,such that `-\\pi < \\arg(x) \\leq \\pi`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari('2+I').arg()               \n            0.463647609000806\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_257arg(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("arg (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arg") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4160; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("arg", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.arg", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_256arg(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_256arg(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("arg", 0);

    /* "cypari_src/gen.pyx":4174
 *             0.463647609000806
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(garg(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4175
 *         """
 *         sig_on()
 *         return P.new_gen(garg(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def asin(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, garg(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4160
 *         return P.new_gen(agm(x.g, t0, pbw(precision)))
 * 
 *     def arg(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         arg(x): argument of x,such that `-\pi < \arg(x) \leq \pi`.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.arg", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4177
 *         return P.new_gen(garg(x.g, pbw(precision)))
 * 
 *     def asin(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\sin^{-1}(x)`, so that
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_259asin(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_258asin[] = "\n        The principal branch of `\\sin^{-1}(x)`, so that\n        `\\RR e(\\mathrm{asin}(x))` belongs to `[-\\pi/2,\\pi/2]`. If\n        `x` is real and `|x| > 1` then `\\mathrm{asin}(x)`\n        is complex.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(pari(0.5).sin()).asin()\n            0.500000000000000\n            >>> pari(2).asin()\n            1.57079632679490 - 1.31695789692482*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_259asin(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("asin (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asin") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("asin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_258asin(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_258asin(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("asin", 0);

    /* "cypari_src/gen.pyx":4196
 *             1.57079632679490 - 1.31695789692482*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gasin(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4197
 *         """
 *         sig_on()
 *         return P.new_gen(gasin(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def asinh(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gasin(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4177
 *         return P.new_gen(garg(x.g, pbw(precision)))
 * 
 *     def asin(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\sin^{-1}(x)`, so that
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4199
 *         return P.new_gen(gasin(x.g, pbw(precision)))
 * 
 *     def asinh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\sinh^{-1}(x)`, so that
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_261asinh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_260asinh[] = "\n        The principal branch of `\\sinh^{-1}(x)`, so that\n        `\\Im(\\mathrm{asinh}(x))` belongs to `[-\\pi/2,\\pi/2]`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).asinh()\n            1.44363547517881\n            >>> pari('2+I').asinh()\n            1.52857091948100 + 0.427078586392476*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_261asinh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("asinh (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asinh") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("asinh", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_260asinh(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_260asinh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("asinh", 0);

    /* "cypari_src/gen.pyx":4216
 *             1.52857091948100 + 0.427078586392476*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gash(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4217
 *         """
 *         sig_on()
 *         return P.new_gen(gash(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def atan(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gash(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4199
 *         return P.new_gen(gasin(x.g, pbw(precision)))
 * 
 *     def asinh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\sinh^{-1}(x)`, so that
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.asinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4219
 *         return P.new_gen(gash(x.g, pbw(precision)))
 * 
 *     def atan(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\tan^{-1}(x)`, so that
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_263atan(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_262atan[] = "\n        The principal branch of `\\tan^{-1}(x)`, so that\n        `\\RR e(\\mathrm{atan}(x))` belongs to `]-\\pi/2, \\pi/2[`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).atan()\n            0.785398163397448\n            >>> pari('1.5+I').atan()\n            1.10714871779409 + 0.255412811882995*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_263atan(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("atan (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atan") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4219; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("atan", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_262atan(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_262atan(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("atan", 0);

    /* "cypari_src/gen.pyx":4236
 *             1.10714871779409 + 0.255412811882995*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gatan(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4237
 *         """
 *         sig_on()
 *         return P.new_gen(gatan(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def atanh(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gatan(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4219
 *         return P.new_gen(gash(x.g, pbw(precision)))
 * 
 *     def atan(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\tan^{-1}(x)`, so that
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.atan", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4239
 *         return P.new_gen(gatan(x.g, pbw(precision)))
 * 
 *     def atanh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\tanh^{-1}(x)`, so that
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_265atanh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_264atanh[] = "\n        The principal branch of `\\tanh^{-1}(x)`, so that\n        `\\Im(\\mathrm{atanh}(x))` belongs to `]-\\pi/2,\\pi/2]`. If\n        `x` is real and `|x| > 1` then `\\mathrm{atanh}(x)`\n        is complex.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0).atanh()\n            0.E-19\n            >>> pari(2).atanh()\n            0.549306144334055 - 1.57079632679490*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_265atanh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("atanh (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atanh") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4239; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("atanh", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4239; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_264atanh(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_264atanh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("atanh", 0);

    /* "cypari_src/gen.pyx":4258
 *             0.549306144334055 - 1.57079632679490*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gath(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4259
 *         """
 *         sig_on()
 *         return P.new_gen(gath(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def bernfrac(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gath(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4239
 *         return P.new_gen(gatan(x.g, pbw(precision)))
 * 
 *     def atanh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of `\tanh^{-1}(x)`, so that
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.atanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4261
 *         return P.new_gen(gath(x.g, pbw(precision)))
 * 
 *     def bernfrac(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         The Bernoulli number `B_x`, where `B_0 = 1`,
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_267bernfrac(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_266bernfrac[] = "\n        The Bernoulli number `B_x`, where `B_0 = 1`,\n        `B_1 = -1/2`, `B_2 = 1/6,\\ldots,` expressed as a\n        rational number. The argument `x` should be of type\n        integer.\n        \n        EXAMPLES::\n        \n            >>> pari(18).bernfrac()\n            43867/798\n            >>> [pari(n).bernfrac() for n in range(10)]\n            [1, -1/2, 1/6, 0, -1/30, 0, 1/42, 0, -1/30, 0]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_267bernfrac(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bernfrac (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_266bernfrac(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_266bernfrac(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    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("bernfrac", 0);

    /* "cypari_src/gen.pyx":4275
 *             [1, -1/2, 1/6, 0, -1/30, 0, 1/42, 0, -1/30, 0]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(bernfrac(x))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4276
 *         """
 *         sig_on()
 *         return P.new_gen(bernfrac(x))             # <<<<<<<<<<<<<<
 * 
 *     def bernreal(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, bernfrac(__pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4261
 *         return P.new_gen(gath(x.g, pbw(precision)))
 * 
 *     def bernfrac(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         The Bernoulli number `B_x`, where `B_0 = 1`,
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.bernfrac", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4278
 *         return P.new_gen(bernfrac(x))
 * 
 *     def bernreal(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         The Bernoulli number `B_x`, as for the function bernfrac,
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_269bernreal(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_268bernreal[] = "\n        The Bernoulli number `B_x`, as for the function bernfrac,\n        but `B_x` is returned as a real number (with the current\n        precision).\n        \n        EXAMPLES::\n        \n            >>> pari(18).bernreal()\n            54.9711779448622\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_269bernreal(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bernreal (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_268bernreal(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_268bernreal(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    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("bernreal", 0);

    /* "cypari_src/gen.pyx":4289
 *             54.9711779448622
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the argument prec has no effect
 *         return P.new_gen(bernreal(x, prec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4291
 *         sig_on()
 *         # the argument prec has no effect
 *         return P.new_gen(bernreal(x, prec))             # <<<<<<<<<<<<<<
 * 
 *     def bernvec(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, bernreal(__pyx_t_1, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4278
 *         return P.new_gen(bernfrac(x))
 * 
 *     def bernreal(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         The Bernoulli number `B_x`, as for the function bernfrac,
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.bernreal", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4293
 *         return P.new_gen(bernreal(x, prec))
 * 
 *     def bernvec(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         Creates a vector containing, as rational numbers, the Bernoulli
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_271bernvec(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_270bernvec[] = "\n        Creates a vector containing, as rational numbers, the Bernoulli\n        numbers `B_0, B_2,\\ldots, B_{2x}`. This routine is\n        obsolete. Use bernfrac instead each time you need a Bernoulli\n        number in exact form.\n        \n        Note: this routine is implemented using repeated independent calls\n        to bernfrac, which is faster than the standard recursion in exact\n        arithmetic.\n        \n        EXAMPLES::\n        \n            >>> pari(8).bernvec()\n            [1, 1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510]\n            >>> [pari(2*n).bernfrac() for n in range(9)]\n            [1, 1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_271bernvec(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bernvec (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_270bernvec(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_270bernvec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    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("bernvec", 0);

    /* "cypari_src/gen.pyx":4311
 *             [1, 1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(bernvec(x))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4312
 *         """
 *         sig_on()
 *         return P.new_gen(bernvec(x))             # <<<<<<<<<<<<<<
 * 
 *     def besselh1(gen nu, x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(((PyObject *)__pyx_v_x)); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, bernvec(__pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4293
 *         return P.new_gen(bernreal(x, prec))
 * 
 *     def bernvec(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         Creates a vector containing, as rational numbers, the Bernoulli
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.bernvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4314
 *         return P.new_gen(bernvec(x))
 * 
 *     def besselh1(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The `H^1`-Bessel function of index `\nu` and
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_273besselh1(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_272besselh1[] = "\n        The `H^1`-Bessel function of index `\\nu` and\n        argument `x`.\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).besselh1(3)\n            0.486091260585891 - 0.160400393484924*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_273besselh1(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("besselh1 (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "besselh1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4314; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("besselh1", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.besselh1", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_272besselh1(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_nu), __pyx_v_x, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_272besselh1(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("besselh1", 0);

    /* "cypari_src/gen.pyx":4330
 *             0.486091260585891 - 0.160400393484924*I
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(hbessel1(nu.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4331
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(hbessel1(nu.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4332
 *         t0GEN(x)
 *         sig_on()
 *         return P.new_gen(hbessel1(nu.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def besselh2(gen nu, x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, hbessel1(__pyx_v_nu->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4314
 *         return P.new_gen(bernvec(x))
 * 
 *     def besselh1(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The `H^1`-Bessel function of index `\nu` and
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.besselh1", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4334
 *         return P.new_gen(hbessel1(nu.g, t0, pbw(precision)))
 * 
 *     def besselh2(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The `H^2`-Bessel function of index `\nu` and
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_275besselh2(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_274besselh2[] = "\n        The `H^2`-Bessel function of index `\\nu` and\n        argument `x`.\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).besselh2(3)\n            0.486091260585891 + 0.160400393484924*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_275besselh2(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("besselh2 (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "besselh2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4334; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("besselh2", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4334; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.besselh2", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_274besselh2(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_nu), __pyx_v_x, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_274besselh2(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("besselh2", 0);

    /* "cypari_src/gen.pyx":4350
 *             0.486091260585891 + 0.160400393484924*I
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(hbessel2(nu.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4351
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(hbessel2(nu.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4352
 *         t0GEN(x)
 *         sig_on()
 *         return P.new_gen(hbessel2(nu.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def besselj(gen nu, x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, hbessel2(__pyx_v_nu->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4334
 *         return P.new_gen(hbessel1(nu.g, t0, pbw(precision)))
 * 
 *     def besselh2(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The `H^2`-Bessel function of index `\nu` and
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.besselh2", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4354
 *         return P.new_gen(hbessel2(nu.g, t0, pbw(precision)))
 * 
 *     def besselj(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Bessel J function (Bessel function of the first kind), with index
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_277besselj(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_276besselj[] = "\n        Bessel J function (Bessel function of the first kind), with index\n        `\\nu` and argument `x`. If `x` converts to\n        a power series, the initial factor\n        `(x/2)^{\\nu}/\\Gamma(\\nu+1)` is omitted (since it cannot be\n        represented in PARI when `\\nu` is not integral).\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).besselj(3)\n            0.486091260585891\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_277besselj(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("besselj (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "besselj") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4354; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("besselj", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.besselj", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_276besselj(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_nu), __pyx_v_x, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_276besselj(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("besselj", 0);

    /* "cypari_src/gen.pyx":4373
 *             0.486091260585891
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(jbessel(nu.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4374
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(jbessel(nu.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4375
 *         t0GEN(x)
 *         sig_on()
 *         return P.new_gen(jbessel(nu.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def besseljh(gen nu, x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, jbessel(__pyx_v_nu->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4354
 *         return P.new_gen(hbessel2(nu.g, t0, pbw(precision)))
 * 
 *     def besselj(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Bessel J function (Bessel function of the first kind), with index
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.besselj", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4377
 *         return P.new_gen(jbessel(nu.g, t0, pbw(precision)))
 * 
 *     def besseljh(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         J-Bessel function of half integral index (Spherical Bessel
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_279besseljh(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_278besseljh[] = "\n        J-Bessel function of half integral index (Spherical Bessel\n        function of the first kind). More precisely, besseljh(n,x) computes\n        `J_{n+1/2}(x)` where n must an integer, and x is any\n        complex value. In the current implementation (PARI, version\n        2.2.11), this function is not very accurate when `x` is\n        small.\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).besseljh(3)   #32-bit: 0.4127100324\n            0.412710032209716\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_279besseljh(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("besseljh (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "besseljh") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("besseljh", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.besseljh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_278besseljh(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_nu), __pyx_v_x, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_278besseljh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("besseljh", 0);

    /* "cypari_src/gen.pyx":4397
 *             0.412710032209716
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(jbesselh(nu.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4398
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(jbesselh(nu.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4399
 *         t0GEN(x)
 *         sig_on()
 *         return P.new_gen(jbesselh(nu.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def besseli(gen nu, x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, jbesselh(__pyx_v_nu->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4377
 *         return P.new_gen(jbessel(nu.g, t0, pbw(precision)))
 * 
 *     def besseljh(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         J-Bessel function of half integral index (Spherical Bessel
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.besseljh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4401
 *         return P.new_gen(jbesselh(nu.g, t0, pbw(precision)))
 * 
 *     def besseli(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Bessel I function (Bessel function of the second kind), with index
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_281besseli(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_280besseli[] = "\n        Bessel I function (Bessel function of the second kind), with index\n        `\\nu` and argument `x`. If `x` converts to\n        a power series, the initial factor\n        `(x/2)^{\\nu}/\\Gamma(\\nu+1)` is omitted (since it cannot be\n        represented in PARI when `\\nu` is not integral).\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).besseli(3)\n            2.24521244092995\n            >>> pari(2).besseli('3+I')\n            1.12539407613913 + 2.08313822670661*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_281besseli(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("besseli (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "besseli") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4401; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("besseli", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4401; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.besseli", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_280besseli(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_nu), __pyx_v_x, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_280besseli(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("besseli", 0);

    /* "cypari_src/gen.pyx":4422
 *             1.12539407613913 + 2.08313822670661*I
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(ibessel(nu.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4423
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(ibessel(nu.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4424
 *         t0GEN(x)
 *         sig_on()
 *         return P.new_gen(ibessel(nu.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def besselk(gen nu, x, long flag=0, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, ibessel(__pyx_v_nu->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4401
 *         return P.new_gen(jbesselh(nu.g, t0, pbw(precision)))
 * 
 *     def besseli(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Bessel I function (Bessel function of the second kind), with index
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.besseli", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4426
 *         return P.new_gen(ibessel(nu.g, t0, pbw(precision)))
 * 
 *     def besselk(gen nu, x, long flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         nu.besselk(x, flag=0): K-Bessel function (modified Bessel function
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_283besselk(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_282besselk[] = "\n        nu.besselk(x, flag=0): K-Bessel function (modified Bessel function\n        of the second kind) of index nu, which can be complex, and argument\n        x.\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        INPUT:\n        \n        \n        -  ``nu`` - a complex number\n        \n        -  ``x`` - real number (positive or negative)\n        \n        -  ``flag`` - default: 0 or 1: use hyperu (hyperu is\n           much slower for small x, and doesn't work for negative x).\n        \n        \n        EXAMPLES::\n        \n            >>> pari('2+I').besselk(3)\n            0.0455907718407551 + 0.0289192946582081*I\n        \n        ::\n        \n            >>> pari('2+I').besselk(-3)\n            -4.34870874986752 - 5.38744882697109*I\n        \n        ::\n        \n            >>> pari(2+1j).besselk(300, flag=1)\n            3.74224603319728 E-132 + 2.49071062641525 E-134*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_283besselk(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    CYTHON_UNUSED long __pyx_v_flag;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("besselk (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_flag,&__pyx_n_s_precision,0};
      PyObject* values[3] = {0,0,0};
      values[2] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "besselk") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4426; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4426; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
      __pyx_v_precision = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("besselk", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4426; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.besselk", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_282besselk(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_nu), __pyx_v_x, __pyx_v_flag, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_282besselk(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, CYTHON_UNUSED long __pyx_v_flag, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("besselk", 0);

    /* "cypari_src/gen.pyx":4464
 *             3.74224603319728 E-132 + 2.49071062641525 E-134*I
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(kbessel(nu.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4465
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(kbessel(nu.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4466
 *         t0GEN(x)
 *         sig_on()
 *         return P.new_gen(kbessel(nu.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def besseln(gen nu, x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, kbessel(__pyx_v_nu->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4426
 *         return P.new_gen(ibessel(nu.g, t0, pbw(precision)))
 * 
 *     def besselk(gen nu, x, long flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         nu.besselk(x, flag=0): K-Bessel function (modified Bessel function
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.besselk", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4468
 *         return P.new_gen(kbessel(nu.g, t0, pbw(precision)))
 * 
 *     def besseln(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         nu.besseln(x): Bessel N function (Spherical Bessel function of the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_285besseln(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_284besseln[] = "\n        nu.besseln(x): Bessel N function (Spherical Bessel function of the\n        second kind) of index nu and argument x.\n        \n        If `nu` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari('2+I').besseln(3)\n            -0.280775566958244 - 0.486708533223726*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_285besseln(PyObject *__pyx_v_nu, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("besseln (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "besseln") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4468; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("besseln", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.besseln", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_284besseln(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_nu), __pyx_v_x, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_284besseln(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nu, PyObject *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("besseln", 0);

    /* "cypari_src/gen.pyx":4484
 *             -0.280775566958244 - 0.486708533223726*I
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(nbessel(nu.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4485
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(nbessel(nu.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4486
 *         t0GEN(x)
 *         sig_on()
 *         return P.new_gen(nbessel(nu.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def cos(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, nbessel(__pyx_v_nu->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4468
 *         return P.new_gen(kbessel(nu.g, t0, pbw(precision)))
 * 
 *     def besseln(gen nu, x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         nu.besseln(x): Bessel N function (Spherical Bessel function of the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.besseln", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4488
 *         return P.new_gen(nbessel(nu.g, t0, pbw(precision)))
 * 
 *     def cos(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         The cosine function.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_287cos(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_286cos[] = "\n        The cosine function.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1.5).cos()\n            0.0707372016677029\n            >>> pari('1+I').cos()\n            0.833730025131149 - 0.988897705762865*I\n            >>> pari('x+O(x^8)').cos()\n            1 - 1/2*x^2 + 1/24*x^4 - 1/720*x^6 + 1/40320*x^8 + O(x^9)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_287cos(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("cos (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cos") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("cos", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_286cos(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_286cos(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("cos", 0);

    /* "cypari_src/gen.pyx":4506
 *             1 - 1/2*x^2 + 1/24*x^4 - 1/720*x^6 + 1/40320*x^8 + O(x^9)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gcos(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4507
 *         """
 *         sig_on()
 *         return P.new_gen(gcos(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def cosh(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gcos(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4488
 *         return P.new_gen(nbessel(nu.g, t0, pbw(precision)))
 * 
 *     def cos(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         The cosine function.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4509
 *         return P.new_gen(gcos(x.g, pbw(precision)))
 * 
 *     def cosh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         The hyperbolic cosine function.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_289cosh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_288cosh[] = "\n        The hyperbolic cosine function.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1.5).cosh()\n            2.35240961524325\n            >>> pari('1+I').cosh()\n            0.833730025131149 + 0.988897705762865*I\n            >>> pari('x+O(x^8)').cosh()\n            1 + 1/2*x^2 + 1/24*x^4 + 1/720*x^6 + O(x^8)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_289cosh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("cosh (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cosh") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4509; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("cosh", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4509; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_288cosh(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_288cosh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("cosh", 0);

    /* "cypari_src/gen.pyx":4527
 *             1 + 1/2*x^2 + 1/24*x^4 + 1/720*x^6 + O(x^8)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gch(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4528
 *         """
 *         sig_on()
 *         return P.new_gen(gch(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def cotan(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gch(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4509
 *         return P.new_gen(gcos(x.g, pbw(precision)))
 * 
 *     def cosh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         The hyperbolic cosine function.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.cosh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4530
 *         return P.new_gen(gch(x.g, pbw(precision)))
 * 
 *     def cotan(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         The cotangent of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_291cotan(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_290cotan[] = "\n        The cotangent of x.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(5).cotan()\n            -0.295812915532746\n        \n        Computing the cotangent of `\\pi` doesn't raise an error,\n        but instead just returns a very large (positive or negative)\n        number.\n        \n        ::\n        \n            >>> x = pari.pi()\n            >>> x.cotan()         # random\n            4.61168601842739 E18\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_291cotan(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("cotan (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cotan") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4530; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("cotan", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4530; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.cotan", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_290cotan(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_290cotan(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("cotan", 0);

    /* "cypari_src/gen.pyx":4554
 *             4.61168601842739 E18
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gcotan(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4555
 *         """
 *         sig_on()
 *         return P.new_gen(gcotan(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def dilog(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gcotan(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4530
 *         return P.new_gen(gch(x.g, pbw(precision)))
 * 
 *     def cotan(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         The cotangent of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.cotan", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4557
 *         return P.new_gen(gcotan(x.g, pbw(precision)))
 * 
 *     def dilog(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of the dilogarithm of `x`, i.e. the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_293dilog(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_292dilog[] = "\n        The principal branch of the dilogarithm of `x`, i.e. the\n        analytic continuation of the power series\n        `\\log_2(x) = \\sum_{n>=1} x^n/n^2`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).dilog()\n            1.64493406684823\n            >>> pari('1+I').dilog()\n            0.616850275068085 + 1.46036211675312*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_293dilog(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("dilog (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dilog") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4557; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("dilog", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4557; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.dilog", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_292dilog(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_292dilog(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("dilog", 0);

    /* "cypari_src/gen.pyx":4575
 *             0.616850275068085 + 1.46036211675312*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(dilog(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4576
 *         """
 *         sig_on()
 *         return P.new_gen(dilog(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def eint1(gen x, long n=0, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, dilog(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4557
 *         return P.new_gen(gcotan(x.g, pbw(precision)))
 * 
 *     def dilog(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         The principal branch of the dilogarithm of `x`, i.e. the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.dilog", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4578
 *         return P.new_gen(dilog(x.g, pbw(precision)))
 * 
 *     def eint1(gen x, long n=0, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.eint1(n): exponential integral E1(x):
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_295eint1(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_294eint1[] = "\n        x.eint1(n): exponential integral E1(x):\n        \n        .. math::\n        \n                         \\int_{x}^{\\infty} \\frac{e^{-t}}{t} dt         \n        \n        \n        If n is present, output the vector [eint1(x), eint1(2\\*x), ...,\n        eint1(n\\*x)]. This is faster than repeatedly calling eint1(i\\*x).\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        REFERENCE:\n\n        - See page 262, Prop 5.6.12, of Cohen's book \"A Course in\n          Computational Algebraic Number Theory\".\n        \n        EXAMPLES:\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_295eint1(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("eint1 (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eint1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4578; __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;
        }
      }
      if (values[0]) {
        __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4578; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_n = ((long)0);
      }
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("eint1", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4578; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.eint1", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_294eint1(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_n, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_294eint1(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_n, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("eint1", 0);

    /* "cypari_src/gen.pyx":4602
 *         EXAMPLES:
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if n <= 0:
 *             return P.new_gen(eint1(x.g, pbw(precision)))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4603
 *         """
 *         sig_on()
 *         if n <= 0:             # <<<<<<<<<<<<<<
 *             return P.new_gen(eint1(x.g, pbw(precision)))
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_n <= 0) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":4604
 *         sig_on()
 *         if n <= 0:
 *             return P.new_gen(eint1(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 *         else:
 *             return P.new_gen(veceint1(x.g, stoi(n), pbw(precision)))
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_precision); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_precision);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_precision);
        __Pyx_GIVEREF(__pyx_v_precision);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, eint1(__pyx_v_x->g, __pyx_t_6))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":4606
 *             return P.new_gen(eint1(x.g, pbw(precision)))
 *         else:
 *             return P.new_gen(veceint1(x.g, stoi(n), pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def erfc(gen x, precision=0):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_precision); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_precision);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
        __Pyx_GIVEREF(__pyx_v_precision);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, veceint1(__pyx_v_x->g, stoi(__pyx_v_n), __pyx_t_6))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":4578
 *         return P.new_gen(dilog(x.g, pbw(precision)))
 * 
 *     def eint1(gen x, long n=0, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.eint1(n): exponential integral E1(x):
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.eint1", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4608
 *             return P.new_gen(veceint1(x.g, stoi(n), pbw(precision)))
 * 
 *     def erfc(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Return the complementary error function:
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_297erfc(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_296erfc[] = "\n        Return the complementary error function:\n        \n        .. math::\n        \n            (2/\\sqrt{\\pi}) \\int_{x}^{\\infty} e^{-t^2} dt.\n        \n        \n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).erfc()\n            0.157299207050285\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_297erfc(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("erfc (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "erfc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4608; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("erfc", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.erfc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_296erfc(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_296erfc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("erfc", 0);

    /* "cypari_src/gen.pyx":4628
 *             0.157299207050285
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gerfc(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4629
 *         """
 *         sig_on()
 *         return P.new_gen(gerfc(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def eta(gen x, flag=0, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gerfc(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4608
 *             return P.new_gen(veceint1(x.g, stoi(n), pbw(precision)))
 * 
 *     def erfc(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Return the complementary error function:
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.erfc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4631
 *         return P.new_gen(gerfc(x.g, pbw(precision)))
 * 
 *     def eta(gen x, flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.eta(flag=0): if flag=0, `\eta` function without the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_299eta(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_298eta[] = "\n        x.eta(flag=0): if flag=0, `\\eta` function without the\n        `q^{1/24}`; otherwise `\\eta` of the complex number\n        `x` in the upper half plane intelligently computed using\n        `\\mathrm{SL}(2,\\ZZ)` transformations.\n        \n        DETAILS: This functions computes the following. If the input\n        `x` is a complex number with positive imaginary part, the\n        result is `\\prod_{n=1}^{\\infty} (q-1^n)`, where\n        `q=e^{2 i \\pi x}`. If `x` is a power series\n        (or can be converted to a power series) with positive valuation,\n        the result is `\\prod_{n=1}^{\\infty} (1-x^n)`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari('I').eta()\n            0.998129069925959\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_299eta(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("eta (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[0] = ((PyObject *)__pyx_int_0);
      values[1] = ((PyObject *)__pyx_int_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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4631; __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_flag = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("eta", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_298eta(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_flag, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_298eta(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_flag, PyObject *__pyx_v_precision) {
    PyObject *__pyx_r = NULL;
    __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;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("eta", 0);

    /* "cypari_src/gen.pyx":4655
 *             0.998129069925959
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if flag == 1:
 *             return P.new_gen(trueeta(x.g, pbw(precision)))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4656
 *         """
 *         sig_on()
 *         if flag == 1:             # <<<<<<<<<<<<<<
 *             return P.new_gen(trueeta(x.g, pbw(precision)))
 *         return P.new_gen(eta(x.g, pbw(precision)))
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_flag, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4656; __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 = 4656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":4657
 *         sig_on()
 *         if flag == 1:
 *             return P.new_gen(trueeta(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 *         return P.new_gen(eta(x.g, pbw(precision)))
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_precision);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_precision);
        __Pyx_GIVEREF(__pyx_v_precision);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, trueeta(__pyx_v_x->g, __pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":4658
 *         if flag == 1:
 *             return P.new_gen(trueeta(x.g, pbw(precision)))
 *         return P.new_gen(eta(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def exp(gen self, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, eta(__pyx_v_x->g, __pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4631
 *         return P.new_gen(gerfc(x.g, pbw(precision)))
 * 
 *     def eta(gen x, flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.eta(flag=0): if flag=0, `\eta` function without the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4660
 *         return P.new_gen(eta(x.g, pbw(precision)))
 * 
 *     def exp(gen self, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.exp(): exponential of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_301exp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_300exp[] = "\n        x.exp(): exponential of x.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0).exp()\n            1.00000000000000\n            >>> pari(1).exp()\n            2.71828182845905\n            >>> pari('x+O(x^8)').exp()\n            1 + x + 1/2*x^2 + 1/6*x^3 + 1/24*x^4 + 1/120*x^5 + 1/720*x^6 + 1/5040*x^7 + O(x^8)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_301exp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("exp (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "exp") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4660; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("exp", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4660; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_300exp(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_300exp(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("exp", 0);

    /* "cypari_src/gen.pyx":4678
 *             1 + x + 1/2*x^2 + 1/6*x^3 + 1/24*x^4 + 1/120*x^5 + 1/720*x^6 + 1/5040*x^7 + O(x^8)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gexp(self.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4679
 *         """
 *         sig_on()
 *         return P.new_gen(gexp(self.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def gamma(gen s, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gexp(__pyx_v_self->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4660
 *         return P.new_gen(eta(x.g, pbw(precision)))
 * 
 *     def exp(gen self, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.exp(): exponential of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.exp", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4681
 *         return P.new_gen(gexp(self.g, pbw(precision)))
 * 
 *     def gamma(gen s, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         s.gamma(precision): Gamma function at s.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_303gamma(PyObject *__pyx_v_s, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_302gamma[] = "\n        s.gamma(precision): Gamma function at s.\n        \n        If `s` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `s` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).gamma()\n            1.00000000000000\n            >>> pari(5).gamma()\n            24.0000000000000\n            >>> pari('1+I').gamma()\n            0.498015668118356 - 0.154949828301811*I\n\n        TESTS::\n\n            >>> pari(-1).gamma()\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_303gamma(PyObject *__pyx_v_s, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("gamma (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gamma") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4681; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("gamma", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4681; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_302gamma(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_s), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_302gamma(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_s, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("gamma", 0);

    /* "cypari_src/gen.pyx":4706
 *             PariError:  (5)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(ggamma(s.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4707
 *         """
 *         sig_on()
 *         return P.new_gen(ggamma(s.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def gammah(gen s, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, ggamma(__pyx_v_s->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4681
 *         return P.new_gen(gexp(self.g, pbw(precision)))
 * 
 *     def gamma(gen s, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         s.gamma(precision): Gamma function at s.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4709
 *         return P.new_gen(ggamma(s.g, pbw(precision)))
 * 
 *     def gammah(gen s, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         s.gammah(): Gamma function evaluated at the argument x+1/2.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_305gammah(PyObject *__pyx_v_s, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_304gammah[] = "\n        s.gammah(): Gamma function evaluated at the argument x+1/2.\n        \n        If `s` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `s` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).gammah()\n            1.32934038817914\n            >>> pari(5).gammah()\n            52.3427777845535\n            >>> pari('1+I').gammah()\n            0.575315188063452 + 0.0882106775440939*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_305gammah(PyObject *__pyx_v_s, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("gammah (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gammah") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4709; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("gammah", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4709; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.gammah", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_304gammah(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_s), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_304gammah(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_s, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("gammah", 0);

    /* "cypari_src/gen.pyx":4727
 *             0.575315188063452 + 0.0882106775440939*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(ggamd(s.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4728
 *         """
 *         sig_on()
 *         return P.new_gen(ggamd(s.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def hyperu(gen a, b, x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, ggamd(__pyx_v_s->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4709
 *         return P.new_gen(ggamma(s.g, pbw(precision)))
 * 
 *     def gammah(gen s, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         s.gammah(): Gamma function evaluated at the argument x+1/2.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.gammah", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4730
 *         return P.new_gen(ggamd(s.g, pbw(precision)))
 * 
 *     def hyperu(gen a, b, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         a.hyperu(b,x): U-confluent hypergeometric function.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_307hyperu(PyObject *__pyx_v_a, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_306hyperu[] = "\n        a.hyperu(b,x): U-confluent hypergeometric function.\n        \n        If `a`, `b`, or `x` is an exact argument,\n        it is first converted to a real or complex number using the\n        optional parameter precision (in bits). If the arguments are\n        inexact (e.g. real), the smallest of their precisions is used in\n        the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).hyperu(2,3)\n            0.333333333333333\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_307hyperu(PyObject *__pyx_v_a, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_b = 0;
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("hyperu (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,&__pyx_n_s_precision,0};
      PyObject* values[3] = {0,0,0};
      values[2] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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_b)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("hyperu", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4730; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hyperu") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4730; __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);
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_b = values[0];
      __pyx_v_x = values[1];
      __pyx_v_precision = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("hyperu", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4730; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.hyperu", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_306hyperu(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_a), __pyx_v_b, __pyx_v_x, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_306hyperu(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("hyperu", 0);

    /* "cypari_src/gen.pyx":4745
 *             0.333333333333333
 *         """
 *         t0GEN(b)             # <<<<<<<<<<<<<<
 *         t1GEN(x)
 *         sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4746
 *         """
 *         t0GEN(b)
 *         t1GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(hyperu(a.g, t0, t1, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4747
 *         t0GEN(b)
 *         t1GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(hyperu(a.g, t0, t1, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4748
 *         t1GEN(x)
 *         sig_on()
 *         return P.new_gen(hyperu(a.g, t0, t1, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def incgam(gen s, x, y=None, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, hyperu(__pyx_v_a->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4730
 *         return P.new_gen(ggamd(s.g, pbw(precision)))
 * 
 *     def hyperu(gen a, b, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         a.hyperu(b,x): U-confluent hypergeometric function.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.hyperu", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4750
 *         return P.new_gen(hyperu(a.g, t0, t1, pbw(precision)))
 * 
 *     def incgam(gen s, x, y=None, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         s.incgam(x, y, precision): incomplete gamma function. y is optional
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_309incgam(PyObject *__pyx_v_s, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_308incgam[] = "\n        s.incgam(x, y, precision): incomplete gamma function. y is optional\n        and is the precomputed value of gamma(s).\n        \n        If `s` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `s` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari('1+I').incgam('3-I')\n            -0.0458297859919946 + 0.0433696818726677*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_309incgam(PyObject *__pyx_v_s, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_y = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("incgam (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_precision,0};
      PyObject* values[3] = {0,0,0};
      values[1] = ((PyObject *)Py_None);
      values[2] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y);
            if (value) { values[1] = value; kw_args--; }
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "incgam") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4750; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      __pyx_v_y = values[1];
      __pyx_v_precision = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("incgam", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4750; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.incgam", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_308incgam(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_s), __pyx_v_x, __pyx_v_y, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_308incgam(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_s, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_precision) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_t_3;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    long __pyx_t_7;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("incgam", 0);

    /* "cypari_src/gen.pyx":4765
 *             -0.0458297859919946 + 0.0433696818726677*I
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         if y is None:
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4766
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if y is None:
 *             return P.new_gen(incgam(s.g, t0, pbw(precision)))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4767
 *         t0GEN(x)
 *         sig_on()
 *         if y is None:             # <<<<<<<<<<<<<<
 *             return P.new_gen(incgam(s.g, t0, pbw(precision)))
 *         else:
 */
    __pyx_t_2 = (__pyx_v_y == Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cypari_src/gen.pyx":4768
 *         sig_on()
 *         if y is None:
 *             return P.new_gen(incgam(s.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 *         else:
 *             t1GEN(y)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __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 = NULL;
        __Pyx_INCREF(__pyx_v_precision);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_precision);
        __Pyx_GIVEREF(__pyx_v_precision);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __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_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, incgam(__pyx_v_s->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_7))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":4770
 *             return P.new_gen(incgam(s.g, t0, pbw(precision)))
 *         else:
 *             t1GEN(y)             # <<<<<<<<<<<<<<
 *             return P.new_gen(incgam0(s.g, t0, t1, pbw(precision)))
 * 
 */
      __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":4771
 *         else:
 *             t1GEN(y)
 *             return P.new_gen(incgam0(s.g, t0, t1, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def incgamc(gen s, x, precision=0):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_precision);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_precision);
        __Pyx_GIVEREF(__pyx_v_precision);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4771; __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_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, incgam0(__pyx_v_s->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, __pyx_t_7))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":4750
 *         return P.new_gen(hyperu(a.g, t0, t1, pbw(precision)))
 * 
 *     def incgam(gen s, x, y=None, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         s.incgam(x, y, precision): incomplete gamma function. y is optional
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_AddTraceback("cypari_src.gen.gen.incgam", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4773
 *             return P.new_gen(incgam0(s.g, t0, t1, pbw(precision)))
 * 
 *     def incgamc(gen s, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         s.incgamc(x): complementary incomplete gamma function.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_311incgamc(PyObject *__pyx_v_s, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_310incgamc[] = "\n        s.incgamc(x): complementary incomplete gamma function.\n        \n        The arguments `x` and `s` are complex numbers such\n        that `s` is not a pole of `\\Gamma` and\n        `|x|/(|s|+1)` is not much larger than `1`\n        (otherwise, the convergence is very slow). The function returns the\n        value of the integral\n        `\\int_{0}^{x} e^{-t} t^{s-1} dt.`\n        \n        If `s` or `x` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).incgamc(2)\n            0.864664716763387\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_311incgamc(PyObject *__pyx_v_s, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("incgamc (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "incgamc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4773; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("incgamc", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4773; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.incgamc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_310incgamc(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_s), __pyx_v_x, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_310incgamc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_s, PyObject *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("incgamc", 0);

    /* "cypari_src/gen.pyx":4795
 *             0.864664716763387
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(incgamc(s.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":4796
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(incgamc(s.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4797
 *         t0GEN(x)
 *         sig_on()
 *         return P.new_gen(incgamc(s.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def log(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, incgamc(__pyx_v_s->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4773
 *             return P.new_gen(incgam0(s.g, t0, t1, pbw(precision)))
 * 
 *     def incgamc(gen s, x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         s.incgamc(x): complementary incomplete gamma function.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.incgamc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4799
 *         return P.new_gen(incgamc(s.g, t0, pbw(precision)))
 * 
 *     def log(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.log(): natural logarithm of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_313log(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_312log[] = "\n        x.log(): natural logarithm of x.\n        \n        This function returns the principal branch of the natural logarithm\n        of `x`, i.e., the branch such that\n        `\\Im(\\log(x)) \\in ]-\\pi, \\pi].` The result is\n        complex (with imaginary part equal to `\\pi`) if\n        `x\\in \\RR` and `x<0`. In general, the algorithm uses\n        the formula\n        \n        .. math::\n        \n                         \\log(x) \\simeq \\frac{\\pi}{2{\\rm agm}(1,4/s)} - m\\log(2),         \n        \n        \n        if `s=x 2^m` is large enough. (The result is exact to\n        `B` bits provided that `s>2^{B/2}`.) At low\n        accuracies, this function computes `\\log` using the series\n        expansion near `1`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        Note that `p`-adic arguments can also be given as input,\n        with the convention that `\\log(p)=0`. Hence, in particular,\n        `\\exp(\\log(x))/x` is not in general equal to `1`\n        but instead to a `(p-1)`-st root of unity (or\n        `\\pm 1` if `p=2`) times a power of `p`.\n        \n        EXAMPLES::\n        \n            >>> pari(5).log()\n            1.60943791243410\n            >>> pari(1j).log()\n            0.E-19 + 1.57079632679490*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_313log(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("log (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "log") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4799; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("log", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4799; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_312log(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_312log(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("log", 0);

    /* "cypari_src/gen.pyx":4838
 *             0.E-19 + 1.57079632679490*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(glog(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4839
 *         """
 *         sig_on()
 *         return P.new_gen(glog(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def log_gamma(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, glog(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4799
 *         return P.new_gen(incgamc(s.g, t0, pbw(precision)))
 * 
 *     def log(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.log(): natural logarithm of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4841
 *         return P.new_gen(glog(x.g, pbw(precision)))
 * 
 *     def log_gamma(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Logarithm of the gamma function of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_315log_gamma(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_314log_gamma[] = "\n        Logarithm of the gamma function of x.\n        \n        This function returns the principal branch of the logarithm of the\n        gamma function of `x`. The function\n        `\\log(\\Gamma(x))` is analytic on the complex plane with\n        non-positive integers removed. This function can have much larger\n        inputs than `\\Gamma` itself.\n        \n        The `p`-adic analogue of this function is unfortunately not\n        implemented.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(100).log_gamma()\n            359.134205369575\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_315log_gamma(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("log_gamma (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "log_gamma") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4841; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("log_gamma", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4841; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.log_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_314log_gamma(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_314log_gamma(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("log_gamma", 0);

    /* "cypari_src/gen.pyx":4864
 *             359.134205369575
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(glngamma(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4865
 *         """
 *         sig_on()
 *         return P.new_gen(glngamma(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def polylog(gen x, long m, flag=0, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, glngamma(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4841
 *         return P.new_gen(glog(x.g, pbw(precision)))
 * 
 *     def log_gamma(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Logarithm of the gamma function of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.log_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4867
 *         return P.new_gen(glngamma(x.g, pbw(precision)))
 * 
 *     def polylog(gen x, long m, flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.polylog(m,flag=0): m-th polylogarithm of x. flag is optional, and
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_317polylog(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_316polylog[] = "\n        x.polylog(m,flag=0): m-th polylogarithm of x. flag is optional, and\n        can be 0: default, 1: D_m -modified m-th polylog of x, 2:\n        D_m-modified m-th polylog of x, 3: P_m-modified m-th polylog of\n        x.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        TODO: Add more explanation, copied from the PARI manual.\n        \n        EXAMPLES::\n        \n            >>> pari(10).polylog(3)\n            5.64181141475134 - 8.32820207698027*I\n            >>> pari(10).polylog(3,0)\n            5.64181141475134 - 8.32820207698027*I\n            >>> pari(10).polylog(3,1)\n            0.523778453502411\n            >>> pari(10).polylog(3,2)\n            -0.400459056163451\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_317polylog(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_m;
    PyObject *__pyx_v_flag = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polylog (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_m,&__pyx_n_s_flag,&__pyx_n_s_precision,0};
      PyObject* values[3] = {0,0,0};
      values[1] = ((PyObject *)__pyx_int_0);
      values[2] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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_m)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polylog") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4867; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_m = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_m == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4867; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_flag = values[1];
      __pyx_v_precision = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polylog", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4867; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polylog", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_316polylog(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_m, __pyx_v_flag, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_316polylog(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_m, PyObject *__pyx_v_flag, PyObject *__pyx_v_precision) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    long __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polylog", 0);

    /* "cypari_src/gen.pyx":4892
 *             -0.400459056163451
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(polylog0(m, x.g, flag, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4893
 *         """
 *         sig_on()
 *         return P.new_gen(polylog0(m, x.g, flag, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def psi(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_precision); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, polylog0(__pyx_v_m, __pyx_v_x->g, __pyx_t_1, __pyx_t_6))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4867
 *         return P.new_gen(glngamma(x.g, pbw(precision)))
 * 
 *     def polylog(gen x, long m, flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.polylog(m,flag=0): m-th polylogarithm of x. flag is optional, and
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.polylog", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4895
 *         return P.new_gen(polylog0(m, x.g, flag, pbw(precision)))
 * 
 *     def psi(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.psi(): psi-function at x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_319psi(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_318psi[] = "\n        x.psi(): psi-function at x.\n        \n        Return the `\\psi`-function of `x`, i.e., the\n        logarithmic derivative `\\Gamma'(x)/\\Gamma(x)`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).psi()\n            -0.577215664901533\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_319psi(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("psi (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "psi") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4895; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("psi", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4895; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.psi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_318psi(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_318psi(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("psi", 0);

    /* "cypari_src/gen.pyx":4912
 *             -0.577215664901533
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gpsi(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4913
 *         """
 *         sig_on()
 *         return P.new_gen(gpsi(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def sin(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gpsi(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4895
 *         return P.new_gen(polylog0(m, x.g, flag, pbw(precision)))
 * 
 *     def psi(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.psi(): psi-function at x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.psi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4915
 *         return P.new_gen(gpsi(x.g, pbw(precision)))
 * 
 *     def sin(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.sin(): The sine of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_321sin(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_320sin[] = "\n        x.sin(): The sine of x.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).sin() \n            0.841470984807897\n            >>> pari('1+I').sin()\n            1.29845758141598 + 0.634963914784736*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_321sin(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sin (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sin") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4915; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("sin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4915; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_320sin(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_320sin(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("sin", 0);

    /* "cypari_src/gen.pyx":4931
 *             1.29845758141598 + 0.634963914784736*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gsin(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4932
 *         """
 *         sig_on()
 *         return P.new_gen(gsin(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def sinh(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gsin(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4915
 *         return P.new_gen(gpsi(x.g, pbw(precision)))
 * 
 *     def sin(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.sin(): The sine of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4934
 *         return P.new_gen(gsin(x.g, pbw(precision)))
 * 
 *     def sinh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         The hyperbolic sine function.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_323sinh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_322sinh[] = "\n        The hyperbolic sine function.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0).sinh()\n            0.E-19\n            >>> pari('1+I').sinh()\n            0.634963914784736 + 1.29845758141598*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_323sinh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sinh (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sinh") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4934; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("sinh", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4934; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_322sinh(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_322sinh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("sinh", 0);

    /* "cypari_src/gen.pyx":4950
 *             0.634963914784736 + 1.29845758141598*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gsh(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4951
 *         """
 *         sig_on()
 *         return P.new_gen(gsh(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def sqr(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gsh(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4934
 *         return P.new_gen(gsin(x.g, pbw(precision)))
 * 
 *     def sinh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         The hyperbolic sine function.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4953
 *         return P.new_gen(gsh(x.g, pbw(precision)))
 * 
 *     def sqr(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         x.sqr(): square of x. Faster than, and most of the time (but not
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_325sqr(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_324sqr[] = "\n        x.sqr(): square of x. Faster than, and most of the time (but not\n        always - see the examples) identical to x\\*x.\n        \n        EXAMPLES::\n        \n            >>> pari(2).sqr()\n            4\n        \n        For `2`-adic numbers, x.sqr() may not be identical to x\\*x\n        (squaring a `2`-adic number increases its precision)::\n        \n            >>> pari(\"1+O(2^5)\").sqr()\n            1 + O(2^6)\n            >>> pari(\"1+O(2^5)\")*pari(\"1+O(2^5)\")\n            1 + O(2^5)\n        \n        However::\n        \n            >>> x = pari(\"1+O(2^5)\"); x*x\n            1 + O(2^6)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_325sqr(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sqr (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_324sqr(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_324sqr(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("sqr", 0);

    /* "cypari_src/gen.pyx":4976
 *             1 + O(2^6)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gsqr(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4977
 *         """
 *         sig_on()
 *         return P.new_gen(gsqr(x.g))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gsqr(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4953
 *         return P.new_gen(gsh(x.g, pbw(precision)))
 * 
 *     def sqr(gen x):             # <<<<<<<<<<<<<<
 *         """
 *         x.sqr(): square of x. Faster than, and most of the time (but not
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.sqr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4980
 * 
 * 
 *     def sqrt(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.sqrt(precision): The square root of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_327sqrt(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_326sqrt[] = "\n        x.sqrt(precision): The square root of x.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).sqrt()\n            1.41421356237310\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_327sqrt(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sqrt (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sqrt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4980; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("sqrt", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4980; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_326sqrt(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_326sqrt(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("sqrt", 0);

    /* "cypari_src/gen.pyx":4994
 *             1.41421356237310
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gsqrt(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":4995
 *         """
 *         sig_on()
 *         return P.new_gen(gsqrt(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def sqrtn(gen x, n, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gsqrt(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4980
 * 
 * 
 *     def sqrt(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.sqrt(precision): The square root of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":4997
 *         return P.new_gen(gsqrt(x.g, pbw(precision)))
 * 
 *     def sqrtn(gen x, n, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.sqrtn(n): return the principal branch of the n-th root of x,
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_329sqrtn(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_328sqrtn[] = "\n        x.sqrtn(n): return the principal branch of the n-th root of x,\n        i.e., the one such that\n        `\\arg(\\sqrt(x)) \\in ]-\\pi/n, \\pi/n]`. Also returns a second\n        argument which is a suitable root of unity allowing one to recover\n        all the other roots. If it was not possible to find such a number,\n        then this second return value is 0. If the argument is present and\n        no square root exists, return 0 instead of raising an error.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        .. note::\n\n           intmods (modulo a prime) and `p`-adic numbers are\n           allowed as arguments.\n        \n        INPUT:\n        \n        \n        -  ``x`` - gen\n        \n        -  ``n`` - integer\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - principal n-th root of x\n        \n        -  ``gen`` - root of unity z that gives the other\n           roots\n        \n        \n        EXAMPLES::\n        \n            >>> s, z = pari(2).sqrtn(5)\n            >>> z\n            0.309016994374947 + 0.951056516295154*I\n            >>> s\n            1.14869835499704\n            >>> s**5\n            2.00000000000000\n            >>> z**5    # 32-bit: 1.00000000000000 + 5.42101086 E-19*I \n            1.00000000000000 + 5.96311194867027 E-19*I\n            >>> (s*z)**5   # 32-bit  2.00000000000000 + 1.409462824 E-18*I       \n            2.00000000000000 + 9.21571846612679 E-19*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_329sqrtn(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_n = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sqrtn (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_n)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sqrtn") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4997; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_n = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("sqrtn", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.sqrtn", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_328sqrtn(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_n, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_328sqrtn(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_n, PyObject *__pyx_v_precision) {
    GEN __pyx_v_zetan;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_ans = 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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("sqrtn", 0);

    /* "cypari_src/gen.pyx":5050
 *         # TODO: ???  lots of good examples in the PARI docs ???
 *         cdef GEN zetan
 *         t0GEN(n)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         ans = P.new_gen_noclear(gsqrtn(x.g, t0, &zetan, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5051
 *         cdef GEN zetan
 *         t0GEN(n)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         ans = P.new_gen_noclear(gsqrtn(x.g, t0, &zetan, pbw(precision)))
 *         return ans, P.new_gen(zetan)
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5052
 *         t0GEN(n)
 *         sig_on()
 *         ans = P.new_gen_noclear(gsqrtn(x.g, t0, &zetan, pbw(precision)))             # <<<<<<<<<<<<<<
 *         return ans, P.new_gen(zetan)
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen_noclear(__pyx_v_10cypari_src_3gen_P, gsqrtn(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0, (&__pyx_v_zetan), __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_ans = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5053
 *         sig_on()
 *         ans = P.new_gen_noclear(gsqrtn(x.g, t0, &zetan, pbw(precision)))
 *         return ans, P.new_gen(zetan)             # <<<<<<<<<<<<<<
 * 
 *     def tan(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_v_zetan)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_ans));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ans));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_ans));
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":4997
 *         return P.new_gen(gsqrt(x.g, pbw(precision)))
 * 
 *     def sqrtn(gen x, n, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.sqrtn(n): return the principal branch of the n-th root of x,
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.sqrtn", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_ans);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5055
 *         return ans, P.new_gen(zetan)
 * 
 *     def tan(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.tan() - tangent of x
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_331tan(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_330tan[] = "\n        x.tan() - tangent of x\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(2).tan()\n            -2.18503986326152\n            >>> pari(1j).tan()\n            0.E-308 + 0.761594155955765*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_331tan(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("tan (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tan") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5055; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("tan", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5055; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_330tan(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_330tan(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("tan", 0);

    /* "cypari_src/gen.pyx":5071
 *             0.E-308 + 0.761594155955765*I
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gtan(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5072
 *         """
 *         sig_on()
 *         return P.new_gen(gtan(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def tanh(gen x, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gtan(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5055
 *         return ans, P.new_gen(zetan)
 * 
 *     def tan(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.tan() - tangent of x
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5074
 *         return P.new_gen(gtan(x.g, pbw(precision)))
 * 
 *     def tanh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.tanh() - hyperbolic tangent of x
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_333tanh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_332tanh[] = "\n        x.tanh() - hyperbolic tangent of x\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(1).tanh()\n            0.761594155955765\n            >>> z = pari(1j); z\n            0.E-307 + 1.00000000000000*I\n            >>> result = z.tanh()\n            >>> result.real() <= 1e-18\n            True\n            >>> result.imag()\n            1.55740772465490\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_333tanh(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("tanh (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tanh") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5074; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("tanh", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5074; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_332tanh(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_332tanh(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("tanh", 0);

    /* "cypari_src/gen.pyx":5095
 *             1.55740772465490
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gth(x.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5096
 *         """
 *         sig_on()
 *         return P.new_gen(gth(x.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def teichmuller(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gth(__pyx_v_x->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5074
 *         return P.new_gen(gtan(x.g, pbw(precision)))
 * 
 *     def tanh(gen x, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.tanh() - hyperbolic tangent of x
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5098
 *         return P.new_gen(gth(x.g, pbw(precision)))
 * 
 *     def teichmuller(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         teichmuller(x): teichmuller character of p-adic number x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_335teichmuller(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_334teichmuller[] = "\n        teichmuller(x): teichmuller character of p-adic number x.\n        \n        This is the unique `(p-1)`-st root of unity congruent to\n        `x/p^{v_p(x)}` modulo `p`.\n        \n        EXAMPLES::\n        \n            >>> pari('2+O(7^5)').teichmuller()\n            2 + 4*7 + 6*7^2 + 3*7^3 + O(7^5)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_335teichmuller(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("teichmuller (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_334teichmuller(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_334teichmuller(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("teichmuller", 0);

    /* "cypari_src/gen.pyx":5110
 *             2 + 4*7 + 6*7^2 + 3*7^3 + O(7^5)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(teich(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5111
 *         """
 *         sig_on()
 *         return P.new_gen(teich(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def theta(gen q, z, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, teich(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5098
 *         return P.new_gen(gth(x.g, pbw(precision)))
 * 
 *     def teichmuller(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         teichmuller(x): teichmuller character of p-adic number x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.teichmuller", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5113
 *         return P.new_gen(teich(x.g))
 * 
 *     def theta(gen q, z, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         q.theta(z): Jacobi sine theta-function.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_337theta(PyObject *__pyx_v_q, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_336theta[] = "\n        q.theta(z): Jacobi sine theta-function.\n        \n        If `q` or `z` is an exact argument, it is first\n        converted to a real or complex number using the optional parameter\n        precision (in bits). If the arguments are inexact (e.g. real), the\n        smallest of their precisions is used in the computation, and the\n        parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0.5).theta(2)\n            1.63202590295260\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_337theta(PyObject *__pyx_v_q, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_z = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("theta (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_z,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_z)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "theta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5113; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_z = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("theta", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.theta", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_336theta(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_q), __pyx_v_z, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_336theta(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_q, PyObject *__pyx_v_z, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("theta", 0);

    /* "cypari_src/gen.pyx":5128
 *             1.63202590295260
 *         """
 *         t0GEN(z)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(theta(q.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5129
 *         """
 *         t0GEN(z)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(theta(q.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5130
 *         t0GEN(z)
 *         sig_on()
 *         return P.new_gen(theta(q.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def thetanullk(gen q, long k, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, theta(__pyx_v_q->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5113
 *         return P.new_gen(teich(x.g))
 * 
 *     def theta(gen q, z, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         q.theta(z): Jacobi sine theta-function.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.theta", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5132
 *         return P.new_gen(theta(q.g, t0, pbw(precision)))
 * 
 *     def thetanullk(gen q, long k, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         q.thetanullk(k): return the k-th derivative at z=0 of theta(q,z).
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_339thetanullk(PyObject *__pyx_v_q, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_338thetanullk[] = "\n        q.thetanullk(k): return the k-th derivative at z=0 of theta(q,z).\n        \n        If `q` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `q` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        EXAMPLES::\n        \n            >>> pari(0.5).thetanullk(1)\n            0.548978532560341\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_339thetanullk(PyObject *__pyx_v_q, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_k;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("thetanullk (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_k)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "thetanullk") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_k = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_k == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("thetanullk", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.thetanullk", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_338thetanullk(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_q), __pyx_v_k, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_338thetanullk(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_q, long __pyx_v_k, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("thetanullk", 0);

    /* "cypari_src/gen.pyx":5146
 *             0.548978532560341
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(thetanullk(q.g, k, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5147
 *         """
 *         sig_on()
 *         return P.new_gen(thetanullk(q.g, k, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def weber(gen x, flag=0, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, thetanullk(__pyx_v_q->g, __pyx_v_k, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5132
 *         return P.new_gen(theta(q.g, t0, pbw(precision)))
 * 
 *     def thetanullk(gen q, long k, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         q.thetanullk(k): return the k-th derivative at z=0 of theta(q,z).
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.thetanullk", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5149
 *         return P.new_gen(thetanullk(q.g, k, pbw(precision)))
 * 
 *     def weber(gen x, flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.weber(flag=0): One of Weber's f functions of x. flag is optional,
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_341weber(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_340weber[] = "\n        x.weber(flag=0): One of Weber's f functions of x. flag is optional,\n        and can be 0: default, function\n        f(x)=exp(-i\\*Pi/24)\\*eta((x+1)/2)/eta(x) such that\n        `j=(f^{24}-16)^3/f^{24}`, 1: function f1(x)=eta(x/2)/eta(x)\n        such that `j=(f1^24+16)^3/f2^{24}`, 2: function\n        f2(x)=sqrt(2)\\*eta(2\\*x)/eta(x) such that\n        `j=(f2^{24}+16)^3/f2^{24}`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        TODO: Add further explanation from PARI manual.\n        \n        EXAMPLES::\n        \n            >>> pari('I').weber()  # 32-bit: 1.18920711500272 + 0.E-19*I \n            1.18920711500272 + 2.71050543121376 E-20*I\n            >>> pari(1j).weber(1)    \n            1.09050773266526 + 0.E-308*I\n            >>> pari('I').weber(2)\n            1.09050773266526\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_341weber(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("weber (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[0] = ((PyObject *)__pyx_int_0);
      values[1] = ((PyObject *)__pyx_int_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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "weber") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5149; __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_flag = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("weber", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.weber", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_340weber(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_flag, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_340weber(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_flag, PyObject *__pyx_v_precision) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    long __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("weber", 0);

    /* "cypari_src/gen.pyx":5175
 *             1.09050773266526
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(weber0(x.g, flag, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5176
 *         """
 *         sig_on()
 *         return P.new_gen(weber0(x.g, flag, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def zeta(gen s, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_precision); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, weber0(__pyx_v_x->g, __pyx_t_1, __pyx_t_6))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5149
 *         return P.new_gen(thetanullk(q.g, k, pbw(precision)))
 * 
 *     def weber(gen x, flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         x.weber(flag=0): One of Weber's f functions of x. flag is optional,
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.weber", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5178
 *         return P.new_gen(weber0(x.g, flag, pbw(precision)))
 * 
 *     def zeta(gen s, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         zeta(s): zeta function at s with s a complex or a p-adic number.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_343zeta(PyObject *__pyx_v_s, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_342zeta[] = "\n        zeta(s): zeta function at s with s a complex or a p-adic number.\n        \n        If `s` is a complex number, this is the Riemann zeta\n        function `\\zeta(s)=\\sum_{n\\geq 1} n^{-s}`, computed either\n        using the Euler-Maclaurin summation formula (if `s` is not\n        an integer), or using Bernoulli numbers (if `s` is a\n        negative integer or an even nonnegative integer), or using modular\n        forms (if `s` is an odd nonnegative integer).\n        \n        If `s` is a `p`-adic number, this is the\n        Kubota-Leopoldt zeta function, i.e. the unique continuous\n        `p`-adic function on the `p`-adic integers that\n        interpolates the values of `(1-p^{-k})\\zeta(k)` at negative\n        integers `k` such that `k\\equiv 1\\pmod{p-1}` if\n        `p` is odd, and at odd `k` if `p=2`.\n        \n        If `x` is an exact argument, it is first converted to a\n        real or complex number using the optional parameter precision (in\n        bits). If `x` is inexact (e.g. real), its own precision is\n        used in the computation, and the parameter precision is ignored.\n        \n        INPUT:\n        \n        \n        -  ``s`` - gen (real, complex, or p-adic number)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - value of zeta at s.\n        \n        \n        EXAMPLES::\n        \n            >>> pari(2).zeta()\n            1.64493406684823\n            >>> x = pari.pi()**2/6\n            >>> pari(x)\n            1.64493406684823\n            >>> pari(3).zeta()\n            1.20205690315959\n            >>> pari('1+5*7+2*7^2+O(7^3)').zeta()\n            4*7^-2 + 5*7^-1 + O(7^0)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_343zeta(PyObject *__pyx_v_s, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("zeta (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5178; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("zeta", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.zeta", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_342zeta(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_s), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_342zeta(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_s, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("zeta", 0);

    /* "cypari_src/gen.pyx":5225
 *             4*7^-2 + 5*7^-1 + O(7^0)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gzeta(s.g, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5226
 *         """
 *         sig_on()
 *         return P.new_gen(gzeta(s.g, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     ###########################################
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gzeta(__pyx_v_s->g, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5178
 *         return P.new_gen(weber0(x.g, flag, pbw(precision)))
 * 
 *     def zeta(gen s, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         zeta(s): zeta function at s with s a complex or a p-adic number.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.zeta", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5232
 *     ###########################################
 * 
 *     def bezout(gen x, y):             # <<<<<<<<<<<<<<
 *         cdef gen u, v, g
 *         cdef GEN U, V, G
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_345bezout(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_345bezout(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bezout (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_344bezout(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_344bezout(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_u = 0;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_v = 0;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_g = 0;
    GEN __pyx_v_U;
    GEN __pyx_v_V;
    GEN __pyx_v_G;
    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("bezout", 0);

    /* "cypari_src/gen.pyx":5235
 *         cdef gen u, v, g
 *         cdef GEN U, V, G
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         G = gbezout(x.g, t0, &U, &V)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5236
 *         cdef GEN U, V, G
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         G = gbezout(x.g, t0, &U, &V)
 *         g = P.new_gen_noclear(G)
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5237
 *         t0GEN(y)
 *         sig_on()
 *         G = gbezout(x.g, t0, &U, &V)             # <<<<<<<<<<<<<<
 *         g = P.new_gen_noclear(G)
 *         u = P.new_gen_noclear(U)
 */
    __pyx_v_G = gbezout(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0, (&__pyx_v_U), (&__pyx_v_V));

    /* "cypari_src/gen.pyx":5238
 *         sig_on()
 *         G = gbezout(x.g, t0, &U, &V)
 *         g = P.new_gen_noclear(G)             # <<<<<<<<<<<<<<
 *         u = P.new_gen_noclear(U)
 *         v = P.new_gen(V)
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen_noclear(__pyx_v_10cypari_src_3gen_P, __pyx_v_G)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_g = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5239
 *         G = gbezout(x.g, t0, &U, &V)
 *         g = P.new_gen_noclear(G)
 *         u = P.new_gen_noclear(U)             # <<<<<<<<<<<<<<
 *         v = P.new_gen(V)
 *         return g, u, v
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen_noclear(__pyx_v_10cypari_src_3gen_P, __pyx_v_U)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_u = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5240
 *         g = P.new_gen_noclear(G)
 *         u = P.new_gen_noclear(U)
 *         v = P.new_gen(V)             # <<<<<<<<<<<<<<
 *         return g, u, v
 * 
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_v_V)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_v = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5241
 *         u = P.new_gen_noclear(U)
 *         v = P.new_gen(V)
 *         return g, u, v             # <<<<<<<<<<<<<<
 * 
 *     def binomial(gen x, long k):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_g));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_g));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_g));
    __Pyx_INCREF(((PyObject *)__pyx_v_u));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_u));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_u));
    __Pyx_INCREF(((PyObject *)__pyx_v_v));
    PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_v));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_v));
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5232
 *     ###########################################
 * 
 *     def bezout(gen x, y):             # <<<<<<<<<<<<<<
 *         cdef gen u, v, g
 *         cdef GEN U, V, G
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bezout", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_u);
    __Pyx_XDECREF((PyObject *)__pyx_v_v);
    __Pyx_XDECREF((PyObject *)__pyx_v_g);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5243
 *         return g, u, v
 * 
 *     def binomial(gen x, long k):             # <<<<<<<<<<<<<<
 *         """
 *         binomial(x, k): return the binomial coefficient "x choose k".
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_347binomial(PyObject *__pyx_v_x, PyObject *__pyx_arg_k); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_346binomial[] = "\n        binomial(x, k): return the binomial coefficient \"x choose k\".\n        \n        INPUT:\n        \n        \n        -  ``x`` - any PARI object (gen)\n        \n        -  ``k`` - integer\n        \n        \n        EXAMPLES::\n        \n            >>> pari(6).binomial(2)\n            15\n            >>> pari('x+1').binomial(3)\n            1/6*x^3 - 1/6*x\n            >>> pari('2+x+O(x^2)').binomial(3)\n            1/3*x + O(x^2)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_347binomial(PyObject *__pyx_v_x, PyObject *__pyx_arg_k) {
    long __pyx_v_k;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("binomial (wrapper)", 0);
    assert(__pyx_arg_k); {
      __pyx_v_k = __Pyx_PyInt_As_long(__pyx_arg_k); if (unlikely((__pyx_v_k == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.binomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_346binomial(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((long)__pyx_v_k));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_346binomial(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, long __pyx_v_k) {
    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("binomial", 0);

    /* "cypari_src/gen.pyx":5264
 *             1/3*x + O(x^2)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(binomial(x.g, k))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5265
 *         """
 *         sig_on()
 *         return P.new_gen(binomial(x.g, k))             # <<<<<<<<<<<<<<
 * 
 *     def contfrac(gen x, b=0, long lmax=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, binomial(__pyx_v_x->g, __pyx_v_k))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5243
 *         return g, u, v
 * 
 *     def binomial(gen x, long k):             # <<<<<<<<<<<<<<
 *         """
 *         binomial(x, k): return the binomial coefficient "x choose k".
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.binomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5267
 *         return P.new_gen(binomial(x.g, k))
 * 
 *     def contfrac(gen x, b=0, long lmax=0):             # <<<<<<<<<<<<<<
 *         """
 *         contfrac(x,b,lmax): continued fraction expansion of x (x rational,
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_349contfrac(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_348contfrac[] = "\n        contfrac(x,b,lmax): continued fraction expansion of x (x rational,\n        real or rational function). b and lmax are both optional, where b\n        is the vector of numerators of the continued fraction, and lmax is\n        a bound for the number of terms in the continued fraction\n        expansion.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_349contfrac(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_b = 0;
    long __pyx_v_lmax;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("contfrac (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_lmax,0};
      PyObject* values[2] = {0,0};
      values[0] = ((PyObject *)__pyx_int_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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lmax);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contfrac") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5267; __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_b = values[0];
      if (values[1]) {
        __pyx_v_lmax = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_lmax == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_lmax = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("contfrac", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.contfrac", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_348contfrac(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_b, __pyx_v_lmax);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_348contfrac(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_b, long __pyx_v_lmax) {
    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("contfrac", 0);

    /* "cypari_src/gen.pyx":5275
 *         expansion.
 *         """
 *         t0GEN(b)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(contfrac0(x.g, t0, lmax))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5276
 *         """
 *         t0GEN(b)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(contfrac0(x.g, t0, lmax))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5277
 *         t0GEN(b)
 *         sig_on()
 *         return P.new_gen(contfrac0(x.g, t0, lmax))             # <<<<<<<<<<<<<<
 * 
 *     def contfracpnqn(gen x, b=0, long lmax=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, contfrac0(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_lmax))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5267
 *         return P.new_gen(binomial(x.g, k))
 * 
 *     def contfrac(gen x, b=0, long lmax=0):             # <<<<<<<<<<<<<<
 *         """
 *         contfrac(x,b,lmax): continued fraction expansion of x (x rational,
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.contfrac", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5279
 *         return P.new_gen(contfrac0(x.g, t0, lmax))
 * 
 *     def contfracpnqn(gen x, b=0, long lmax=0):             # <<<<<<<<<<<<<<
 *         """
 *         contfracpnqn(x): [p_n,p_n-1; q_n,q_n-1] corresponding to the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_351contfracpnqn(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_350contfracpnqn[] = "\n        contfracpnqn(x): [p_n,p_n-1; q_n,q_n-1] corresponding to the\n        continued fraction x.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_351contfracpnqn(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    CYTHON_UNUSED PyObject *__pyx_v_b = 0;
    CYTHON_UNUSED long __pyx_v_lmax;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("contfracpnqn (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_lmax,0};
      PyObject* values[2] = {0,0};
      values[0] = ((PyObject *)__pyx_int_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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lmax);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contfracpnqn") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5279; __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_b = values[0];
      if (values[1]) {
        __pyx_v_lmax = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_lmax == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_lmax = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("contfracpnqn", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.contfracpnqn", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_350contfracpnqn(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_b, __pyx_v_lmax);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_350contfracpnqn(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_b, CYTHON_UNUSED long __pyx_v_lmax) {
    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("contfracpnqn", 0);

    /* "cypari_src/gen.pyx":5284
 *         continued fraction x.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(pnqn(x.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5285
 *         """
 *         sig_on()
 *         return P.new_gen(pnqn(x.g))             # <<<<<<<<<<<<<<
 * 
 *     def fibonacci(gen x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, pnqn(__pyx_v_x->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5279
 *         return P.new_gen(contfrac0(x.g, t0, lmax))
 * 
 *     def contfracpnqn(gen x, b=0, long lmax=0):             # <<<<<<<<<<<<<<
 *         """
 *         contfracpnqn(x): [p_n,p_n-1; q_n,q_n-1] corresponding to the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.contfracpnqn", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5287
 *         return P.new_gen(pnqn(x.g))
 * 
 *     def fibonacci(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         Return the Fibonacci number of index x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_353fibonacci(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_352fibonacci[] = "\n        Return the Fibonacci number of index x.\n        \n        EXAMPLES::\n        \n            >>> pari(18).fibonacci()\n            2584\n            >>> [pari(n).fibonacci() for n in range(10)]\n            [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_353fibonacci(PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("fibonacci (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_352fibonacci(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_352fibonacci(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    long __pyx_t_3;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("fibonacci", 0);

    /* "cypari_src/gen.pyx":5298
 *             [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(fibo(long(x)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5299
 *         """
 *         sig_on()
 *         return P.new_gen(fibo(long(x)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_x));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_x));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_x));
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyLong_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, fibo(__pyx_t_3))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5287
 *         return P.new_gen(pnqn(x.g))
 * 
 *     def fibonacci(gen x):             # <<<<<<<<<<<<<<
 *         r"""
 *         Return the Fibonacci number of index x.
 */

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

  /* "cypari_src/gen.pyx":5302
 * 
 * 
 *     def gcd(gen x, y, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         gcd(x,y,flag=0): greatest common divisor of x and y. flag is
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_355gcd(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_354gcd[] = "\n        gcd(x,y,flag=0): greatest common divisor of x and y. flag is\n        optional, and can be 0: default, 1: use the modular gcd algorithm\n        (x and y must be polynomials), 2 use the subresultant algorithm (x\n        and y must be polynomials)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_355gcd(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_y = 0;
    CYTHON_UNUSED long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("gcd (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_flag,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_y)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gcd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5302; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_y = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5302; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("gcd", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5302; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.gcd", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_354gcd(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_y, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_354gcd(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y, CYTHON_UNUSED long __pyx_v_flag) {
    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("gcd", 0);

    /* "cypari_src/gen.pyx":5309
 *         and y must be polynomials)
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(ggcd0(x.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5310
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(ggcd0(x.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5311
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(ggcd0(x.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def issquare(gen x, find_root=False):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, ggcd0(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5302
 * 
 * 
 *     def gcd(gen x, y, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         gcd(x,y,flag=0): greatest common divisor of x and y. flag is
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.gcd", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5313
 *         return P.new_gen(ggcd0(x.g, t0))
 * 
 *     def issquare(gen x, find_root=False):             # <<<<<<<<<<<<<<
 *         """
 *         issquare(x,n): true(1) if x is a square, false(0) if not. If
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_357issquare(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_356issquare[] = "\n        issquare(x,n): true(1) if x is a square, false(0) if not. If\n        find_root is given, also returns the exact square root if it was\n        computed.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_357issquare(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_find_root = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("issquare (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_find_root,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)Py_False);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_find_root);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "issquare") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5313; __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_find_root = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("issquare", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5313; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.issquare", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_356issquare(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_find_root);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_356issquare(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_find_root) {
    GEN __pyx_v_G;
    GEN __pyx_v_t;
    PyObject *__pyx_v_v = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("issquare", 0);

    /* "cypari_src/gen.pyx":5321
 *         cdef GEN G, t
 *         cdef gen g
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if find_root:
 *             t = gissquareall(x.g, &G)
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5322
 *         cdef gen g
 *         sig_on()
 *         if find_root:             # <<<<<<<<<<<<<<
 *             t = gissquareall(x.g, &G)
 *             v = bool(P.new_gen_noclear(t))
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_find_root); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":5323
 *         sig_on()
 *         if find_root:
 *             t = gissquareall(x.g, &G)             # <<<<<<<<<<<<<<
 *             v = bool(P.new_gen_noclear(t))
 *             if v:
 */
      __pyx_v_t = gissquareall(__pyx_v_x->g, (&__pyx_v_G));

      /* "cypari_src/gen.pyx":5324
 *         if find_root:
 *             t = gissquareall(x.g, &G)
 *             v = bool(P.new_gen_noclear(t))             # <<<<<<<<<<<<<<
 *             if v:
 *                 return v, P.new_gen(G)
 */
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen_noclear(__pyx_v_10cypari_src_3gen_P, __pyx_v_t)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_v = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "cypari_src/gen.pyx":5325
 *             t = gissquareall(x.g, &G)
 *             v = bool(P.new_gen_noclear(t))
 *             if v:             # <<<<<<<<<<<<<<
 *                 return v, P.new_gen(G)
 *             else:
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_v); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_1) {

        /* "cypari_src/gen.pyx":5326
 *             v = bool(P.new_gen_noclear(t))
 *             if v:
 *                 return v, P.new_gen(G)             # <<<<<<<<<<<<<<
 *             else:
 *                 sig_off()
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_v_G)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5326; __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 = 5326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_v);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_v);
        __Pyx_GIVEREF(__pyx_v_v);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;
      }
      /*else*/ {

        /* "cypari_src/gen.pyx":5328
 *                 return v, P.new_gen(G)
 *             else:
 *                 sig_off()             # <<<<<<<<<<<<<<
 *                 return v, None
 *         else:
 */
        __pyx_f_10cypari_src_3gen_sig_off();

        /* "cypari_src/gen.pyx":5329
 *             else:
 *                 sig_off()
 *                 return v, None             # <<<<<<<<<<<<<<
 *         else:
 *             return P.new_gen(gissquare(x.g))
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_v);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_v);
        __Pyx_GIVEREF(__pyx_v_v);
        __Pyx_INCREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
        __Pyx_GIVEREF(Py_None);
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;
      }
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":5331
 *                 return v, None
 *         else:
 *             return P.new_gen(gissquare(x.g))             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gissquare(__pyx_v_x->g))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":5313
 *         return P.new_gen(ggcd0(x.g, t0))
 * 
 *     def issquare(gen x, find_root=False):             # <<<<<<<<<<<<<<
 *         """
 *         issquare(x,n): true(1) if x is a square, false(0) if not. If
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.issquare", __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;
  }

  /* "cypari_src/gen.pyx":5334
 * 
 * 
 *     def issquarefree(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         EXAMPLES::
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_359issquarefree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_358issquarefree[] = "\n        EXAMPLES::\n        \n            >>> pari(10).issquarefree()\n            True\n            >>> pari(20).issquarefree()\n            False\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_359issquarefree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("issquarefree (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_358issquarefree(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_358issquarefree(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    PyObject *__pyx_v_t = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("issquarefree", 0);

    /* "cypari_src/gen.pyx":5343
 *             False
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         t = bool(issquarefree(self.g))
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5344
 *         """
 *         sig_on()
 *         t = bool(issquarefree(self.g))             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return t
 */
    __pyx_t_1 = __Pyx_PyInt_From_long(issquarefree(__pyx_v_self->g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_t = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5345
 *         sig_on()
 *         t = bool(issquarefree(self.g))
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return t
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":5346
 *         t = bool(issquarefree(self.g))
 *         sig_off()
 *         return t             # <<<<<<<<<<<<<<
 * 
 *     def lcm(gen x, y):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_t);
    __pyx_r = __pyx_v_t;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5334
 * 
 * 
 *     def issquarefree(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         EXAMPLES::
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.issquarefree", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_t);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5348
 *         return t
 * 
 *     def lcm(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Return the least common multiple of x and y. EXAMPLES::
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_361lcm(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_360lcm[] = "\n        Return the least common multiple of x and y. EXAMPLES::\n        \n            >>> pari(10).lcm(15)\n            30\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_361lcm(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("lcm (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_360lcm(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_360lcm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
    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("lcm", 0);

    /* "cypari_src/gen.pyx":5355
 *             30
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(glcm(x.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5356
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(glcm(x.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5357
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(glcm(x.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def numdiv(gen n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, glcm(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5348
 *         return t
 * 
 *     def lcm(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Return the least common multiple of x and y. EXAMPLES::
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.lcm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5359
 *         return P.new_gen(glcm(x.g, t0))
 * 
 *     def numdiv(gen n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of divisors of the integer n.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_363numdiv(PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_362numdiv[] = "\n        Return the number of divisors of the integer n.\n        \n        EXAMPLES::\n        \n            >>> pari(10).numdiv()\n            4\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_363numdiv(PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("numdiv (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_362numdiv(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_362numdiv(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("numdiv", 0);

    /* "cypari_src/gen.pyx":5368
 *             4
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gnumbdiv(n.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5369
 *         """
 *         sig_on()
 *         return P.new_gen(gnumbdiv(n.g))             # <<<<<<<<<<<<<<
 * 
 *     def phi(gen n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gnumbdiv(__pyx_v_n->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5359
 *         return P.new_gen(glcm(x.g, t0))
 * 
 *     def numdiv(gen n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of divisors of the integer n.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.numdiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5371
 *         return P.new_gen(gnumbdiv(n.g))
 * 
 *     def phi(gen n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Euler phi function of n. EXAMPLES::
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_365phi(PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_364phi[] = "\n        Return the Euler phi function of n. EXAMPLES::\n        \n            >>> pari(10).phi()\n            4\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_365phi(PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("phi (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_364phi(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_364phi(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("phi", 0);

    /* "cypari_src/gen.pyx":5378
 *             4
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(geulerphi(n.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5379
 *         """
 *         sig_on()
 *         return P.new_gen(geulerphi(n.g))             # <<<<<<<<<<<<<<
 * 
 *     def primepi(gen self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, geulerphi(__pyx_v_n->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5371
 *         return P.new_gen(gnumbdiv(n.g))
 * 
 *     def phi(gen n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the Euler phi function of n. EXAMPLES::
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.phi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5381
 *         return P.new_gen(geulerphi(n.g))
 * 
 *     def primepi(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of primes less than or equal to self.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_367primepi(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_366primepi[] = "\n        Return the number of primes less than or equal to self.\n        \n        EXAMPLES::\n        \n            >>> pari(7).primepi()\n            4\n            >>> pari(100).primepi()\n            25\n            >>> pari(1000).primepi()\n            168\n            >>> pari(100000).primepi()\n            9592\n            >>> pari(0).primepi()\n            0\n            >>> pari(-15).primepi()\n            0\n            >>> pari(500509).primepi()\n            41581\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_367primepi(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("primepi (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_366primepi(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_366primepi(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    int __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("primepi", 0);

    /* "cypari_src/gen.pyx":5403
 *         """
 *         global num_primes
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if self > pari(num_primes):
 *             P.init_primes(self + 10)
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5404
 *         global num_primes
 *         sig_on()
 *         if self > pari(num_primes):             # <<<<<<<<<<<<<<
 *             P.init_primes(self + 10)
 *         if signe(self.g) != 1:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_unsigned_long(__pyx_v_10cypari_src_3gen_num_primes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_self), __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {

      /* "cypari_src/gen.pyx":5405
 *         sig_on()
 *         if self > pari(num_primes):
 *             P.init_primes(self + 10)             # <<<<<<<<<<<<<<
 *         if signe(self.g) != 1:
 *             sig_off()
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_10cypari_src_3gen_P), __pyx_n_s_init_primes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_v_self), __pyx_int_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":5406
 *         if self > pari(num_primes):
 *             P.init_primes(self + 10)
 *         if signe(self.g) != 1:             # <<<<<<<<<<<<<<
 *             sig_off()
 *             return P.PARI_ZERO
 */
    __pyx_t_6 = ((signe(__pyx_v_self->g) != 1) != 0);
    if (__pyx_t_6) {

      /* "cypari_src/gen.pyx":5407
 *             P.init_primes(self + 10)
 *         if signe(self.g) != 1:
 *             sig_off()             # <<<<<<<<<<<<<<
 *             return P.PARI_ZERO
 *         return P.new_gen(primepi(self.g))
 */
      __pyx_f_10cypari_src_3gen_sig_off();

      /* "cypari_src/gen.pyx":5408
 *         if signe(self.g) != 1:
 *             sig_off()
 *             return P.PARI_ZERO             # <<<<<<<<<<<<<<
 *         return P.new_gen(primepi(self.g))
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_P->PARI_ZERO));
      __pyx_r = ((PyObject *)__pyx_v_10cypari_src_3gen_P->PARI_ZERO);
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":5409
 *             sig_off()
 *             return P.PARI_ZERO
 *         return P.new_gen(primepi(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def sumdiv(gen n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, primepi(__pyx_v_self->g))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5381
 *         return P.new_gen(geulerphi(n.g))
 * 
 *     def primepi(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of primes less than or equal to self.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.primepi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5411
 *         return P.new_gen(primepi(self.g))
 * 
 *     def sumdiv(gen n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the sum of the divisors of `n`.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_369sumdiv(PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_368sumdiv[] = "\n        Return the sum of the divisors of `n`.\n        \n        EXAMPLES::\n        \n            >>> pari(10).sumdiv()\n            18\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_369sumdiv(PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sumdiv (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_368sumdiv(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_368sumdiv(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("sumdiv", 0);

    /* "cypari_src/gen.pyx":5420
 *             18
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(sumdiv(n.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5421
 *         """
 *         sig_on()
 *         return P.new_gen(sumdiv(n.g))             # <<<<<<<<<<<<<<
 * 
 *     def sumdivk(gen n, long k):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, sumdiv(__pyx_v_n->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5411
 *         return P.new_gen(primepi(self.g))
 * 
 *     def sumdiv(gen n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the sum of the divisors of `n`.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.sumdiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5423
 *         return P.new_gen(sumdiv(n.g))
 * 
 *     def sumdivk(gen n, long k):             # <<<<<<<<<<<<<<
 *         """
 *         Return the sum of the k-th powers of the divisors of n.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_371sumdivk(PyObject *__pyx_v_n, PyObject *__pyx_arg_k); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_370sumdivk[] = "\n        Return the sum of the k-th powers of the divisors of n.\n        \n        EXAMPLES::\n        \n            >>> pari(10).sumdivk(2)\n            130\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_371sumdivk(PyObject *__pyx_v_n, PyObject *__pyx_arg_k) {
    long __pyx_v_k;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sumdivk (wrapper)", 0);
    assert(__pyx_arg_k); {
      __pyx_v_k = __Pyx_PyInt_As_long(__pyx_arg_k); if (unlikely((__pyx_v_k == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5423; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.sumdivk", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_370sumdivk(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_n), ((long)__pyx_v_k));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_370sumdivk(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_n, long __pyx_v_k) {
    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("sumdivk", 0);

    /* "cypari_src/gen.pyx":5432
 *             130
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(sumdivk(n.g, k))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5433
 *         """
 *         sig_on()
 *         return P.new_gen(sumdivk(n.g, k))             # <<<<<<<<<<<<<<
 * 
 *     def xgcd(gen x, y):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, sumdivk(__pyx_v_n->g, __pyx_v_k))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5423
 *         return P.new_gen(sumdiv(n.g))
 * 
 *     def sumdivk(gen n, long k):             # <<<<<<<<<<<<<<
 *         """
 *         Return the sum of the k-th powers of the divisors of n.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.sumdivk", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5435
 *         return P.new_gen(sumdivk(n.g, k))
 * 
 *     def xgcd(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Returns u,v,d such that d=gcd(x,y) and u\*x+v\*y=d.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_373xgcd(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_372xgcd[] = "\n        Returns u,v,d such that d=gcd(x,y) and u\\*x+v\\*y=d.\n        \n        EXAMPLES::\n        \n            >>> pari(10).xgcd(15)\n            (5, -1, 1)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_373xgcd(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("xgcd (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_372xgcd(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_372xgcd(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y) {
    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("xgcd", 0);

    /* "cypari_src/gen.pyx":5444
 *             (5, -1, 1)
 *         """
 *         return x.bezout(y)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_x), __pyx_n_s_bezout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_y);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_y);
      __Pyx_GIVEREF(__pyx_v_y);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5435
 *         return P.new_gen(sumdivk(n.g, k))
 * 
 *     def xgcd(gen x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Returns u,v,d such that d=gcd(x,y) and u\*x+v\*y=d.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.xgcd", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5451
 *     ##################################################
 * 
 *     def ellinit(self, int flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the PARI elliptic curve object with Weierstrass coefficients
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_375ellinit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_374ellinit[] = "\n        Return the PARI elliptic curve object with Weierstrass coefficients\n        given by self, a list with 5 elements.\n        \n        INPUT:\n        \n        \n        -  ``self`` - a list of 5 coefficients\n        \n        -  ``flag (optional, default: 0)`` - if 0, ask for a\n           PARI ell structure with 19 components; if 1, ask for a PARI sell\n           structure with only the first 13 components\n        \n        -  ``precision (optional, default: 0)`` - the real\n           precision to be used in the computation of the components of the\n           PARI (s)ell structure; if 0, use the default 53 bits.\n        \n           .. note::\n\n              the parameter precision in :meth:`.ellinit` controls not only\n              the real precision of the resulting (s)ell structure,\n              but also the precision of most subsequent computations\n              with this elliptic curve.  You should therefore set it\n              from the start to the value you require.\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - either a PARI ell structure with 19\n           components (if flag=0), or a PARI sell structure with 13 components\n           (if flag=1)\n        \n        \n        EXAMPLES: An elliptic curve with integer coefficients::\n        \n            >>> e = pari([0,1,0,1,0]).ellinit(); e  # Different answer for 32-bit\n            [0, 1, 0, 1, 0, 4, 2, 0, -1, -32, 224, -48, 2048/3, [0.E-38, -0.500000000000000 - 0.866025403784439*I, -0.500000000000000 + 0.866025403784439*I]~, 3.37150070962519, -1.68575035481260 - 2.15651564749964*I, 1.37451455785745 - 5.42101086242752 E-19*I, -0.687257278928726 + 0.984434956803824*I, 7.27069403586288]\n        \n        Its inexact components have the default precision of 53 bits::\n        \n            >>> e[14]\n            3.37150070962519\n        \n        We can compute this to higher precision::\n        \n            >>> old_prec = pari.set_real_precision""(45)\n            >>> e = pari([0,1,0,1,0]).ellinit(precision=150)\n            >>> e[14]\n            3.37150070962519208574240731559815397900160179\n            >>> pari.set_real_precision(old_prec)\n            45\n            \n        Using flag=1 returns a short elliptic curve PARI object::\n        \n            >>> pari([0,1,0,1,0]).ellinit(flag=1)\n            [0, 1, 0, 1, 0, 4, 2, 0, -1, -32, 224, -48, 2048/3]\n        \n        The coefficients can be any ring elements that convert to Pari::\n        \n            >>> pari('[0,1/2,0,-3/4,0]').ellinit(flag=1)\n            [0, 1/2, 0, -3/4, 0, 2, -3/2, 0, -9/16, 40, -116, 117/4, 256000/117]\n            >>> pari([0,0.5,0,-0.75,0]).ellinit(flag=1)\n            [0, 0.500000000000000, 0, -0.750000000000000, 0, 2.00000000000000, -1.50000000000000, 0, -0.562500000000000, 40.0000000000000, -116.000000000000, 29.2500000000000, 2188.03418803419]\n            >>> pari('[0,I,0,1,0]').ellinit(flag=1)\n            [0, I, 0, 1, 0, 4*I, 2, 0, -1, -64, 352*I, -80, 16384/5]\n            >>> pari('[0,x,0,2*x,1]').ellinit(flag=1)\n            [0, x, 0, 2*x, 1, 4*x, 4*x, 4, -4*x^2 + 4*x, 16*x^2 - 96*x, -64*x^3 + 576*x^2 - 864, 64*x^4 - 576*x^3 + 576*x^2 - 432, (256*x^6 - 4608*x^5 + 27648*x^4 - 55296*x^3)/(4*x^4 - 36*x^3 + 36*x^2 - 27)]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_375ellinit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    int __pyx_v_flag;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellinit (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellinit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5451; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5451; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((int)0);
      }
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellinit", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5451; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_374ellinit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_374ellinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, int __pyx_v_flag, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellinit", 0);

    /* "cypari_src/gen.pyx":5521
 *             [0, x, 0, 2*x, 1, 4*x, 4*x, 4, -4*x^2 + 4*x, 16*x^2 - 96*x, -64*x^3 + 576*x^2 - 864, 64*x^4 - 576*x^3 + 576*x^2 - 432, (256*x^6 - 4608*x^5 + 27648*x^4 - 55296*x^3)/(4*x^4 - 36*x^3 + 36*x^2 - 27)]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(ellinit0(self.g, flag, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5522
 *         """
 *         sig_on()
 *         return P.new_gen(ellinit0(self.g, flag, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def ellglobalred(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, ellinit0(__pyx_v_self->g, __pyx_v_flag, __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5451
 *     ##################################################
 * 
 *     def ellinit(self, int flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the PARI elliptic curve object with Weierstrass coefficients
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5524
 *         return P.new_gen(ellinit0(self.g, flag, pbw(precision)))
 * 
 *     def ellglobalred(self):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellglobalred(): return information related to the global minimal
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_377ellglobalred(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_376ellglobalred[] = "\n        e.ellglobalred(): return information related to the global minimal\n        model of the elliptic curve e.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve (returned by ellinit)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - the (arithmetic) conductor of e\n        \n        -  ``gen`` - a vector giving the coordinate change over\n           Q from e to its minimal integral model (see also ellminimalmodel)\n        \n        -  ``gen`` - the product of the local Tamagawa numbers\n           of e\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0, 5, 2, -1, 1]).ellinit()\n            >>> e.ellglobalred()\n            [20144, [1, -2, 0, -1], 1]\n            >>> e = pari([1, -1, 1, -1, -14]).ellinit()\n            >>> e.ellglobalred()\n            [17, [1, 0, 0, 0], 4]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_377ellglobalred(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellglobalred (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_376ellglobalred(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_376ellglobalred(struct __pyx_obj_10cypari_src_3gen_gen *__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("ellglobalred", 0);

    /* "cypari_src/gen.pyx":5556
 *             [17, [1, 0, 0, 0], 4]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(ellglobalred(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5557
 *         """
 *         sig_on()
 *         return self.new_gen(ellglobalred(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def elladd(self, z0, z1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ellglobalred(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5524
 *         return P.new_gen(ellinit0(self.g, flag, pbw(precision)))
 * 
 *     def ellglobalred(self):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellglobalred(): return information related to the global minimal
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellglobalred", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5559
 *         return self.new_gen(ellglobalred(self.g))
 * 
 *     def elladd(self, z0, z1):             # <<<<<<<<<<<<<<
 *         """
 *         e.elladd(z0, z1): return the sum of the points z0 and z1 on this
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_379elladd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_378elladd[] = "\n        e.elladd(z0, z1): return the sum of the points z0 and z1 on this\n        elliptic curve.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve E\n        \n        -  ``z0`` - point on E\n        \n        -  ``z1`` - point on E\n        \n        \n        OUTPUT: point on E\n        \n        EXAMPLES: First we create an elliptic curve::\n        \n            >>> e = pari([0, 1, 1, -2, 0]).ellinit()\n            >>> str(e)[:65]   # first part of output\n            '[0, 1, 1, -2, 0, 4, -4, 1, -3, 112, -856, 389, 1404928/389, [0.90'\n        \n        Next we add two points on the elliptic curve. Notice that the\n        Python lists are automatically converted to PARI objects so you\n        don't have to do that explicitly in your code.\n        \n        ::\n        \n            >>> e.elladd([1,0], [-1,1])\n            [-3/4, -15/8]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_379elladd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_z0 = 0;
    PyObject *__pyx_v_z1 = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("elladd (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_z0,&__pyx_n_s_z1,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_z0)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z1)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("elladd", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5559; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "elladd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5559; __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_z0 = values[0];
      __pyx_v_z1 = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("elladd", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5559; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.elladd", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_378elladd(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_z0, __pyx_v_z1);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_378elladd(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z0, PyObject *__pyx_v_z1) {
    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("elladd", 0);

    /* "cypari_src/gen.pyx":5591
 *             [-3/4, -15/8]
 *         """
 *         t0GEN(z0); t1GEN(z1)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(addell(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_z1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5592
 *         """
 *         t0GEN(z0); t1GEN(z1)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(addell(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5593
 *         t0GEN(z0); t1GEN(z1)
 *         sig_on()
 *         return self.new_gen(addell(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def ellak(self, n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, addell(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5559
 *         return self.new_gen(ellglobalred(self.g))
 * 
 *     def elladd(self, z0, z1):             # <<<<<<<<<<<<<<
 *         """
 *         e.elladd(z0, z1): return the sum of the points z0 and z1 on this
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.elladd", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5595
 *         return self.new_gen(addell(self.g, t0, t1))
 * 
 *     def ellak(self, n):             # <<<<<<<<<<<<<<
 *         r"""
 *         e.ellak(n): Returns the coefficient `a_n` of the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_381ellak(PyObject *__pyx_v_self, PyObject *__pyx_v_n); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_380ellak[] = "\n        e.ellak(n): Returns the coefficient `a_n` of the\n        `L`-function of the elliptic curve e, i.e. the\n        `n`-th Fourier coefficient of the weight 2 newform\n        associated to e (according to Shimura-Taniyama).\n        \n            The curve `e` *must* be a medium or long vector of the type\n            given by ellinit. For this function to work for every n and not\n            just those prime to the conductor, e must be a minimal Weierstrass\n            equation. If this is not the case, use the function ellminimalmodel\n            first before using ellak (or you will get INCORRECT RESULTS!)\n        \n        \n        INPUT:\n        \n        \n        -  ``e`` - a PARI elliptic curve.\n        \n        -  ``n`` - integer.\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.ellak(6)\n            2\n            >>> e.ellak(2005)        \n            2\n            >>> e.ellak(-1)\n            0\n            >>> e.ellak(0)\n            0\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_381ellak(PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellak (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_380ellak(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_380ellak(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellak", 0);

    /* "cypari_src/gen.pyx":5629
 *             0
 *         """
 *         t0GEN(n)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(akell(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5630
 *         """
 *         t0GEN(n)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(akell(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5631
 *         t0GEN(n)
 *         sig_on()
 *         return self.new_gen(akell(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, akell(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5595
 *         return self.new_gen(addell(self.g, t0, t1))
 * 
 *     def ellak(self, n):             # <<<<<<<<<<<<<<
 *         r"""
 *         e.ellak(n): Returns the coefficient `a_n` of the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellak", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5634
 * 
 * 
 *     def ellan(self, long n, python_ints=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the first `n` Fourier coefficients of the modular
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_383ellan(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_382ellan[] = "\n        Return the first `n` Fourier coefficients of the modular\n        form attached to this elliptic curve. See ellak for more details.\n        \n        INPUT:\n        \n        \n        -  ``n`` - a long integer\n        \n        -  ``python_ints`` - bool (default is False); if True,\n           return a list of Python ints instead of a PARI gen wrapper.\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.ellan(3)\n            [1, -2, -1]\n            >>> e.ellan(20)\n            [1, -2, -1, 2, 1, 2, -2, 0, -2, -2, 1, -2, 4, 4, -1, -4, -2, 4, 0, 2]\n            >>> e.ellan(-1)\n            []\n            >>> v = e.ellan(10, python_ints=True); v\n            [1, -2, -1, 2, 1, 2, -2, 0, -2, -2]\n            >>> isinstance(v, list)\n            True\n            >>> isinstance(v[0], int)\n            True\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_383ellan(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    PyObject *__pyx_v_python_ints = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellan (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_python_ints,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)Py_False);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_n)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_python_ints);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellan") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5634; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_python_ints = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellan", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5634; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellan", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_382ellan(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_n, __pyx_v_python_ints);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_382ellan(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_python_ints) {
    GEN __pyx_v_g;
    PyObject *__pyx_v_v = NULL;
    PyObject *__pyx_v_i = 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;
    Py_ssize_t __pyx_t_5;
    PyObject *(*__pyx_t_6)(PyObject *);
    Py_ssize_t __pyx_t_7;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellan", 0);

    /* "cypari_src/gen.pyx":5664
 *             True
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         cdef GEN g
 *         if python_ints:
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5666
 *         sig_on()
 *         cdef GEN g
 *         if python_ints:             # <<<<<<<<<<<<<<
 *             g = anell(self.g, n)
 *             v = [gtolong(<GEN> g[i+1]) for i in range(glength(g))]
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_python_ints); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":5667
 *         cdef GEN g
 *         if python_ints:
 *             g = anell(self.g, n)             # <<<<<<<<<<<<<<
 *             v = [gtolong(<GEN> g[i+1]) for i in range(glength(g))]
 *             (<PariInstance>pari).clear_stack()
 */
      __pyx_v_g = anell(__pyx_v_self->g, __pyx_v_n);

      /* "cypari_src/gen.pyx":5668
 *         if python_ints:
 *             g = anell(self.g, n)
 *             v = [gtolong(<GEN> g[i+1]) for i in range(glength(g))]             # <<<<<<<<<<<<<<
 *             (<PariInstance>pari).clear_stack()
 *             return v
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyInt_From_long(glength(__pyx_v_g)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __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 = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_6(__pyx_t_4);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Add(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyInt_From_long(gtolong(((GEN)(__pyx_v_g[__pyx_t_7])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_v = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cypari_src/gen.pyx":5669
 *             g = anell(self.g, n)
 *             v = [gtolong(<GEN> g[i+1]) for i in range(glength(g))]
 *             (<PariInstance>pari).clear_stack()             # <<<<<<<<<<<<<<
 *             return v
 *         else:
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_t_2)->__pyx_vtab)->clear_stack(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_t_2));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cypari_src/gen.pyx":5670
 *             v = [gtolong(<GEN> g[i+1]) for i in range(glength(g))]
 *             (<PariInstance>pari).clear_stack()
 *             return v             # <<<<<<<<<<<<<<
 *         else:
 *             return self.new_gen(anell(self.g, n))
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_v);
      __pyx_r = __pyx_v_v;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":5672
 *             return v
 *         else:
 *             return self.new_gen(anell(self.g, n))             # <<<<<<<<<<<<<<
 * 
 *     def ellanalyticrank(self, long precision = 0):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, anell(__pyx_v_self->g, __pyx_v_n))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":5634
 * 
 * 
 *     def ellan(self, long n, python_ints=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return the first `n` Fourier coefficients of the modular
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellan", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_v);
    __Pyx_XDECREF(__pyx_v_i);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5674
 *             return self.new_gen(anell(self.g, n))
 * 
 *     def ellanalyticrank(self, long precision = 0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Returns a 2-component vector with the order of vanishing at
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_385ellanalyticrank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_384ellanalyticrank[] = "\n        Returns a 2-component vector with the order of vanishing at\n        `s = 1` of the L-function of the elliptic curve and the value\n        of the first non-zero derivative.\n        \n        EXAMPLE::\n            \n            >>> E = pari([0, 0, 1, -7, 6]).ellinit()\n            >>> E.ellanalyticrank()\n            [3, 10.3910994007158]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_385ellanalyticrank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_precision;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellanalyticrank (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellanalyticrank") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5674; __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;
        }
      }
      if (values[0]) {
        __pyx_v_precision = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_precision == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_precision = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellanalyticrank", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellanalyticrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_384ellanalyticrank(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_384ellanalyticrank(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_precision) {
    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;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellanalyticrank", 0);

    /* "cypari_src/gen.pyx":5686
 *             [3, 10.3910994007158]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(ellanalyticrank(self.g, <GEN>0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5687
 *         """
 *         sig_on()
 *         return self.new_gen(ellanalyticrank(self.g, <GEN>0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def ellap(self, p):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_precision); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ellanalyticrank(__pyx_v_self->g, ((GEN)0), __pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5674
 *             return self.new_gen(anell(self.g, n))
 * 
 *     def ellanalyticrank(self, long precision = 0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Returns a 2-component vector with the order of vanishing at
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellanalyticrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5689
 *         return self.new_gen(ellanalyticrank(self.g, <GEN>0, pbw(precision)))
 * 
 *     def ellap(self, p):             # <<<<<<<<<<<<<<
 *         r"""
 *         e.ellap(p): Returns the prime-indexed coefficient `a_p` of the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_387ellap(PyObject *__pyx_v_self, PyObject *__pyx_v_p); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_386ellap[] = "\n        e.ellap(p): Returns the prime-indexed coefficient `a_p` of the\n        `L`-function of the elliptic curve `e`, i.e. the `p`-th Fourier\n        coefficient of the newform attached to e.\n        \n        The computation uses the Shanks--Mestre method, or the SEA\n        algorithm.\n        \n        .. WARNING::\n            \n            For this function to work for every n and not just those prime\n            to the conductor, e must be a minimal Weierstrass equation.\n            If this is not the case, use the function ellminimalmodel first\n            before using ellap (or you will get INCORRECT RESULTS!)\n        \n        \n        INPUT:\n        \n        \n        -  ``e`` - a PARI elliptic curve.\n        \n        -  ``p`` - prime integer\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.ellap(2)\n            -2\n            >>> e.ellap(2003)\n            4\n            >>> e.ellak(-1)\n            0\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_387ellap(PyObject *__pyx_v_self, PyObject *__pyx_v_p) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellap (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_386ellap(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_p));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_386ellap(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p) {
    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("ellap", 0);

    /* "cypari_src/gen.pyx":5724
 *             0
 *         """
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(ellap(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5725
 *         """
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(ellap(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5726
 *         t0GEN(p)
 *         sig_on()
 *         return self.new_gen(ellap(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ellap(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5689
 *         return self.new_gen(ellanalyticrank(self.g, <GEN>0, pbw(precision)))
 * 
 *     def ellap(self, p):             # <<<<<<<<<<<<<<
 *         r"""
 *         e.ellap(p): Returns the prime-indexed coefficient `a_p` of the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellap", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5729
 * 
 * 
 *     def ellaplist(self, long n, python_ints=False):             # <<<<<<<<<<<<<<
 *         r"""
 *         e.ellaplist(n): Returns a PARI list of all the prime-indexed
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_389ellaplist(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_388ellaplist[] = "\n        e.ellaplist(n): Returns a PARI list of all the prime-indexed\n        coefficients `a_p` (up to n) of the `L`-function\n        of the elliptic curve `e`, i.e. the Fourier coefficients of\n        the newform attached to `e`.\n        \n        INPUT:\n        \n        \n        -  ``n`` - a long integer\n        \n        -  ``python_ints`` - bool (default is False); if True,\n           return a list of Python ints instead of a PARI gen wrapper.\n        \n        \n            The curve e must be a medium or long vector of the type given by\n            ellinit. For this function to work for every n and not just those\n            prime to the conductor, e must be a minimal Weierstrass equation.\n            If this is not the case, use the function ellminimalmodel first\n            before using ellaplist (or you will get INCORRECT RESULTS!)\n        \n        \n        INPUT:\n        \n        \n        -  ``e`` - a PARI elliptic curve.\n        \n        -  ``n`` - an integer\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> v = e.ellaplist(10); v\n            [-2, -1, 1, -2]\n            >>> isinstance(v, gen)\n            True\n            >>> v.type()\n            't_VEC'\n            >>> e.ellan(10)\n            [1, -2, -1, 2, 1, 2, -2, 0, -2, -2]\n            >>> v = e.ellaplist(10, python_ints=True); v\n            [-2, -1, 1, -2]\n            >>> isinstance(v, list)\n            True\n            >>> isinstance(v[0], int)\n            True\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_389ellaplist(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    PyObject *__pyx_v_python_ints = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellaplist (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_python_ints,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)Py_False);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_n)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_python_ints);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellaplist") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5729; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_python_ints = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellaplist", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellaplist", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_388ellaplist(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_n, __pyx_v_python_ints);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_388ellaplist(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_python_ints) {
    GEN __pyx_v_g;
    long __pyx_v_i;
    PyObject *__pyx_v_v = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    long __pyx_t_7;
    long __pyx_t_8;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellaplist", 0);

    /* "cypari_src/gen.pyx":5779
 *         """
 *         # 1. make a table of primes up to n.
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if n < 2:
 *             return self.new_gen(zerovec(0))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5780
 *         # 1. make a table of primes up to n.
 *         sig_on()
 *         if n < 2:             # <<<<<<<<<<<<<<
 *             return self.new_gen(zerovec(0))
 *         cdef GEN g
 */
    __pyx_t_1 = ((__pyx_v_n < 2) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":5781
 *         sig_on()
 *         if n < 2:
 *             return self.new_gen(zerovec(0))             # <<<<<<<<<<<<<<
 *         cdef GEN g
 *         pari.init_primes(n+1)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, zerovec(0))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":5783
 *             return self.new_gen(zerovec(0))
 *         cdef GEN g
 *         pari.init_primes(n+1)             # <<<<<<<<<<<<<<
 *         t0GEN(n)
 *         g = primes(gtolong(primepi(t0)))
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init_primes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_n + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5783; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":5784
 *         cdef GEN g
 *         pari.init_primes(n+1)
 *         t0GEN(n)             # <<<<<<<<<<<<<<
 *         g = primes(gtolong(primepi(t0)))
 * 
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5784; __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;

    /* "cypari_src/gen.pyx":5785
 *         pari.init_primes(n+1)
 *         t0GEN(n)
 *         g = primes(gtolong(primepi(t0)))             # <<<<<<<<<<<<<<
 * 
 *         # 2. Replace each prime in the table by ellap of it.
 */
    __pyx_v_g = primes(gtolong(primepi(__pyx_v_10cypari_src_3gen_t0)));

    /* "cypari_src/gen.pyx":5790
 *         cdef long i
 * 
 *         if python_ints:             # <<<<<<<<<<<<<<
 *             v = [gtolong(ellap(self.g, <GEN> g[i+1])) \
 *                         for i in range(glength(g))]
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_python_ints); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":5791
 * 
 *         if python_ints:
 *             v = [gtolong(ellap(self.g, <GEN> g[i+1])) \             # <<<<<<<<<<<<<<
 *                         for i in range(glength(g))]
 *             (<PariInstance>pari).clear_stack()
 */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "cypari_src/gen.pyx":5792
 *         if python_ints:
 *             v = [gtolong(ellap(self.g, <GEN> g[i+1])) \
 *                         for i in range(glength(g))]             # <<<<<<<<<<<<<<
 *             (<PariInstance>pari).clear_stack()
 *             return v
 */
      __pyx_t_7 = glength(__pyx_v_g);
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;

        /* "cypari_src/gen.pyx":5791
 * 
 *         if python_ints:
 *             v = [gtolong(ellap(self.g, <GEN> g[i+1])) \             # <<<<<<<<<<<<<<
 *                         for i in range(glength(g))]
 *             (<PariInstance>pari).clear_stack()
 */
        __pyx_t_2 = __Pyx_PyInt_From_long(gtolong(ellap(__pyx_v_self->g, ((GEN)(__pyx_v_g[(__pyx_v_i + 1)]))))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_v_v = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cypari_src/gen.pyx":5793
 *             v = [gtolong(ellap(self.g, <GEN> g[i+1])) \
 *                         for i in range(glength(g))]
 *             (<PariInstance>pari).clear_stack()             # <<<<<<<<<<<<<<
 *             return v
 *         else:
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_t_4)->__pyx_vtab)->clear_stack(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_t_4));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cypari_src/gen.pyx":5794
 *                         for i in range(glength(g))]
 *             (<PariInstance>pari).clear_stack()
 *             return v             # <<<<<<<<<<<<<<
 *         else:
 *             for i from 0 <= i < glength(g):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_v);
      __pyx_r = __pyx_v_v;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":5796
 *             return v
 *         else:
 *             for i from 0 <= i < glength(g):             # <<<<<<<<<<<<<<
 *                 g[i+1] = <long> ellap(self.g, <GEN> g[i+1])
 *             return self.new_gen(g)
 */
      __pyx_t_7 = glength(__pyx_v_g);
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

        /* "cypari_src/gen.pyx":5797
 *         else:
 *             for i from 0 <= i < glength(g):
 *                 g[i+1] = <long> ellap(self.g, <GEN> g[i+1])             # <<<<<<<<<<<<<<
 *             return self.new_gen(g)
 * 
 */
        (__pyx_v_g[(__pyx_v_i + 1)]) = ((long)ellap(__pyx_v_self->g, ((GEN)(__pyx_v_g[(__pyx_v_i + 1)]))));
      }

      /* "cypari_src/gen.pyx":5798
 *             for i from 0 <= i < glength(g):
 *                 g[i+1] = <long> ellap(self.g, <GEN> g[i+1])
 *             return self.new_gen(g)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, __pyx_v_g)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":5729
 * 
 * 
 *     def ellaplist(self, long n, python_ints=False):             # <<<<<<<<<<<<<<
 *         r"""
 *         e.ellaplist(n): Returns a PARI list of all the prime-indexed
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellaplist", __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;
  }

  /* "cypari_src/gen.pyx":5801
 * 
 * 
 *     def ellbil(self, z0, z1):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellbil(z0, z1): return the value of the canonical bilinear form
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_391ellbil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_390ellbil[] = "\n        e.ellbil(z0, z1): return the value of the canonical bilinear form\n        on z0 and z1.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve (assumed integral given by a\n           minimal model, as returned by ellminimalmodel)\n        \n        -  ``z0, z1`` - rational points on e\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit().ellminimalmodel()[0]\n            >>> e.ellbil([1, 0], [-1, 1])\n            0.418188984498861\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_391ellbil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_z0 = 0;
    PyObject *__pyx_v_z1 = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellbil (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_z0,&__pyx_n_s_z1,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_z0)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z1)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("ellbil", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5801; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellbil") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5801; __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_z0 = values[0];
      __pyx_v_z1 = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellbil", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5801; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellbil", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_390ellbil(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_z0, __pyx_v_z1);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_390ellbil(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z0, PyObject *__pyx_v_z1) {
    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("ellbil", 0);

    /* "cypari_src/gen.pyx":5821
 *             0.418188984498861
 *         """
 *         t0GEN(z0); t1GEN(z1)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         # the prec argument has no effect
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_z1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5822
 *         """
 *         t0GEN(z0); t1GEN(z1)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the prec argument has no effect
 *         return self.new_gen(bilhell(self.g, t0, t1, prec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5824
 *         sig_on()
 *         # the prec argument has no effect
 *         return self.new_gen(bilhell(self.g, t0, t1, prec))             # <<<<<<<<<<<<<<
 * 
 *     def ellchangecurve(self, ch):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bilhell(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5801
 * 
 * 
 *     def ellbil(self, z0, z1):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellbil(z0, z1): return the value of the canonical bilinear form
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellbil", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5826
 *         return self.new_gen(bilhell(self.g, t0, t1, prec))
 * 
 *     def ellchangecurve(self, ch):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellchangecurve(ch): return the new model (equation) for the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_393ellchangecurve(PyObject *__pyx_v_self, PyObject *__pyx_v_ch); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_392ellchangecurve[] = "\n        e.ellchangecurve(ch): return the new model (equation) for the\n        elliptic curve e given by the change of coordinates ch.\n        \n        The change of coordinates is specified by a vector ch=[u,r,s,t]; if\n        `x'` and `y'` are the new coordinates, then\n        `x = u^2 x' + r` and `y = u^3 y' + su^2 x' + t`.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve\n        \n        -  ``ch`` - change of coordinates vector with 4\n           entries\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([1,2,3,4,5]).ellinit()\n            >>> e.ellglobalred()\n            [10351, [1, -1, 0, -1], 1]\n            >>> f = e.ellchangecurve([1,-1,0,-1])\n            >>> f[:5]\n            [1, -1, 0, 4, 3]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_393ellchangecurve(PyObject *__pyx_v_self, PyObject *__pyx_v_ch) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellchangecurve (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_392ellchangecurve(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_ch));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_392ellchangecurve(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_ch) {
    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("ellchangecurve", 0);

    /* "cypari_src/gen.pyx":5853
 *             [1, -1, 0, 4, 3]
 *         """
 *         t0GEN(ch)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(ellchangecurve(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_ch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5854
 *         """
 *         t0GEN(ch)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(ellchangecurve(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5855
 *         t0GEN(ch)
 *         sig_on()
 *         return self.new_gen(ellchangecurve(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def elleta(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ellchangecurve(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5826
 *         return self.new_gen(bilhell(self.g, t0, t1, prec))
 * 
 *     def ellchangecurve(self, ch):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellchangecurve(ch): return the new model (equation) for the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellchangecurve", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5857
 *         return self.new_gen(ellchangecurve(self.g, t0))
 * 
 *     def elleta(self):             # <<<<<<<<<<<<<<
 *         """
 *         e.elleta(): return the vector [eta1,eta2] of quasi-periods
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_395elleta(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_394elleta[] = "\n        e.elleta(): return the vector [eta1,eta2] of quasi-periods\n        associated with the period lattice e.omega() of the elliptic curve\n        e.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,0,0,-82,0]).ellinit()\n            >>> e.elleta()\n            [3.60546360143265, 3.60546360143265*I]\n            >>> w1,w2 = e.omega()\n            >>> eta1, eta2 = e.elleta()\n            >>> w1*eta2-w2*eta1\n            6.28318530717959*I\n            >>> w1*eta2-w2*eta1 == 2*pari.pi()*pari('I')\n            True\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_395elleta(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("elleta (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_394elleta(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_394elleta(struct __pyx_obj_10cypari_src_3gen_gen *__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("elleta", 0);

    /* "cypari_src/gen.pyx":5875
 *             True
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the prec argument has no effect
 *         return self.new_gen(elleta(self.g, prec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5877
 *         sig_on()
 *         # the prec argument has no effect
 *         return self.new_gen(elleta(self.g, prec))             # <<<<<<<<<<<<<<
 * 
 *     def ellheight(self, a, flag=2, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, elleta(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5857
 *         return self.new_gen(ellchangecurve(self.g, t0))
 * 
 *     def elleta(self):             # <<<<<<<<<<<<<<
 *         """
 *         e.elleta(): return the vector [eta1,eta2] of quasi-periods
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.elleta", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5879
 *         return self.new_gen(elleta(self.g, prec))
 * 
 *     def ellheight(self, a, flag=2, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellheight(a, flag=2): return the global Neron-Tate height of the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_397ellheight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_396ellheight[] = "\n        e.ellheight(a, flag=2): return the global Neron-Tate height of the\n        point a on the elliptic curve e.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve over `\\QQ`,\n           assumed to be in a standard minimal integral model (as given by\n           ellminimalmodel)\n        \n        -  ``a`` - rational point on e\n        \n        -  ``flag (optional)`` - specifies which algorithm to\n           be used for computing the archimedean local height:\n        \n           -  ``0`` - uses sigma- and theta-functions and a trick\n               due to J. Silverman\n\n           -  ``1`` - uses Tate's `4^n` algorithm\n\n           -  ``2`` - uses Mestre's AGM algorithm (this is the\n              default, being faster than the other two)\n        \n        -  ``precision (optional)`` - the precision of the\n           result, in bits.\n        \n        \n        Note that in order to achieve the desired precision, the\n        elliptic curve must have been created using ellinit with the\n        desired precision.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit().ellminimalmodel()[0]\n            >>> e.ellheight([1,0])\n            0.476711659343740\n            >>> e.ellheight([1,0], flag=0)\n            0.476711659343740\n            >>> e.ellheight([1,0], flag=1)\n            0.476711659343740\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_397ellheight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_a = 0;
    PyObject *__pyx_v_flag = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellheight (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_flag,&__pyx_n_s_precision,0};
      PyObject* values[3] = {0,0,0};
      values[1] = ((PyObject *)__pyx_int_2);
      values[2] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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_a)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellheight") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5879; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_a = values[0];
      __pyx_v_flag = values[1];
      __pyx_v_precision = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellheight", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellheight", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_396ellheight(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_a, __pyx_v_flag, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_396ellheight(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_flag, PyObject *__pyx_v_precision) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    long __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellheight", 0);

    /* "cypari_src/gen.pyx":5922
 *             0.476711659343740
 *         """
 *         t0GEN(a)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(ellheight0(self.g, t0, flag, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5923
 *         """
 *         t0GEN(a)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(ellheight0(self.g, t0, flag, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5924
 *         t0GEN(a)
 *         sig_on()
 *         return self.new_gen(ellheight0(self.g, t0, flag, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def ellheightmatrix(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ellheight0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_2, __pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5879
 *         return self.new_gen(elleta(self.g, prec))
 * 
 *     def ellheight(self, a, flag=2, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellheight(a, flag=2): return the global Neron-Tate height of the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellheight", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5926
 *         return self.new_gen(ellheight0(self.g, t0, flag, pbw(precision)))
 * 
 *     def ellheightmatrix(self, x):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellheightmatrix(x): return the height matrix for the vector x of
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_399ellheightmatrix(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_398ellheightmatrix[] = "\n        e.ellheightmatrix(x): return the height matrix for the vector x of\n        points on the elliptic curve e.\n        \n        In other words, it returns the Gram matrix of x with respect to the\n        height bilinear form on e (see ellbil).\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve over `\\QQ`,\n           assumed to be in a standard minimal integral model (as given by\n           ellminimalmodel)\n        \n        -  ``x`` - vector of rational points on e\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit().ellminimalmodel()[0]\n            >>> e.ellheightmatrix([[1,0], [-1,1]])\n            [0.476711659343740, 0.418188984498861; 0.418188984498861, 0.686667083305587]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_399ellheightmatrix(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellheightmatrix (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_398ellheightmatrix(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_398ellheightmatrix(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellheightmatrix", 0);

    /* "cypari_src/gen.pyx":5950
 *             [0.476711659343740, 0.418188984498861; 0.418188984498861, 0.686667083305587]
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         # the argument prec has no effect
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5951
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the argument prec has no effect
 *         return self.new_gen(mathell(self.g, t0, prec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5953
 *         sig_on()
 *         # the argument prec has no effect
 *         return self.new_gen(mathell(self.g, t0, prec))             # <<<<<<<<<<<<<<
 * 
 *     def ellisoncurve(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, mathell(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5926
 *         return self.new_gen(ellheight0(self.g, t0, flag, pbw(precision)))
 * 
 *     def ellheightmatrix(self, x):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellheightmatrix(x): return the height matrix for the vector x of
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellheightmatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5955
 *         return self.new_gen(mathell(self.g, t0, prec))
 * 
 *     def ellisoncurve(self, x):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellisoncurve(x): return True if the point x is on the elliptic
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_401ellisoncurve(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_400ellisoncurve[] = "\n        e.ellisoncurve(x): return True if the point x is on the elliptic\n        curve e, False otherwise.\n        \n        If the point or the curve have inexact coefficients, an attempt is\n        made to take this into account.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit()\n            >>> e.ellisoncurve([1,0])\n            True\n            >>> e.ellisoncurve([1,1])\n            False\n            >>> e.ellisoncurve([1,0.00000000000000001])\n            False\n            >>> e.ellisoncurve([1,0.000000000000000001])\n            True\n            >>> e.ellisoncurve([0])\n            True\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_401ellisoncurve(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellisoncurve (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_400ellisoncurve(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_400ellisoncurve(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_v_t = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellisoncurve", 0);

    /* "cypari_src/gen.pyx":5977
 *             True
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         t = bool(oncurve(self.g, t0) == 1)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5978
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         t = bool(oncurve(self.g, t0) == 1)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":5979
 *         t0GEN(x)
 *         sig_on()
 *         t = bool(oncurve(self.g, t0) == 1)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return t
 */
    __pyx_t_2 = (oncurve(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0) == 1);
    __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_t = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":5980
 *         sig_on()
 *         t = bool(oncurve(self.g, t0) == 1)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return t
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":5981
 *         t = bool(oncurve(self.g, t0) == 1)
 *         sig_off()
 *         return t             # <<<<<<<<<<<<<<
 * 
 *     def elllocalred(self, p):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_t);
    __pyx_r = __pyx_v_t;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5955
 *         return self.new_gen(mathell(self.g, t0, prec))
 * 
 *     def ellisoncurve(self, x):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellisoncurve(x): return True if the point x is on the elliptic
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellisoncurve", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_t);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":5983
 *         return t
 * 
 *     def elllocalred(self, p):             # <<<<<<<<<<<<<<
 *         r"""
 *         e.elllocalred(p): computes the data of local reduction at the prime
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_403elllocalred(PyObject *__pyx_v_self, PyObject *__pyx_v_p); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_402elllocalred[] = "\n        e.elllocalred(p): computes the data of local reduction at the prime\n        p on the elliptic curve e\n        \n        For more details on local reduction and Kodaira types, see IV.8 and\n        IV.9 in J. Silverman's book \"Advanced topics in the arithmetic of\n        elliptic curves\".\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve with coefficients in `\\ZZ`\n        \n        -  ``p`` - prime number\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - the exponent of p in the arithmetic\n           conductor of e\n        \n        -  ``gen`` - the Kodaira type of e at p, encoded as an\n           integer:\n        \n        -  ``1`` - type `I_0`: good reduction,\n           nonsingular curve of genus 1\n        \n        -  ``2`` - type `II`: rational curve with a\n           cusp\n        \n        -  ``3`` - type `III`: two nonsingular rational\n           curves intersecting tangentially at one point\n        \n        -  ``4`` - type `IV`: three nonsingular\n           rational curves intersecting at one point\n        \n        -  ``5`` - type `I_1`: rational curve with a\n           node\n        \n        -  ``6 or larger`` - think of it as `4+v`, then\n           it is type `I_v`: `v` nonsingular rational curves\n           arranged as a `v`-gon\n        \n        -  ``-1`` - type `I_0^*`: nonsingular rational\n           curve of multiplicity two with four nonsingular rational curves of\n           multiplicity one attached\n        \n        -  ``-2`` - type `II^*`: nine nonsingular\n           rational curves in a special configuration\n        \n        -  ``-3`` - type `III^*`: eight nonsingular\n           rational curves in a special configuration\n        \n        -  ``-4`` - type `IV^*`: seven nonsingular\n           rational curves in a special configuration\n        \n        -  ``-5 or smaller`` - think of it as `-4-v`,\n           then it is type `I_v^*`: chain of `""v+1`\n           nonsingular rational curves of multiplicity two, with two\n           nonsingular rational curves of multiplicity one attached at either\n           end\n        \n        -  ``gen`` - a vector with 4 components, giving the\n           coordinate changes done during the local reduction; if the first\n           component is 1, then the equation for e was already minimal at p\n        \n        -  ``gen`` - the local Tamagawa number `c_p`\n        \n        \n        EXAMPLES:\n        \n        Type `I_0`::\n        \n            >>> e = pari([0,0,0,0,1]).ellinit()\n            >>> e.elllocalred(7)\n            [0, 1, [1, 0, 0, 0], 1]\n        \n        Type `II`::\n        \n            >>> e = pari([0, 0, 1, 0, 0]).ellinit()\n            >>> e.elllocalred(3)\n            [3, 2, [1, -1, 0, 1], 1]\n        \n        Type `III`::\n        \n            >>> e = pari([0, -1, 0, 1, 0]).ellinit()\n            >>> e.elllocalred(2)\n            [3, 3, [1, 1, 0, 1], 2]\n        \n        Type `IV`::\n        \n            >>> e = pari([0, 1, 0, -1, 0]).ellinit()\n            >>> e.elllocalred(2)\n            [2, 4, [1, 1, 0, 1], 3]\n        \n        Type `I_1`::\n        \n            >>> e = pari([0, -1, 1, -7820, -263580]).ellinit()\n            >>> e.elllocalred(11)\n            [1, 5, [1, 0, 0, 0], 1]\n        \n        Type `I_2`::\n        \n            >>> e = pari([1, 0, 1, -1, 0]).ellinit()\n            >>> e.elllocalred(2)\n            [1, 6, [1, 0, 0, 0], 2]\n        \n        Type `I_6`::\n        \n            >>> e = pari([1, 0, 1, 4, -6]).ellinit()\n            >>> e.elllocalred(2)\n            [1, 10, [1, 0, 0, 0], 2]\n        \n        Type `I_0^*`::\n        \n            >>> e = pari([0, 0, 0, -11, -14]).ellinit()\n            >>> e.elllocalred(2)\n            [5, -1, [1, 1, 1, 0], 1]\n        \n        Type `II^*`::\n        \n            >>> e = pari([0, -1, 0, -384, -2772]).ellinit()\n            >>> e.elllocalred(2)\n            [3, ""-2, [1, 2, 1, 4], 1]\n        \n        Type `III^*`::\n        \n            >>> e = pari([0, -1, 0, -24, -36]).ellinit()\n            >>> e.elllocalred(2)\n            [3, -3, [1, 2, 1, 4], 2]\n        \n        Type `IV^*`::\n        \n            >>> e = pari([0, 1, 0, 4, 4]).ellinit()\n            >>> e.elllocalred(2)\n            [2, -4, [1, 0, 1, 2], 3]\n        \n        Type `I_1^*`::\n        \n            >>> e = pari([0, -1, 0, -4, 4]).ellinit()\n            >>> e.elllocalred(2)\n            [3, -5, [1, 0, 1, 2], 4]\n        \n        Type `I_6^*`::\n        \n            >>> e = pari([1, -1, 1, -167, -709]).ellinit()\n            >>> e.elllocalred(3)\n            [2, -10, [1, 96, 1, 316], 4]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_403elllocalred(PyObject *__pyx_v_self, PyObject *__pyx_v_p) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("elllocalred (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_402elllocalred(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_p));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_402elllocalred(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p) {
    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("elllocalred", 0);

    /* "cypari_src/gen.pyx":6134
 *             [2, -10, [1, 96, 1, 316], 4]
 *         """
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(elllocalred(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6135
 *         """
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(elllocalred(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6136
 *         t0GEN(p)
 *         sig_on()
 *         return self.new_gen(elllocalred(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def elllseries(self, s, A=1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, elllocalred(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":5983
 *         return t
 * 
 *     def elllocalred(self, p):             # <<<<<<<<<<<<<<
 *         r"""
 *         e.elllocalred(p): computes the data of local reduction at the prime
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.elllocalred", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6138
 *         return self.new_gen(elllocalred(self.g, t0))
 * 
 *     def elllseries(self, s, A=1):             # <<<<<<<<<<<<<<
 *         """
 *         e.elllseries(s, A=1): return the value of the `L`-series of
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_405elllseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_404elllseries[] = "\n        e.elllseries(s, A=1): return the value of the `L`-series of\n        the elliptic curve e at the complex number s.\n        \n        This uses an `O(N^{1/2})` algorithm in the conductor N of\n        e, so it is impractical for large conductors (say greater than\n        `10^{12}`).\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve defined over `\\QQ`\n        \n        -  ``s`` - complex number\n        \n        -  ``A (optional)`` - cutoff point for the integral,\n           which must be chosen close to 1 for best speed.\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit()\n            >>> e.elllseries(2.1)\n            0.402838047956646\n            >>> e.elllseries(1)   # random, close to 0\n            -5.24750372566629 E-19\n            >>> e.elllseries(-2)\n            0\n        \n        The following example differs for the last digit on 32 vs. 64 bit\n        systems\n        \n        ::\n        \n            >>> e.elllseries(2.1, A=1.1)\n            0.402838047956646\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_405elllseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_s = 0;
    PyObject *__pyx_v_A = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("elllseries (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_A,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_s)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_A);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "elllseries") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6138; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_s = values[0];
      __pyx_v_A = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("elllseries", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6138; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.elllseries", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_404elllseries(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_s, __pyx_v_A);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_404elllseries(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_s, PyObject *__pyx_v_A) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("elllseries", 0);

    /* "cypari_src/gen.pyx":6176
 *             0.402838047956646
 *         """
 *         t0GEN(s); t1GEN(A)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         # the argument prec has no effect
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_A); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6177
 *         """
 *         t0GEN(s); t1GEN(A)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the argument prec has no effect
 *         return self.new_gen(elllseries(self.g, t0, t1, prec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6179
 *         sig_on()
 *         # the argument prec has no effect
 *         return self.new_gen(elllseries(self.g, t0, t1, prec))             # <<<<<<<<<<<<<<
 * 
 *     def ellminimalmodel(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, elllseries(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6138
 *         return self.new_gen(elllocalred(self.g, t0))
 * 
 *     def elllseries(self, s, A=1):             # <<<<<<<<<<<<<<
 *         """
 *         e.elllseries(s, A=1): return the value of the `L`-series of
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.elllseries", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6181
 *         return self.new_gen(elllseries(self.g, t0, t1, prec))
 * 
 *     def ellminimalmodel(self):             # <<<<<<<<<<<<<<
 *         """
 *         ellminimalmodel(e): return the standard minimal integral model of
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_407ellminimalmodel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_406ellminimalmodel[] = "\n        ellminimalmodel(e): return the standard minimal integral model of\n        the rational elliptic curve e and the corresponding change of\n        variables. INPUT:\n        \n        \n        -  ``e`` - gen (that defines an elliptic curve)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - minimal model\n        \n        -  ``gen`` - change of coordinates\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([1,2,3,4,5]).ellinit()\n            >>> F, ch = e.ellminimalmodel()\n            >>> F[:5]\n            [1, -1, 0, 4, 3]\n            >>> ch\n            [1, -1, 0, -1]\n            >>> e.ellchangecurve(ch)[:5]\n            [1, -1, 0, 4, 3]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_407ellminimalmodel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellminimalmodel (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_406ellminimalmodel(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_406ellminimalmodel(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    GEN __pyx_v_x;
    GEN __pyx_v_y;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_model = 0;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_change = 0;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellminimalmodel", 0);

    /* "cypari_src/gen.pyx":6213
 *         cdef gen model, change
 *         cdef pari_sp t
 *         sig_on()             # <<<<<<<<<<<<<<
 *         x = ellminimalmodel(self.g, &y)
 *         change = self.new_gen_noclear(y)
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6214
 *         cdef pari_sp t
 *         sig_on()
 *         x = ellminimalmodel(self.g, &y)             # <<<<<<<<<<<<<<
 *         change = self.new_gen_noclear(y)
 *         model = self.new_gen(x)
 */
    __pyx_v_x = ellminimalmodel(__pyx_v_self->g, (&__pyx_v_y));

    /* "cypari_src/gen.pyx":6215
 *         sig_on()
 *         x = ellminimalmodel(self.g, &y)
 *         change = self.new_gen_noclear(y)             # <<<<<<<<<<<<<<
 *         model = self.new_gen(x)
 *         return model, change
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen_noclear(__pyx_v_self, __pyx_v_y)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_change = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6216
 *         x = ellminimalmodel(self.g, &y)
 *         change = self.new_gen_noclear(y)
 *         model = self.new_gen(x)             # <<<<<<<<<<<<<<
 *         return model, change
 * 
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, __pyx_v_x)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_model = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6217
 *         change = self.new_gen_noclear(y)
 *         model = self.new_gen(x)
 *         return model, change             # <<<<<<<<<<<<<<
 * 
 *     def ellorder(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_model));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_model));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_model));
    __Pyx_INCREF(((PyObject *)__pyx_v_change));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_change));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_change));
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6181
 *         return self.new_gen(elllseries(self.g, t0, t1, prec))
 * 
 *     def ellminimalmodel(self):             # <<<<<<<<<<<<<<
 *         """
 *         ellminimalmodel(e): return the standard minimal integral model of
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellminimalmodel", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_model);
    __Pyx_XDECREF((PyObject *)__pyx_v_change);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6219
 *         return model, change
 * 
 *     def ellorder(self, x):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellorder(x): return the order of the point x on the elliptic
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_409ellorder(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_408ellorder[] = "\n        e.ellorder(x): return the order of the point x on the elliptic\n        curve e (return 0 if x is not a torsion point)\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve defined over `\\QQ`\n        \n        -  ``x`` - point on e\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([1, 0, 0, -1, 0]).ellinit()\n        \n        A point of order two::\n        \n            >>> e.ellorder([0,0])\n            2\n        \n        And a point of infinite order::\n        \n            >>> e.ellorder([1,0])\n            0\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_409ellorder(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellorder (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_408ellorder(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_408ellorder(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellorder", 0);

    /* "cypari_src/gen.pyx":6246
 *             0
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(orderell(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6247
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(orderell(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6248
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(orderell(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def ellordinate(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, orderell(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6219
 *         return model, change
 * 
 *     def ellorder(self, x):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellorder(x): return the order of the point x on the elliptic
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellorder", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6250
 *         return self.new_gen(orderell(self.g, t0))
 * 
 *     def ellordinate(self, x):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellordinate(x): return the `y`-coordinates of the points
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_411ellordinate(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_410ellordinate[] = "\n        e.ellordinate(x): return the `y`-coordinates of the points\n        on the elliptic curve e having x as `x`-coordinate.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve\n        \n        -  ``x`` - x-coordinate (can be a complex or p-adic\n           number, or a more complicated object like a power series)\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit()\n            >>> e.ellordinate(0)\n            [0, -1]\n            >>> e.ellordinate('I')\n            [0.582203589721741 - 1.38606082464177*I, -1.58220358972174 + 1.38606082464177*I]\n            >>> e.ellordinate('1+3*5^1+O(5^3)')\n            [4*5 + 5^2 + O(5^3), 4 + 3*5^2 + O(5^3)]\n            >>> e.ellordinate('z+2*z^2+O(z^4)')\n            [-2*z - 7*z^2 - 23*z^3 + O(z^4), -1 + 2*z + 7*z^2 + 23*z^3 + O(z^4)]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_411ellordinate(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellordinate (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_410ellordinate(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_410ellordinate(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellordinate", 0);

    /* "cypari_src/gen.pyx":6276
 *             [-2*z - 7*z^2 - 23*z^3 + O(z^4), -1 + 2*z + 7*z^2 + 23*z^3 + O(z^4)]
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         # the prec argument has no effect
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6277
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the prec argument has no effect
 *         return self.new_gen(ellordinate(self.g, t0, prec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6279
 *         sig_on()
 *         # the prec argument has no effect
 *         return self.new_gen(ellordinate(self.g, t0, prec))             # <<<<<<<<<<<<<<
 * 
 *     def ellpointtoz(self, P, long precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ellordinate(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6250
 *         return self.new_gen(orderell(self.g, t0))
 * 
 *     def ellordinate(self, x):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellordinate(x): return the `y`-coordinates of the points
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellordinate", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6281
 *         return self.new_gen(ellordinate(self.g, t0, prec))
 * 
 *     def ellpointtoz(self, P, long precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellpointtoz(P): return the complex number (in the fundamental
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_413ellpointtoz(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_412ellpointtoz[] = "\n        e.ellpointtoz(P): return the complex number (in the fundamental\n        parallelogram) corresponding to the point P on the elliptic curve\n        e, under the complex uniformization of e given by the Weierstrass\n        p-function.\n        \n        The complex number z returned by this function lies in the\n        parallelogram formed by the real and complex periods of e, as given\n        by e.omega().\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,0,0,1,0]).ellinit()\n            >>> e.ellpointtoz([0,0])\n            1.85407467730137\n        \n        The point at infinity is sent to the complex number 0::\n        \n            >>> e.ellpointtoz([0])\n            0\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_413ellpointtoz(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_P = 0;
    long __pyx_v_precision;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellpointtoz (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_P,&__pyx_n_s_precision,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_P)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellpointtoz") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6281; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_P = values[0];
      if (values[1]) {
        __pyx_v_precision = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_precision == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_precision = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellpointtoz", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellpointtoz", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_412ellpointtoz(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_P, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_412ellpointtoz(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_P, long __pyx_v_precision) {
    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;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellpointtoz", 0);

    /* "cypari_src/gen.pyx":6303
 *             0
 *         """
 *         t0GEN(P)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(zell(self.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_P); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6304
 *         """
 *         t0GEN(P)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(zell(self.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6305
 *         t0GEN(P)
 *         sig_on()
 *         return self.new_gen(zell(self.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def ellpow(self, z, n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_precision); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, zell(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6281
 *         return self.new_gen(ellordinate(self.g, t0, prec))
 * 
 *     def ellpointtoz(self, P, long precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellpointtoz(P): return the complex number (in the fundamental
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellpointtoz", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6307
 *         return self.new_gen(zell(self.g, t0, pbw(precision)))
 * 
 *     def ellpow(self, z, n):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellpow(z, n): return `n` times the point `z` on the elliptic
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_415ellpow(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_414ellpow[] = "\n        e.ellpow(z, n): return `n` times the point `z` on the elliptic\n        curve `e`.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve\n        \n        -  ``z`` - point on `e`\n        \n        -  ``n`` - integer, or a complex quadratic integer of complex\n           multiplication for `e`. Complex multiplication currently\n           only works if `e` is defined over `Q`.\n        \n        \n        EXAMPLES: We consider a curve with CM by `Z[i]`::\n        \n            >>> e = pari([0,0,0,3,0]).ellinit()\n            >>> p = [1,2]  # Point of infinite order\n        \n        Multiplication by two::\n        \n            >>> e.ellpow([0,0], 2)\n            [0]\n            >>> e.ellpow(p, 2)\n            [1/4, -7/8]\n        \n        Complex multiplication::\n        \n            >>> q = e.ellpow(p, '1+I'); q\n            [-2*I, 1 + I]\n            >>> e.ellpow(q, '1-I')\n            [1/4, -7/8]\n        \n        # TESTS::\n        #\n        # Removed tests that require hilbert_class_polynomial\n        #\n        #sage: for D in [-7, -8, -11, -12, -16, -19, -27, -28]: # long time (1s)\n        #    ...       hcpol = hilbert_class_polynomial(D)\n        #    ...       j = hcpol.roots(multiplicities=False)[0]\n        #    ...       t = (1728-j)/(27*j)\n        #    ...       E = EllipticCurve([4*t,16*t^2])\n        #    ...       P = E.point([0, 4*t])\n        #    ...       assert(E.j_invariant() == j)\n        #    ...       #\n        #    ...       # Compute some CM number and its minimal polynomial\n        #    ...       #\n        #    ...       cm = pari('cm = (3*quadgen(%s)+2)'%D)\n        #    ...       cm_minpoly = pari('minpoly(cm)')\n        #    ...       #\n        #    ...       # Evaluate cm_minpoly(cm)(P), which should be zero\n        #    ...       #\n        #    ...       e = pari(E)  # Convert E to PARI\n        #    ...       P2 = e.ellpow(P, cm_minpoly[2]*cm + cm_minpoly[1])\n        #    .."".       P0 = e.elladd(e.ellpow(P, cm_minpoly[0]), e.ellpow(P2, cm)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_415ellpow(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_z = 0;
    PyObject *__pyx_v_n = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellpow (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_z,&__pyx_n_s_n,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_z)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("ellpow", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellpow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __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_z = values[0];
      __pyx_v_n = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellpow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellpow", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_414ellpow(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_z, __pyx_v_n);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_414ellpow(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z, PyObject *__pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellpow", 0);

    /* "cypari_src/gen.pyx":6366
 *         #    ...       P0 = e.elladd(e.ellpow(P, cm_minpoly[0]), e.ellpow(P2, cm)
 *         """
 *         t0GEN(z); t1GEN(n)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(powell(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6367
 *         """
 *         t0GEN(z); t1GEN(n)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(powell(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6368
 *         t0GEN(z); t1GEN(n)
 *         sig_on()
 *         return self.new_gen(powell(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def ellrootno(self, p=1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, powell(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6307
 *         return self.new_gen(zell(self.g, t0, pbw(precision)))
 * 
 *     def ellpow(self, z, n):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellpow(z, n): return `n` times the point `z` on the elliptic
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellpow", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6370
 *         return self.new_gen(powell(self.g, t0, t1))
 * 
 *     def ellrootno(self, p=1):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellrootno(p): return the (local or global) root number of the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_417ellrootno(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_416ellrootno[] = "\n        e.ellrootno(p): return the (local or global) root number of the\n        `L`-series of the elliptic curve e\n        \n        If p is a prime number, the local root number at p is returned. If\n        p is 1, the global root number is returned. Note that the global\n        root number is the sign of the functional equation of the\n        `L`-series, and therefore conjecturally equal to the parity\n        of the rank of e.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve over `\\QQ`\n        \n        -  ``p (default = 1)`` - 1 or a prime number\n        \n        \n        OUTPUT: 1 or -1\n        \n        EXAMPLES: Here is a curve of rank 3::\n        \n            >>> e = pari([0,0,0,-82,0]).ellinit()\n            >>> e.ellrootno()\n            -1\n            >>> e.ellrootno(2)\n            1\n            >>> e.ellrootno(1009)\n            1\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_417ellrootno(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_p = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellrootno (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_p);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellrootno") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6370; __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_p = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellrootno", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellrootno", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_416ellrootno(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_p);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_416ellrootno(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p) {
    long __pyx_v_rootno;
    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("ellrootno", 0);

    /* "cypari_src/gen.pyx":6402
 *         """
 *         cdef long rootno
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         rootno =  ellrootno(self.g, t0)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6403
 *         cdef long rootno
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         rootno =  ellrootno(self.g, t0)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6404
 *         t0GEN(p)
 *         sig_on()
 *         rootno =  ellrootno(self.g, t0)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return rootno
 */
    __pyx_v_rootno = ellrootno(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0);

    /* "cypari_src/gen.pyx":6405
 *         sig_on()
 *         rootno =  ellrootno(self.g, t0)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return rootno
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":6406
 *         rootno =  ellrootno(self.g, t0)
 *         sig_off()
 *         return rootno             # <<<<<<<<<<<<<<
 * 
 *     def ellsigma(self, z, flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_rootno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6370
 *         return self.new_gen(powell(self.g, t0, t1))
 * 
 *     def ellrootno(self, p=1):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellrootno(p): return the (local or global) root number of the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellrootno", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6408
 *         return rootno
 * 
 *     def ellsigma(self, z, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellsigma(z, flag=0): return the value at the complex point z of
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_419ellsigma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_418ellsigma[] = "\n        e.ellsigma(z, flag=0): return the value at the complex point z of\n        the Weierstrass `\\sigma` function associated to the\n        elliptic curve e.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,0,0,1,0]).ellinit()\n            >>> e.ellsigma('2+I')\n            1.43490215804166 + 1.80307856719256*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_419ellsigma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_z = 0;
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellsigma (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_z,&__pyx_n_s_flag,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_z)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellsigma") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6408; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_z = values[0];
      __pyx_v_flag = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellsigma", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellsigma", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_418ellsigma(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_z, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_418ellsigma(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z, PyObject *__pyx_v_flag) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    long __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellsigma", 0);

    /* "cypari_src/gen.pyx":6420
 *             1.43490215804166 + 1.80307856719256*I
 *         """
 *         t0GEN(z)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         # the prec argument has no effect
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6421
 *         """
 *         t0GEN(z)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the prec argument has no effect
 *         return self.new_gen(ellsigma(self.g, t0, flag, prec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6423
 *         sig_on()
 *         # the prec argument has no effect
 *         return self.new_gen(ellsigma(self.g, t0, flag, prec))             # <<<<<<<<<<<<<<
 * 
 *     def ellsub(self, z0, z1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ellsigma(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_2, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6408
 *         return rootno
 * 
 *     def ellsigma(self, z, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellsigma(z, flag=0): return the value at the complex point z of
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellsigma", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6425
 *         return self.new_gen(ellsigma(self.g, t0, flag, prec))
 * 
 *     def ellsub(self, z0, z1):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellsub(z0, z1): return z0-z1 on this elliptic curve.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_421ellsub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_420ellsub[] = "\n        e.ellsub(z0, z1): return z0-z1 on this elliptic curve.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve E\n        \n        -  ``z0`` - point on E\n        \n        -  ``z1`` - point on E\n        \n        \n        OUTPUT: point on E\n        \n        EXAMPLES::\n        \n            >>> e = pari([0, 1, 1, -2, 0]).ellinit()\n            >>> e.ellsub([1,0], [-1,1])\n            [0, 0]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_421ellsub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_z0 = 0;
    PyObject *__pyx_v_z1 = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellsub (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_z0,&__pyx_n_s_z1,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_z0)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z1)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("ellsub", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellsub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6425; __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_z0 = values[0];
      __pyx_v_z1 = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellsub", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellsub", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_420ellsub(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_z0, __pyx_v_z1);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_420ellsub(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z0, PyObject *__pyx_v_z1) {
    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("ellsub", 0);

    /* "cypari_src/gen.pyx":6447
 *             [0, 0]
 *         """
 *         t0GEN(z0); t1GEN(z1)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(subell(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_z1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6448
 *         """
 *         t0GEN(z0); t1GEN(z1)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(subell(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6449
 *         t0GEN(z0); t1GEN(z1)
 *         sig_on()
 *         return self.new_gen(subell(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def elltaniyama(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, subell(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6425
 *         return self.new_gen(ellsigma(self.g, t0, flag, prec))
 * 
 *     def ellsub(self, z0, z1):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellsub(z0, z1): return z0-z1 on this elliptic curve.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellsub", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6451
 *         return self.new_gen(subell(self.g, t0, t1))
 * 
 *     def elltaniyama(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(taniyama(self.g))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_423elltaniyama(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_423elltaniyama(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("elltaniyama (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_422elltaniyama(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_422elltaniyama(struct __pyx_obj_10cypari_src_3gen_gen *__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("elltaniyama", 0);

    /* "cypari_src/gen.pyx":6452
 * 
 *     def elltaniyama(self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(taniyama(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6453
 *     def elltaniyama(self):
 *         sig_on()
 *         return self.new_gen(taniyama(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def elltors(self, flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, taniyama(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6451
 *         return self.new_gen(subell(self.g, t0, t1))
 * 
 *     def elltaniyama(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(taniyama(self.g))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.elltaniyama", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6455
 *         return self.new_gen(taniyama(self.g))
 * 
 *     def elltors(self, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         e.elltors(flag = 0): return information about the torsion subgroup
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_425elltors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_424elltors[] = "\n        e.elltors(flag = 0): return information about the torsion subgroup\n        of the elliptic curve e\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve over `\\QQ`\n        \n        -  ``flag (optional)`` - specify which algorithm to\n           use:\n        \n        -  ``0 (default)`` - use Doud's algorithm: bound\n           torsion by computing the cardinality of e(GF(p)) for small primes\n           of good reduction, then look for torsion points using Weierstrass\n           parametrization and Mazur's classification\n        \n        -  ``1`` - use algorithm given by the Nagell-Lutz\n           theorem (this is much slower)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - the order of the torsion subgroup, a.k.a.\n           the number of points of finite order\n        \n        -  ``gen`` - vector giving the structure of the torsion\n           subgroup as a product of cyclic groups, sorted in non-increasing\n           order\n        \n        -  ``gen`` - vector giving points on e generating these\n           cyclic groups\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([1,0,1,-19,26]).ellinit()\n            >>> e.elltors()\n            [12, [6, 2], [[-2, 8], [3, -2]]]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_425elltors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("elltors (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "elltors") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __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_flag = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("elltors", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6455; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.elltors", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_424elltors(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_424elltors(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag) {
    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("elltors", 0);

    /* "cypari_src/gen.pyx":6497
 *             [12, [6, 2], [[-2, 8], [3, -2]]]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(elltors0(self.g, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6498
 *         """
 *         sig_on()
 *         return self.new_gen(elltors0(self.g, flag))             # <<<<<<<<<<<<<<
 * 
 *     def ellzeta(self, z):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, elltors0(__pyx_v_self->g, __pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6455
 *         return self.new_gen(taniyama(self.g))
 * 
 *     def elltors(self, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         e.elltors(flag = 0): return information about the torsion subgroup
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.elltors", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6500
 *         return self.new_gen(elltors0(self.g, flag))
 * 
 *     def ellzeta(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellzeta(z): return the value at the complex point z of the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_427ellzeta(PyObject *__pyx_v_self, PyObject *__pyx_v_z); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_426ellzeta[] = "\n        e.ellzeta(z): return the value at the complex point z of the\n        Weierstrass `\\zeta` function associated with the elliptic\n        curve e.\n        \n        .. note::\n\n           This function has infinitely many poles (one of which is at\n           z=0); attempting to evaluate it too close to one of the\n           poles will result in a PariError.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve\n        \n        -  ``z`` - complex number\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,0,0,1,0]).ellinit()\n            >>> e.ellzeta(1)     # 32-bit: 1.06479841295883 + 0.E-19*I \n            1.06479841295883 + 5.42101086242752 E-20*I\n            >>> e.ellzeta('I-1')\n            -0.350122658523049 - 0.350122658523049*I\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_427ellzeta(PyObject *__pyx_v_self, PyObject *__pyx_v_z) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellzeta (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_426ellzeta(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_z));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_426ellzeta(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z) {
    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("ellzeta", 0);

    /* "cypari_src/gen.pyx":6528
 *             -0.350122658523049 - 0.350122658523049*I
 *         """
 *         t0GEN(z)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         # the prec argument has no effect
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6529
 *         """
 *         t0GEN(z)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the prec argument has no effect
 *         return self.new_gen(ellzeta(self.g, t0, prec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6531
 *         sig_on()
 *         # the prec argument has no effect
 *         return self.new_gen(ellzeta(self.g, t0, prec))             # <<<<<<<<<<<<<<
 * 
 *     def ellztopoint(self, z):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ellzeta(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6500
 *         return self.new_gen(elltors0(self.g, flag))
 * 
 *     def ellzeta(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellzeta(z): return the value at the complex point z of the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellzeta", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6533
 *         return self.new_gen(ellzeta(self.g, t0, prec))
 * 
 *     def ellztopoint(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellztopoint(z): return the point on the elliptic curve e
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_429ellztopoint(PyObject *__pyx_v_self, PyObject *__pyx_v_z); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_428ellztopoint[] = "\n        e.ellztopoint(z): return the point on the elliptic curve e\n        corresponding to the complex number z, under the usual complex\n        uniformization of e by the Weierstrass p-function.\n        \n        INPUT:\n        \n        \n        -  ``e`` - elliptic curve\n        \n        -  ``z`` - complex number\n        \n        \n        OUTPUT point on e\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,0,0,1,0]).ellinit()\n\n            # 32-bit:  [0.E-19 - 1.02152286795670*I, -0.149072813701096 - 0.149072813701096*I]\n            >>> e.ellztopoint('1+I')  # doctest: +ELLIPSIS\n            [... - 1.02152286795670*I, -0.149072813701096 - 0.149072813701096*I]\n        \n        Complex numbers belonging to the period lattice of e are of course\n        sent to the point at infinity on e::\n        \n            >>> e.ellztopoint(0)\n            [0]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_429ellztopoint(PyObject *__pyx_v_self, PyObject *__pyx_v_z) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellztopoint (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_428ellztopoint(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_z));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_428ellztopoint(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z) {
    PyObject *__pyx_v_dprec = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    int __pyx_t_7;
    PyObject *__pyx_t_8 = NULL;
    long __pyx_t_9;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellztopoint", 0);

    /* "cypari_src/gen.pyx":6563
 *             [0]
 *         """
 *         t0GEN(z)             # <<<<<<<<<<<<<<
 *         try:
 *             dprec = prec_words_to_dec(z.precision())
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6564
 *         """
 *         t0GEN(z)
 *         try:             # <<<<<<<<<<<<<<
 *             dprec = prec_words_to_dec(z.precision())
 *         except AttributeError:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "cypari_src/gen.pyx":6565
 *         t0GEN(z)
 *         try:
 *             dprec = prec_words_to_dec(z.precision())             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             dprec = prec
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_z, __pyx_n_s_precision); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        if (__pyx_t_6) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_words_to_dec(__pyx_t_7, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_v_dprec = __pyx_t_1;
        __pyx_t_1 = 0;
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L10_try_end;
      __pyx_L3_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":6566
 *         try:
 *             dprec = prec_words_to_dec(z.precision())
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             dprec = prec
 *         sig_on()
 */
      __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("cypari_src.gen.gen.ellztopoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6566; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_6);

        /* "cypari_src/gen.pyx":6567
 *             dprec = prec_words_to_dec(z.precision())
 *         except AttributeError:
 *             dprec = prec             # <<<<<<<<<<<<<<
 *         sig_on()
 *         # the prec argument has no effect
 */
        __pyx_t_8 = __Pyx_PyInt_From_unsigned_long(__pyx_v_10cypari_src_3gen_prec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6567; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_XDECREF_SET(__pyx_v_dprec, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L4_exception_handled;
      }
      goto __pyx_L5_except_error;
      __pyx_L5_except_error:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L4_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      __pyx_L10_try_end:;
    }

    /* "cypari_src/gen.pyx":6568
 *         except AttributeError:
 *             dprec = prec
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the prec argument has no effect
 *         return self.new_gen(pointell(self.g, t0, dprec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6570
 *         sig_on()
 *         # the prec argument has no effect
 *         return self.new_gen(pointell(self.g, t0, dprec))             # <<<<<<<<<<<<<<
 * 
 *     def omega(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = __Pyx_PyInt_As_long(__pyx_v_dprec); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, pointell(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_9))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6533
 *         return self.new_gen(ellzeta(self.g, t0, prec))
 * 
 *     def ellztopoint(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         e.ellztopoint(z): return the point on the elliptic curve e
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellztopoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_dprec);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6572
 *         return self.new_gen(pointell(self.g, t0, dprec))
 * 
 *     def omega(self):             # <<<<<<<<<<<<<<
 *         """
 *         e.omega(): return basis for the period lattice of the elliptic
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_431omega(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_430omega[] = "\n        e.omega(): return basis for the period lattice of the elliptic\n        curve e.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.omega()\n            [1.26920930427955, -0.634604652139777 - 1.45881661693850*I]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_431omega(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("omega (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_430omega(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_430omega(struct __pyx_obj_10cypari_src_3gen_gen *__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("omega", 0);

    /* "cypari_src/gen.pyx":6583
 *             [1.26920930427955, -0.634604652139777 - 1.45881661693850*I]
 *         """
 *         return self[14:16]             # <<<<<<<<<<<<<<
 * 
 *     def disc(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 14, 16, NULL, NULL, &__pyx_slice__21, 1, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6572
 *         return self.new_gen(pointell(self.g, t0, dprec))
 * 
 *     def omega(self):             # <<<<<<<<<<<<<<
 *         """
 *         e.omega(): return basis for the period lattice of the elliptic
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.omega", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6585
 *         return self[14:16]
 * 
 *     def disc(self):             # <<<<<<<<<<<<<<
 *         """
 *         e.disc(): return the discriminant of the elliptic curve e.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_433disc(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_432disc[] = "\n        e.disc(): return the discriminant of the elliptic curve e.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.disc()\n            -161051\n            >>> _.factor()\n            [-1, 1; 11, 5]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_433disc(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("disc (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_432disc(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_432disc(struct __pyx_obj_10cypari_src_3gen_gen *__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("disc", 0);

    /* "cypari_src/gen.pyx":6597
 *             [-1, 1; 11, 5]
 *         """
 *         return self[11]             # <<<<<<<<<<<<<<
 * 
 *     def j(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6597; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6585
 *         return self[14:16]
 * 
 *     def disc(self):             # <<<<<<<<<<<<<<
 *         """
 *         e.disc(): return the discriminant of the elliptic curve e.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.disc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6599
 *         return self[11]
 * 
 *     def j(self):             # <<<<<<<<<<<<<<
 *         """
 *         e.j(): return the j-invariant of the elliptic curve e.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_435j(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_434j[] = "\n        e.j(): return the j-invariant of the elliptic curve e.\n        \n        EXAMPLES::\n        \n            >>> e = pari([0, -1, 1, -10, -20]).ellinit()\n            >>> e.j()\n            -122023936/161051\n            >>> _.factor()\n            [-1, 1; 2, 12; 11, -5; 31, 3]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_435j(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("j (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_434j(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_434j(struct __pyx_obj_10cypari_src_3gen_gen *__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("j", 0);

    /* "cypari_src/gen.pyx":6611
 *             [-1, 1; 2, 12; 11, -5; 31, 3]
 *         """
 *         return self[12]             # <<<<<<<<<<<<<<
 * 
 *     def ellj(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6611; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6599
 *         return self[11]
 * 
 *     def j(self):             # <<<<<<<<<<<<<<
 *         """
 *         e.j(): return the j-invariant of the elliptic curve e.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.j", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6613
 *         return self[12]
 * 
 *     def ellj(self):             # <<<<<<<<<<<<<<
 *         try:
 *             dprec = prec_words_to_dec(self.precision())
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_437ellj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_437ellj(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellj (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_436ellj(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_436ellj(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    PyObject *__pyx_v_dprec = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    int __pyx_t_7;
    PyObject *__pyx_t_8 = NULL;
    long __pyx_t_9;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellj", 0);

    /* "cypari_src/gen.pyx":6614
 * 
 *     def ellj(self):
 *         try:             # <<<<<<<<<<<<<<
 *             dprec = prec_words_to_dec(self.precision())
 *         except AttributeError:
 */
    {
      __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:*/ {

        /* "cypari_src/gen.pyx":6615
 *     def ellj(self):
 *         try:
 *             dprec = prec_words_to_dec(self.precision())             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             dprec = prec
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_precision); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        if (__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else {
          __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __pyx_f_10cypari_src_3gen_prec_words_to_dec(__pyx_t_7, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_v_dprec = __pyx_t_4;
        __pyx_t_4 = 0;
      }
      __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_L3_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cypari_src/gen.pyx":6616
 *         try:
 *             dprec = prec_words_to_dec(self.precision())
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             dprec = prec
 *         sig_on()
 */
      __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("cypari_src.gen.gen.ellj", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6616; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_6);

        /* "cypari_src/gen.pyx":6617
 *             dprec = prec_words_to_dec(self.precision())
 *         except AttributeError:
 *             dprec = prec             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(jell(self.g, dprec))
 */
        __pyx_t_8 = __Pyx_PyInt_From_unsigned_long(__pyx_v_10cypari_src_3gen_prec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6617; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_XDECREF_SET(__pyx_v_dprec, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L4_exception_handled;
      }
      goto __pyx_L5_except_error;
      __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_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:;
    }

    /* "cypari_src/gen.pyx":6618
 *         except AttributeError:
 *             dprec = prec
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(jell(self.g, dprec))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6619
 *             dprec = prec
 *         sig_on()
 *         return P.new_gen(jell(self.g, dprec))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = __Pyx_PyInt_As_long(__pyx_v_dprec); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, jell(__pyx_v_self->g, __pyx_t_9))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6613
 *         return self[12]
 * 
 *     def ellj(self):             # <<<<<<<<<<<<<<
 *         try:
 *             dprec = prec_words_to_dec(self.precision())
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellj", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_dprec);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6625
 *     # 6: Functions related to NUMBER FIELDS
 *     ###########################################
 *     def bnfcertify(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         ``bnf`` being as output by ``bnfinit``, checks whether the result is
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_439bnfcertify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_438bnfcertify[] = "\n        ``bnf`` being as output by ``bnfinit``, checks whether the result is\n        correct, i.e. whether the calculation of the contents of ``self``\n        are correct without assuming the Generalized Riemann Hypothesis.\n        If it is correct, the answer is 1. If not, the program may output\n        some error message or loop indefinitely.\n        \n        For more information about PARI and the Generalized Riemann\n        Hypothesis, see [PariUsers], page 120.\n        \n        REFERENCES:\n        \n        .. [PariUsers] User's Guide to PARI/GP,\n           http://pari.math.u-bordeaux.fr/pub/pari/manuals/2.4.2/users.pdf\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_439bnfcertify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bnfcertify (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_438bnfcertify(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_438bnfcertify(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    long __pyx_v_n;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("bnfcertify", 0);

    /* "cypari_src/gen.pyx":6642
 *         """
 *         cdef long n
 *         sig_on()             # <<<<<<<<<<<<<<
 *         n = bnfcertify(self.g)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6643
 *         cdef long n
 *         sig_on()
 *         n = bnfcertify(self.g)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return n
 */
    __pyx_v_n = bnfcertify(__pyx_v_self->g);

    /* "cypari_src/gen.pyx":6644
 *         sig_on()
 *         n = bnfcertify(self.g)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return n
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":6645
 *         n = bnfcertify(self.g)
 *         sig_off()
 *         return n             # <<<<<<<<<<<<<<
 * 
 *     def bnfinit(self, long flag=0, tech=None):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6625
 *     # 6: Functions related to NUMBER FIELDS
 *     ###########################################
 *     def bnfcertify(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         ``bnf`` being as output by ``bnfinit``, checks whether the result is
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfcertify", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6647
 *         return n
 * 
 *     def bnfinit(self, long flag=0, tech=None):             # <<<<<<<<<<<<<<
 *         if tech is None:
 *             sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_441bnfinit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_441bnfinit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    PyObject *__pyx_v_tech = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bnfinit (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_tech,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)Py_None);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tech);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bnfinit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6647; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
      __pyx_v_tech = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("bnfinit", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_440bnfinit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag, __pyx_v_tech);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_440bnfinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, PyObject *__pyx_v_tech) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("bnfinit", 0);

    /* "cypari_src/gen.pyx":6648
 * 
 *     def bnfinit(self, long flag=0, tech=None):
 *         if tech is None:             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return P.new_gen(bnfinit0(self.g, flag, <GEN>0, prec))
 */
    __pyx_t_1 = (__pyx_v_tech == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":6649
 *     def bnfinit(self, long flag=0, tech=None):
 *         if tech is None:
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return P.new_gen(bnfinit0(self.g, flag, <GEN>0, prec))
 *         else:
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":6650
 *         if tech is None:
 *             sig_on()
 *             return P.new_gen(bnfinit0(self.g, flag, <GEN>0, prec))             # <<<<<<<<<<<<<<
 *         else:
 *             t0GEN(tech)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, bnfinit0(__pyx_v_self->g, __pyx_v_flag, ((GEN)0), __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":6652
 *             return P.new_gen(bnfinit0(self.g, flag, <GEN>0, prec))
 *         else:
 *             t0GEN(tech)             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return P.new_gen(bnfinit0(self.g, flag, t0, prec))
 */
      __pyx_t_3 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_tech); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cypari_src/gen.pyx":6653
 *         else:
 *             t0GEN(tech)
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return P.new_gen(bnfinit0(self.g, flag, t0, prec))
 * 
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":6654
 *             t0GEN(tech)
 *             sig_on()
 *             return P.new_gen(bnfinit0(self.g, flag, t0, prec))             # <<<<<<<<<<<<<<
 * 
 *     def bnfisintnorm(self, x):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, bnfinit0(__pyx_v_self->g, __pyx_v_flag, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":6647
 *         return n
 * 
 *     def bnfinit(self, long flag=0, tech=None):             # <<<<<<<<<<<<<<
 *         if tech is None:
 *             sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6656
 *             return P.new_gen(bnfinit0(self.g, flag, t0, prec))
 * 
 *     def bnfisintnorm(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_443bnfisintnorm(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_443bnfisintnorm(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bnfisintnorm (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_442bnfisintnorm(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_442bnfisintnorm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("bnfisintnorm", 0);

    /* "cypari_src/gen.pyx":6657
 * 
 *     def bnfisintnorm(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(bnfisintnorm(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6658
 *     def bnfisintnorm(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bnfisintnorm(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6659
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(bnfisintnorm(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def bnfisnorm(self, x, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bnfisintnorm(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6656
 *             return P.new_gen(bnfinit0(self.g, flag, t0, prec))
 * 
 *     def bnfisintnorm(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfisintnorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6661
 *         return self.new_gen(bnfisintnorm(self.g, t0))
 * 
 *     def bnfisnorm(self, x, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_445bnfisnorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_445bnfisnorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bnfisnorm (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_flag,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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bnfisnorm") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6661; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6661; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("bnfisnorm", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6661; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfisnorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_444bnfisnorm(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_444bnfisnorm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, long __pyx_v_flag) {
    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("bnfisnorm", 0);

    /* "cypari_src/gen.pyx":6662
 * 
 *     def bnfisnorm(self, x, long flag=0):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(bnfisnorm(self.g, t0, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6663
 *     def bnfisnorm(self, x, long flag=0):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bnfisnorm(self.g, t0, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6664
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(bnfisnorm(self.g, t0, flag))             # <<<<<<<<<<<<<<
 * 
 *     def bnfisprincipal(self, x, long flag=1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bnfisnorm(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6661
 *         return self.new_gen(bnfisintnorm(self.g, t0))
 * 
 *     def bnfisnorm(self, x, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfisnorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6666
 *         return self.new_gen(bnfisnorm(self.g, t0, flag))
 * 
 *     def bnfisprincipal(self, x, long flag=1):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_447bnfisprincipal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_447bnfisprincipal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bnfisprincipal (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_flag,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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bnfisprincipal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)1);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("bnfisprincipal", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfisprincipal", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_446bnfisprincipal(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_446bnfisprincipal(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, long __pyx_v_flag) {
    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("bnfisprincipal", 0);

    /* "cypari_src/gen.pyx":6667
 * 
 *     def bnfisprincipal(self, x, long flag=1):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(bnfisprincipal0(self.g, t0, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6668
 *     def bnfisprincipal(self, x, long flag=1):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bnfisprincipal0(self.g, t0, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6669
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(bnfisprincipal0(self.g, t0, flag))             # <<<<<<<<<<<<<<
 * 
 *     def bnfnarrow(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bnfisprincipal0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6666
 *         return self.new_gen(bnfisnorm(self.g, t0, flag))
 * 
 *     def bnfisprincipal(self, x, long flag=1):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfisprincipal", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6671
 *         return self.new_gen(bnfisprincipal0(self.g, t0, flag))
 * 
 *     def bnfnarrow(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(buchnarrow(self.g))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_449bnfnarrow(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_449bnfnarrow(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bnfnarrow (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_448bnfnarrow(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_448bnfnarrow(struct __pyx_obj_10cypari_src_3gen_gen *__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("bnfnarrow", 0);

    /* "cypari_src/gen.pyx":6672
 * 
 *     def bnfnarrow(self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(buchnarrow(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6673
 *     def bnfnarrow(self):
 *         sig_on()
 *         return self.new_gen(buchnarrow(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def bnfsunit(bnf, S, long precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, buchnarrow(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6671
 *         return self.new_gen(bnfisprincipal0(self.g, t0, flag))
 * 
 *     def bnfnarrow(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(buchnarrow(self.g))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfnarrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6675
 *         return self.new_gen(buchnarrow(self.g))
 * 
 *     def bnfsunit(bnf, S, long precision=0):             # <<<<<<<<<<<<<<
 *         t0GEN(S)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_451bnfsunit(PyObject *__pyx_v_bnf, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_451bnfsunit(PyObject *__pyx_v_bnf, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_S = 0;
    long __pyx_v_precision;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bnfsunit (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_S,&__pyx_n_s_precision,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_S)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bnfsunit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6675; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_S = values[0];
      if (values[1]) {
        __pyx_v_precision = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_precision == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_precision = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("bnfsunit", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6675; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfsunit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_450bnfsunit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_bnf), __pyx_v_S, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_450bnfsunit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_bnf, PyObject *__pyx_v_S, long __pyx_v_precision) {
    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;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("bnfsunit", 0);

    /* "cypari_src/gen.pyx":6676
 * 
 *     def bnfsunit(bnf, S, long precision=0):
 *         t0GEN(S)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return bnf.new_gen(bnfsunit(bnf.g, t0, pbw(precision)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_S); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6677
 *     def bnfsunit(bnf, S, long precision=0):
 *         t0GEN(S)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return bnf.new_gen(bnfsunit(bnf.g, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6678
 *         t0GEN(S)
 *         sig_on()
 *         return bnf.new_gen(bnfsunit(bnf.g, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def bnfunit(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_precision); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_bnf->__pyx_vtab)->new_gen(__pyx_v_bnf, bnfsunit(__pyx_v_bnf->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6675
 *         return self.new_gen(buchnarrow(self.g))
 * 
 *     def bnfsunit(bnf, S, long precision=0):             # <<<<<<<<<<<<<<
 *         t0GEN(S)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfsunit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6680
 *         return bnf.new_gen(bnfsunit(bnf.g, t0, pbw(precision)))
 * 
 *     def bnfunit(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(bnf_get_fu(self.g))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_453bnfunit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_453bnfunit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bnfunit (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_452bnfunit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_452bnfunit(struct __pyx_obj_10cypari_src_3gen_gen *__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("bnfunit", 0);

    /* "cypari_src/gen.pyx":6681
 * 
 *     def bnfunit(self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bnf_get_fu(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6682
 *     def bnfunit(self):
 *         sig_on()
 *         return self.new_gen(bnf_get_fu(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def bnfisunit(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bnf_get_fu(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6680
 *         return bnf.new_gen(bnfsunit(bnf.g, t0, pbw(precision)))
 * 
 *     def bnfunit(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(bnf_get_fu(self.g))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfunit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6684
 *         return self.new_gen(bnf_get_fu(self.g))
 * 
 *     def bnfisunit(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_455bnfisunit(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_455bnfisunit(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("bnfisunit (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_454bnfisunit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_454bnfisunit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("bnfisunit", 0);

    /* "cypari_src/gen.pyx":6685
 * 
 *     def bnfisunit(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(bnfisunit(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6686
 *     def bnfisunit(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(bnfisunit(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6687
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(bnfisunit(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def dirzetak(self, n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, bnfisunit(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6684
 *         return self.new_gen(bnf_get_fu(self.g))
 * 
 *     def bnfisunit(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.bnfisunit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6689
 *         return self.new_gen(bnfisunit(self.g, t0))
 * 
 *     def dirzetak(self, n):             # <<<<<<<<<<<<<<
 *         t0GEN(n)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_457dirzetak(PyObject *__pyx_v_self, PyObject *__pyx_v_n); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_457dirzetak(PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("dirzetak (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_456dirzetak(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_456dirzetak(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("dirzetak", 0);

    /* "cypari_src/gen.pyx":6690
 * 
 *     def dirzetak(self, n):
 *         t0GEN(n)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(dirzetak(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6691
 *     def dirzetak(self, n):
 *         t0GEN(n)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(dirzetak(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6692
 *         t0GEN(n)
 *         sig_on()
 *         return self.new_gen(dirzetak(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def galoisapply(self, aut, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, dirzetak(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6689
 *         return self.new_gen(bnfisunit(self.g, t0))
 * 
 *     def dirzetak(self, n):             # <<<<<<<<<<<<<<
 *         t0GEN(n)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.dirzetak", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6694
 *         return self.new_gen(dirzetak(self.g, t0))
 * 
 *     def galoisapply(self, aut, x):             # <<<<<<<<<<<<<<
 *         t0GEN(aut)
 *         t1GEN(x)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_459galoisapply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_459galoisapply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_aut = 0;
    PyObject *__pyx_v_x = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("galoisapply (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_aut,&__pyx_n_s_x,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_aut)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("galoisapply", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "galoisapply") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6694; __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_aut = values[0];
      __pyx_v_x = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("galoisapply", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.galoisapply", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_458galoisapply(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_aut, __pyx_v_x);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_458galoisapply(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_aut, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("galoisapply", 0);

    /* "cypari_src/gen.pyx":6695
 * 
 *     def galoisapply(self, aut, x):
 *         t0GEN(aut)             # <<<<<<<<<<<<<<
 *         t1GEN(x)
 *         sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_aut); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6696
 *     def galoisapply(self, aut, x):
 *         t0GEN(aut)
 *         t1GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(galoisapply(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6697
 *         t0GEN(aut)
 *         t1GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(galoisapply(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6698
 *         t1GEN(x)
 *         sig_on()
 *         return self.new_gen(galoisapply(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def galoisinit(self, den=None):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, galoisapply(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6694
 *         return self.new_gen(dirzetak(self.g, t0))
 * 
 *     def galoisapply(self, aut, x):             # <<<<<<<<<<<<<<
 *         t0GEN(aut)
 *         t1GEN(x)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.galoisapply", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6700
 *         return self.new_gen(galoisapply(self.g, t0, t1))
 * 
 *     def galoisinit(self, den=None):             # <<<<<<<<<<<<<<
 *         """
 *         galoisinit(K{,den}): calculate Galois group of number field K; see PARI manual
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_461galoisinit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_460galoisinit[] = "\n        galoisinit(K{,den}): calculate Galois group of number field K; see PARI manual\n        for meaning of den\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_461galoisinit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_den = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("galoisinit (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_den,0};
      PyObject* values[1] = {0};
      values[0] = ((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  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_den);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "galoisinit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6700; __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_den = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("galoisinit", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.galoisinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_460galoisinit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_den);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_460galoisinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_den) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("galoisinit", 0);

    /* "cypari_src/gen.pyx":6705
 *         for meaning of den
 *         """
 *         if den is None:             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return self.new_gen(galoisinit(self.g, NULL))
 */
    __pyx_t_1 = (__pyx_v_den == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":6706
 *         """
 *         if den is None:
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return self.new_gen(galoisinit(self.g, NULL))
 *         else:
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":6707
 *         if den is None:
 *             sig_on()
 *             return self.new_gen(galoisinit(self.g, NULL))             # <<<<<<<<<<<<<<
 *         else:
 *             t0GEN(den)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, galoisinit(__pyx_v_self->g, NULL))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":6709
 *             return self.new_gen(galoisinit(self.g, NULL))
 *         else:
 *             t0GEN(den)             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return self.new_gen(galoisinit(self.g, t0))
 */
      __pyx_t_3 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_den); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cypari_src/gen.pyx":6710
 *         else:
 *             t0GEN(den)
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return self.new_gen(galoisinit(self.g, t0))
 * 
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":6711
 *             t0GEN(den)
 *             sig_on()
 *             return self.new_gen(galoisinit(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def galoispermtopol(self, perm):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, galoisinit(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":6700
 *         return self.new_gen(galoisapply(self.g, t0, t1))
 * 
 *     def galoisinit(self, den=None):             # <<<<<<<<<<<<<<
 *         """
 *         galoisinit(K{,den}): calculate Galois group of number field K; see PARI manual
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.galoisinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6713
 *             return self.new_gen(galoisinit(self.g, t0))
 * 
 *     def galoispermtopol(self, perm):             # <<<<<<<<<<<<<<
 *         t0GEN(perm)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_463galoispermtopol(PyObject *__pyx_v_self, PyObject *__pyx_v_perm); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_463galoispermtopol(PyObject *__pyx_v_self, PyObject *__pyx_v_perm) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("galoispermtopol (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_462galoispermtopol(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_perm));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_462galoispermtopol(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_perm) {
    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("galoispermtopol", 0);

    /* "cypari_src/gen.pyx":6714
 * 
 *     def galoispermtopol(self, perm):
 *         t0GEN(perm)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(galoispermtopol(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_perm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6715
 *     def galoispermtopol(self, perm):
 *         t0GEN(perm)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(galoispermtopol(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6716
 *         t0GEN(perm)
 *         sig_on()
 *         return self.new_gen(galoispermtopol(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def galoisfixedfield(self, perm, long flag=0, v=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, galoispermtopol(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6713
 *             return self.new_gen(galoisinit(self.g, t0))
 * 
 *     def galoispermtopol(self, perm):             # <<<<<<<<<<<<<<
 *         t0GEN(perm)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.galoispermtopol", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6718
 *         return self.new_gen(galoispermtopol(self.g, t0))
 * 
 *     def galoisfixedfield(self, perm, long flag=0, v=-1):             # <<<<<<<<<<<<<<
 *         t0GEN(perm);
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_465galoisfixedfield(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_465galoisfixedfield(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_perm = 0;
    long __pyx_v_flag;
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("galoisfixedfield (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_perm,&__pyx_n_s_flag,&__pyx_n_s_v,0};
      PyObject* values[3] = {0,0,0};
      values[2] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          case  0: break;
          default: goto __pyx_L5_argtuple_error;
        }
        kw_args = PyDict_Size(__pyx_kwds);
        switch (pos_args) {
          case  0:
          if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_perm)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "galoisfixedfield") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6718; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_perm = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6718; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
      __pyx_v_v = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("galoisfixedfield", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6718; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.galoisfixedfield", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_464galoisfixedfield(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_perm, __pyx_v_flag, __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_464galoisfixedfield(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_perm, long __pyx_v_flag, PyObject *__pyx_v_v) {
    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("galoisfixedfield", 0);

    /* "cypari_src/gen.pyx":6719
 * 
 *     def galoisfixedfield(self, perm, long flag=0, v=-1):
 *         t0GEN(perm);             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(galoisfixedfield(self.g, t0, flag, P.get_var(v)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_perm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6720
 *     def galoisfixedfield(self, perm, long flag=0, v=-1):
 *         t0GEN(perm);
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(galoisfixedfield(self.g, t0, flag, P.get_var(v)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6721
 *         t0GEN(perm);
 *         sig_on()
 *         return self.new_gen(galoisfixedfield(self.g, t0, flag, P.get_var(v)))             # <<<<<<<<<<<<<<
 * 
 *     def idealred(self, I, vdir=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, galoisfixedfield(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_flag, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_v)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6718
 *         return self.new_gen(galoispermtopol(self.g, t0))
 * 
 *     def galoisfixedfield(self, perm, long flag=0, v=-1):             # <<<<<<<<<<<<<<
 *         t0GEN(perm);
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.galoisfixedfield", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6723
 *         return self.new_gen(galoisfixedfield(self.g, t0, flag, P.get_var(v)))
 * 
 *     def idealred(self, I, vdir=0):             # <<<<<<<<<<<<<<
 *         t0GEN(I); t1GEN(vdir)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_467idealred(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_467idealred(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_I = 0;
    PyObject *__pyx_v_vdir = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealred (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_vdir,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_I)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vdir);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealred") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6723; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_I = values[0];
      __pyx_v_vdir = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealred", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealred", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_466idealred(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_I, __pyx_v_vdir);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_466idealred(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_vdir) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    GEN __pyx_t_2;
    int __pyx_t_3;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("idealred", 0);

    /* "cypari_src/gen.pyx":6724
 * 
 *     def idealred(self, I, vdir=0):
 *         t0GEN(I); t1GEN(vdir)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(idealred0(self.g, t0, t1 if vdir else NULL))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_I); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_vdir); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6725
 *     def idealred(self, I, vdir=0):
 *         t0GEN(I); t1GEN(vdir)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(idealred0(self.g, t0, t1 if vdir else NULL))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6726
 *         t0GEN(I); t1GEN(vdir)
 *         sig_on()
 *         return self.new_gen(idealred0(self.g, t0, t1 if vdir else NULL))             # <<<<<<<<<<<<<<
 * 
 *     def idealadd(self, x, y):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_vdir); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {
      __pyx_t_2 = __pyx_v_10cypari_src_3gen_t1;
    } else {
      __pyx_t_2 = NULL;
    }
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealred0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6723
 *         return self.new_gen(galoisfixedfield(self.g, t0, flag, P.get_var(v)))
 * 
 *     def idealred(self, I, vdir=0):             # <<<<<<<<<<<<<<
 *         t0GEN(I); t1GEN(vdir)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealred", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6728
 *         return self.new_gen(idealred0(self.g, t0, t1 if vdir else NULL))
 * 
 *     def idealadd(self, x, y):             # <<<<<<<<<<<<<<
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_469idealadd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_469idealadd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_y = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealadd (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
      PyObject* values[2] = {0,0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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("idealadd", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6728; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealadd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6728; __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_x = values[0];
      __pyx_v_y = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealadd", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6728; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealadd", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_468idealadd(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_468idealadd(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    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("idealadd", 0);

    /* "cypari_src/gen.pyx":6729
 * 
 *     def idealadd(self, x, y):
 *         t0GEN(x); t1GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(idealadd(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6730
 *     def idealadd(self, x, y):
 *         t0GEN(x); t1GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(idealadd(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6731
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 *         return self.new_gen(idealadd(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def idealaddtoone(self, x, y):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealadd(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6728
 *         return self.new_gen(idealred0(self.g, t0, t1 if vdir else NULL))
 * 
 *     def idealadd(self, x, y):             # <<<<<<<<<<<<<<
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealadd", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6733
 *         return self.new_gen(idealadd(self.g, t0, t1))
 * 
 *     def idealaddtoone(self, x, y):             # <<<<<<<<<<<<<<
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_471idealaddtoone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_471idealaddtoone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_y = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealaddtoone (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
      PyObject* values[2] = {0,0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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("idealaddtoone", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6733; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealaddtoone") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6733; __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_x = values[0];
      __pyx_v_y = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealaddtoone", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6733; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealaddtoone", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_470idealaddtoone(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_470idealaddtoone(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    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("idealaddtoone", 0);

    /* "cypari_src/gen.pyx":6734
 * 
 *     def idealaddtoone(self, x, y):
 *         t0GEN(x); t1GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(idealaddtoone0(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6735
 *     def idealaddtoone(self, x, y):
 *         t0GEN(x); t1GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(idealaddtoone0(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6736
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 *         return self.new_gen(idealaddtoone0(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def idealappr(self, x, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealaddtoone0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6733
 *         return self.new_gen(idealadd(self.g, t0, t1))
 * 
 *     def idealaddtoone(self, x, y):             # <<<<<<<<<<<<<<
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealaddtoone", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6738
 *         return self.new_gen(idealaddtoone0(self.g, t0, t1))
 * 
 *     def idealappr(self, x, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_473idealappr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_473idealappr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    CYTHON_UNUSED long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealappr (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_flag,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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealappr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6738; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealappr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealappr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_472idealappr(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_472idealappr(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, CYTHON_UNUSED long __pyx_v_flag) {
    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("idealappr", 0);

    /* "cypari_src/gen.pyx":6739
 * 
 *     def idealappr(self, x, long flag=0):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(idealappr(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6740
 *     def idealappr(self, x, long flag=0):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(idealappr(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6741
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(idealappr(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def idealcoprime(self, x, y):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealappr(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6738
 *         return self.new_gen(idealaddtoone0(self.g, t0, t1))
 * 
 *     def idealappr(self, x, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealappr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6743
 *         return self.new_gen(idealappr(self.g, t0))
 * 
 *     def idealcoprime(self, x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Given two integral ideals x and y of a pari number field self,
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_475idealcoprime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_474idealcoprime[] = "\n        Given two integral ideals x and y of a pari number field self,\n        return an element a of the field (expressed in the integral\n        basis of self) such that a*x is an integral ideal coprime to\n        y.\n        \n        EXAMPLES::\n\n            >>> nf = pari('x^3-2').nfinit()\n            >>> x = pari('[1, -1, 2]~')\n            >>> y = pari('[1, -1, 3]~')\n            >>> nf.idealcoprime(x, y)\n            [1, 0, 0]~\n\n            >>> y = pari('[2, -2, 4]~')\n            >>> nf.idealcoprime(x, y)\n            [5/43, 9/43, -1/43]~\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_475idealcoprime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_y = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealcoprime (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
      PyObject* values[2] = {0,0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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("idealcoprime", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6743; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealcoprime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6743; __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_x = values[0];
      __pyx_v_y = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealcoprime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6743; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealcoprime", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_474idealcoprime(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_474idealcoprime(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    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("idealcoprime", 0);

    /* "cypari_src/gen.pyx":6762
 *             [5/43, 9/43, -1/43]~
 *         """
 *         t0GEN(x); t1GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(idealcoprime(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6763
 *         """
 *         t0GEN(x); t1GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(idealcoprime(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6764
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 *         return self.new_gen(idealcoprime(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def idealdiv(self, x, y, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealcoprime(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6743
 *         return self.new_gen(idealappr(self.g, t0))
 * 
 *     def idealcoprime(self, x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Given two integral ideals x and y of a pari number field self,
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealcoprime", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6766
 *         return self.new_gen(idealcoprime(self.g, t0, t1))
 * 
 *     def idealdiv(self, x, y, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_477idealdiv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_477idealdiv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_y = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealdiv (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_flag,0};
      PyObject* values[3] = {0,0,0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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("idealdiv", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealdiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6766; __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);
          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_flag = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealdiv", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealdiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_476idealdiv(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_476idealdiv(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, long __pyx_v_flag) {
    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("idealdiv", 0);

    /* "cypari_src/gen.pyx":6767
 * 
 *     def idealdiv(self, x, y, long flag=0):
 *         t0GEN(x); t1GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(idealdiv0(self.g, t0, t1, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6768
 *     def idealdiv(self, x, y, long flag=0):
 *         t0GEN(x); t1GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(idealdiv0(self.g, t0, t1, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6769
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 *         return self.new_gen(idealdiv0(self.g, t0, t1, flag))             # <<<<<<<<<<<<<<
 * 
 *     def idealfactor(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealdiv0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6766
 *         return self.new_gen(idealcoprime(self.g, t0, t1))
 * 
 *     def idealdiv(self, x, y, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealdiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6771
 *         return self.new_gen(idealdiv0(self.g, t0, t1, flag))
 * 
 *     def idealfactor(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_479idealfactor(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_479idealfactor(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealfactor (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_478idealfactor(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_478idealfactor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("idealfactor", 0);

    /* "cypari_src/gen.pyx":6772
 * 
 *     def idealfactor(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(idealfactor(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6773
 *     def idealfactor(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(idealfactor(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6774
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(idealfactor(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def idealhnf(self, a, b=None):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealfactor(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6771
 *         return self.new_gen(idealdiv0(self.g, t0, t1, flag))
 * 
 *     def idealfactor(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealfactor", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6776
 *         return self.new_gen(idealfactor(self.g, t0))
 * 
 *     def idealhnf(self, a, b=None):             # <<<<<<<<<<<<<<
 *         t0GEN(a)
 *         if b is None:
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_481idealhnf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_481idealhnf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_a = 0;
    PyObject *__pyx_v_b = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealhnf (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)Py_None);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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_a)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealhnf") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6776; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_a = values[0];
      __pyx_v_b = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealhnf", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6776; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealhnf", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_480idealhnf(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_a, __pyx_v_b);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_480idealhnf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_t_3;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("idealhnf", 0);

    /* "cypari_src/gen.pyx":6777
 * 
 *     def idealhnf(self, a, b=None):
 *         t0GEN(a)             # <<<<<<<<<<<<<<
 *         if b is None:
 *             sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6778
 *     def idealhnf(self, a, b=None):
 *         t0GEN(a)
 *         if b is None:             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return self.new_gen(idealhnf(self.g, t0))
 */
    __pyx_t_2 = (__pyx_v_b == Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cypari_src/gen.pyx":6779
 *         t0GEN(a)
 *         if b is None:
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return self.new_gen(idealhnf(self.g, t0))
 *         else:
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":6780
 *         if b is None:
 *             sig_on()
 *             return self.new_gen(idealhnf(self.g, t0))             # <<<<<<<<<<<<<<
 *         else:
 *             t1GEN(b)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealhnf(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":6782
 *             return self.new_gen(idealhnf(self.g, t0))
 *         else:
 *             t1GEN(b)             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return self.new_gen(idealhnf0(self.g, t0, t1))
 */
      __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":6783
 *         else:
 *             t1GEN(b)
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return self.new_gen(idealhnf0(self.g, t0, t1))
 * 
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":6784
 *             t1GEN(b)
 *             sig_on()
 *             return self.new_gen(idealhnf0(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def idealintersection(self, x, y):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealhnf0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":6776
 *         return self.new_gen(idealfactor(self.g, t0))
 * 
 *     def idealhnf(self, a, b=None):             # <<<<<<<<<<<<<<
 *         t0GEN(a)
 *         if b is None:
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealhnf", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6786
 *             return self.new_gen(idealhnf0(self.g, t0, t1))
 * 
 *     def idealintersection(self, x, y):             # <<<<<<<<<<<<<<
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_483idealintersection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_483idealintersection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_y = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealintersection (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
      PyObject* values[2] = {0,0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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("idealintersection", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6786; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealintersection") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6786; __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_x = values[0];
      __pyx_v_y = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealintersection", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6786; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealintersection", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_482idealintersection(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_482idealintersection(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
    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("idealintersection", 0);

    /* "cypari_src/gen.pyx":6787
 * 
 *     def idealintersection(self, x, y):
 *         t0GEN(x); t1GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(idealintersect(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6788
 *     def idealintersection(self, x, y):
 *         t0GEN(x); t1GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(idealintersect(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6789
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 *         return self.new_gen(idealintersect(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def ideallist(self, long bound, long flag = 4):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealintersect(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6786
 *             return self.new_gen(idealhnf0(self.g, t0, t1))
 * 
 *     def idealintersection(self, x, y):             # <<<<<<<<<<<<<<
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealintersection", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6791
 *         return self.new_gen(idealintersect(self.g, t0, t1))
 * 
 *     def ideallist(self, long bound, long flag = 4):             # <<<<<<<<<<<<<<
 *         """
 *         Vector of vectors `L` of all idealstar of all ideals of `norm <= bound`.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_485ideallist(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_484ideallist[] = "\n        Vector of vectors `L` of all idealstar of all ideals of `norm <= bound`.\n        \n        The binary digits of flag mean:\n        \n         - 1: give generators;\n         - 2: add units;\n         - 4: (default) give only the ideals and not the bid.\n        \n        EXAMPLES::\n            \n            >>> K = pari('x^2 + 1').nfinit()\n            >>> L = K.ideallist(100)\n        \n        Now we have our list `L`. Entry `L[n-1]` contains all ideals of\n        norm `n`::\n            \n            >>> L[0]   # One ideal of norm 1.\n            [[1, 0; 0, 1]]\n            >>> L[64]  # 4 ideals of norm 65.\n            [[65, 8; 0, 1], [65, 47; 0, 1], [65, 18; 0, 1], [65, 57; 0, 1]]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_485ideallist(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_bound;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ideallist (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bound,&__pyx_n_s_flag,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_bound)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ideallist") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6791; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_bound = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_bound == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6791; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6791; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)4);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ideallist", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6791; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ideallist", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_484ideallist(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_bound, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_484ideallist(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_bound, long __pyx_v_flag) {
    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("ideallist", 0);

    /* "cypari_src/gen.pyx":6814
 *             [[65, 8; 0, 1], [65, 47; 0, 1], [65, 18; 0, 1], [65, 57; 0, 1]]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(ideallist0(self.g, bound, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6815
 *         """
 *         sig_on()
 *         return self.new_gen(ideallist0(self.g, bound, flag))             # <<<<<<<<<<<<<<
 * 
 *     def ideallog(self, x, bid):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ideallist0(__pyx_v_self->g, __pyx_v_bound, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6791
 *         return self.new_gen(idealintersect(self.g, t0, t1))
 * 
 *     def ideallist(self, long bound, long flag = 4):             # <<<<<<<<<<<<<<
 *         """
 *         Vector of vectors `L` of all idealstar of all ideals of `norm <= bound`.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ideallist", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6817
 *         return self.new_gen(ideallist0(self.g, bound, flag))
 * 
 *     def ideallog(self, x, bid):             # <<<<<<<<<<<<<<
 *         """
 *         Return the discrete logarithm of the unit x in (ring of integers)/bid.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_487ideallog(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_486ideallog[] = "\n        Return the discrete logarithm of the unit x in (ring of integers)/bid.\n\n        INPUT:\n            \n        - ``self`` - a pari number field\n\n        - ``bid``  - a big ideal structure (corresponding to an ideal I\n          of self) output by idealstar\n\n        - ``x``  - an element of self with valuation zero at all\n          primes dividing I\n        \n        OUTPUT:\n            \n        - the discrete logarithm of x on the generators given in bid[2]\n\n        EXAMPLE::\n\n            >>> nf = pari('x^3-2').nfinit()\n            >>> I = pari('[1, -1, 2]~')\n            >>> bid = nf.idealstar(I)\n            >>> x = pari('5')\n            >>> nf.ideallog(x, bid)\n            [25]~\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_487ideallog(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_bid = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ideallog (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_bid,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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bid)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("ideallog", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6817; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ideallog") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6817; __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_x = values[0];
      __pyx_v_bid = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ideallog", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6817; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ideallog", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_486ideallog(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_bid);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_486ideallog(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_bid) {
    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("ideallog", 0);

    /* "cypari_src/gen.pyx":6844
 *             [25]~
 *         """
 *         t0GEN(x); t1GEN(bid)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(ideallog(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_bid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6845
 *         """
 *         t0GEN(x); t1GEN(bid)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(ideallog(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6846
 *         t0GEN(x); t1GEN(bid)
 *         sig_on()
 *         return self.new_gen(ideallog(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def idealmul(self, x, y, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ideallog(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6817
 *         return self.new_gen(ideallist0(self.g, bound, flag))
 * 
 *     def ideallog(self, x, bid):             # <<<<<<<<<<<<<<
 *         """
 *         Return the discrete logarithm of the unit x in (ring of integers)/bid.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ideallog", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6848
 *         return self.new_gen(ideallog(self.g, t0, t1))
 * 
 *     def idealmul(self, x, y, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_489idealmul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_489idealmul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_y = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealmul (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_flag,0};
      PyObject* values[3] = {0,0,0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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("idealmul", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6848; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealmul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6848; __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);
          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_flag = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6848; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealmul", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6848; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealmul", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_488idealmul(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_488idealmul(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, long __pyx_v_flag) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("idealmul", 0);

    /* "cypari_src/gen.pyx":6849
 * 
 *     def idealmul(self, x, y, long flag=0):
 *         t0GEN(x); t1GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         if flag == 0:
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6850
 *     def idealmul(self, x, y, long flag=0):
 *         t0GEN(x); t1GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if flag == 0:
 *             return self.new_gen(idealmul(self.g, t0, t1))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6851
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 *         if flag == 0:             # <<<<<<<<<<<<<<
 *             return self.new_gen(idealmul(self.g, t0, t1))
 *         else:
 */
    __pyx_t_2 = ((__pyx_v_flag == 0) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":6852
 *         sig_on()
 *         if flag == 0:
 *             return self.new_gen(idealmul(self.g, t0, t1))             # <<<<<<<<<<<<<<
 *         else:
 *             return self.new_gen(idealmulred(self.g, t0, t1))
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealmul(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":6854
 *             return self.new_gen(idealmul(self.g, t0, t1))
 *         else:
 *             return self.new_gen(idealmulred(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def idealnorm(self, x):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealmulred(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":6848
 *         return self.new_gen(ideallog(self.g, t0, t1))
 * 
 *     def idealmul(self, x, y, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(x); t1GEN(y)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealmul", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6856
 *             return self.new_gen(idealmulred(self.g, t0, t1))
 * 
 *     def idealnorm(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_491idealnorm(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_491idealnorm(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealnorm (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_490idealnorm(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_490idealnorm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("idealnorm", 0);

    /* "cypari_src/gen.pyx":6857
 * 
 *     def idealnorm(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(idealnorm(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6858
 *     def idealnorm(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(idealnorm(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6859
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(idealnorm(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def idealprimedec(nf, p):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealnorm(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6856
 *             return self.new_gen(idealmulred(self.g, t0, t1))
 * 
 *     def idealnorm(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealnorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6861
 *         return self.new_gen(idealnorm(self.g, t0))
 * 
 *     def idealprimedec(nf, p):             # <<<<<<<<<<<<<<
 *         """
 *         Prime ideal decomposition of the prime number `p` in the number
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_493idealprimedec(PyObject *__pyx_v_nf, PyObject *__pyx_v_p); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_492idealprimedec[] = "\n        Prime ideal decomposition of the prime number `p` in the number\n        field `nf` as a vector of 5 component vectors `[p,a,e,f,b]`\n        representing the prime ideals `p O_K + a O_K`, `e` ,`f` as usual,\n        `a` as vector of components on the integral basis, `b` Lenstra's\n        constant.\n        \n        EXAMPLES::\n            \n            >>> K = pari('x^2+1').nfinit()\n            >>> F = K.idealprimedec(5); F\n            [[5, [-2, 1]~, 1, 1, [2, 1]~], [5, [2, 1]~, 1, 1, [-2, 1]~]]\n            >>> F[0].pr_get_p()\n            5\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_493idealprimedec(PyObject *__pyx_v_nf, PyObject *__pyx_v_p) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealprimedec (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_492idealprimedec(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_nf), ((PyObject *)__pyx_v_p));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_492idealprimedec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nf, PyObject *__pyx_v_p) {
    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("idealprimedec", 0);

    /* "cypari_src/gen.pyx":6877
 *             5
 *         """
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return nf.new_gen(idealprimedec(nf.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6878
 *         """
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return nf.new_gen(idealprimedec(nf.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6879
 *         t0GEN(p)
 *         sig_on()
 *         return nf.new_gen(idealprimedec(nf.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def idealstar(self, I, long flag=1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_nf->__pyx_vtab)->new_gen(__pyx_v_nf, idealprimedec(__pyx_v_nf->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6861
 *         return self.new_gen(idealnorm(self.g, t0))
 * 
 *     def idealprimedec(nf, p):             # <<<<<<<<<<<<<<
 *         """
 *         Prime ideal decomposition of the prime number `p` in the number
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealprimedec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6881
 *         return nf.new_gen(idealprimedec(nf.g, t0))
 * 
 *     def idealstar(self, I, long flag=1):             # <<<<<<<<<<<<<<
 *         """
 *         Return the big ideal (bid) structure of modulus I.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_495idealstar(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_494idealstar[] = "\n        Return the big ideal (bid) structure of modulus I.\n\n        INPUT:\n            \n        - ``self`` - a pari number field\n\n        - ``I`` -- an ideal of self, or a row vector whose first\n          component is an ideal and whose second component \n          is a row vector of r_1 0 or 1. \n           \n        - ``flag`` - determines the amount of computation and the shape\n          of the output:\n          \n          - ``1`` (default): return a bid structure without\n            generators \n                    \n          - ``2``: return a bid structure with generators (slower)\n                    \n          - ``0`` (deprecated): only outputs units of (ring of integers/I)\n            as an abelian group, i.e as a 3-component\n            vector [h,d,g]: h is the order, d is the vector\n            of SNF cyclic components and g the corresponding \n            generators. This flag is deprecated: it is in\n            fact slightly faster to compute a true bid\n            structure, which contains much more information.        \n\n        EXAMPLE::\n\n            >>> nf = pari('x^3-2').nfinit()\n            >>> I = pari('[1, -1, 2]~')\n            >>> nf.idealstar(I)\n            [[[43, 9, 5; 0, 1, 0; 0, 0, 1], [0]], [42, [42]], Mat([[43, [9, 1, 0]~, 1, 1, [-5, -9, 1]~], 1]), [[[[42], [[3, 0, 0]~], [[3, 0, 0]~], [Vecsmall([])], 1]], [[], [], []]], Mat(1)]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_495idealstar(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_I = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealstar (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_flag,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_I)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealstar") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6881; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_I = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6881; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)1);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealstar", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6881; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealstar", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_494idealstar(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_I, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_494idealstar(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_I, long __pyx_v_flag) {
    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("idealstar", 0);

    /* "cypari_src/gen.pyx":6916
 *             [[[43, 9, 5; 0, 1, 0; 0, 0, 1], [0]], [42, [42]], Mat([[43, [9, 1, 0]~, 1, 1, [-5, -9, 1]~], 1]), [[[[42], [[3, 0, 0]~], [[3, 0, 0]~], [Vecsmall([])], 1]], [[], [], []]], Mat(1)]
 *         """
 *         t0GEN(I)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(idealstar0(self.g, t0, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_I); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6917
 *         """
 *         t0GEN(I)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(idealstar0(self.g, t0, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6918
 *         t0GEN(I)
 *         sig_on()
 *         return self.new_gen(idealstar0(self.g, t0, flag))             # <<<<<<<<<<<<<<
 * 
 *     def idealtwoelt(self, x, a=None):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealstar0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6881
 *         return nf.new_gen(idealprimedec(nf.g, t0))
 * 
 *     def idealstar(self, I, long flag=1):             # <<<<<<<<<<<<<<
 *         """
 *         Return the big ideal (bid) structure of modulus I.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealstar", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6920
 *         return self.new_gen(idealstar0(self.g, t0, flag))
 * 
 *     def idealtwoelt(self, x, a=None):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         if a is None:
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_497idealtwoelt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_497idealtwoelt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_a = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealtwoelt (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_a,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)Py_None);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealtwoelt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6920; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_x = values[0];
      __pyx_v_a = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealtwoelt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealtwoelt", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_496idealtwoelt(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_a);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_496idealtwoelt(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_a) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_t_3;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("idealtwoelt", 0);

    /* "cypari_src/gen.pyx":6921
 * 
 *     def idealtwoelt(self, x, a=None):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         if a is None:
 *             sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6922
 *     def idealtwoelt(self, x, a=None):
 *         t0GEN(x)
 *         if a is None:             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return self.new_gen(idealtwoelt0(self.g, t0, NULL))
 */
    __pyx_t_2 = (__pyx_v_a == Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cypari_src/gen.pyx":6923
 *         t0GEN(x)
 *         if a is None:
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return self.new_gen(idealtwoelt0(self.g, t0, NULL))
 *         else:
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":6924
 *         if a is None:
 *             sig_on()
 *             return self.new_gen(idealtwoelt0(self.g, t0, NULL))             # <<<<<<<<<<<<<<
 *         else:
 *             t1GEN(a)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealtwoelt0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, NULL))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":6926
 *             return self.new_gen(idealtwoelt0(self.g, t0, NULL))
 *         else:
 *             t1GEN(a)             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return self.new_gen(idealtwoelt0(self.g, t0, t1))
 */
      __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":6927
 *         else:
 *             t1GEN(a)
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return self.new_gen(idealtwoelt0(self.g, t0, t1))
 * 
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":6928
 *             t1GEN(a)
 *             sig_on()
 *             return self.new_gen(idealtwoelt0(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def idealval(self, x, p):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, idealtwoelt0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":6920
 *         return self.new_gen(idealstar0(self.g, t0, flag))
 * 
 *     def idealtwoelt(self, x, a=None):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         if a is None:
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealtwoelt", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6930
 *             return self.new_gen(idealtwoelt0(self.g, t0, t1))
 * 
 *     def idealval(self, x, p):             # <<<<<<<<<<<<<<
 *         cdef long v
 *         t0GEN(x); t1GEN(p)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_499idealval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_499idealval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_p = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("idealval (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_p,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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("idealval", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6930; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idealval") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6930; __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_x = values[0];
      __pyx_v_p = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("idealval", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6930; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.idealval", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_498idealval(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_p);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_498idealval(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_p) {
    long __pyx_v_v;
    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("idealval", 0);

    /* "cypari_src/gen.pyx":6932
 *     def idealval(self, x, p):
 *         cdef long v
 *         t0GEN(x); t1GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         v = idealval(self.g, t0, t1)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6933
 *         cdef long v
 *         t0GEN(x); t1GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         v = idealval(self.g, t0, t1)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6934
 *         t0GEN(x); t1GEN(p)
 *         sig_on()
 *         v = idealval(self.g, t0, t1)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return v
 */
    __pyx_v_v = idealval(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1);

    /* "cypari_src/gen.pyx":6935
 *         sig_on()
 *         v = idealval(self.g, t0, t1)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return v
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":6936
 *         v = idealval(self.g, t0, t1)
 *         sig_off()
 *         return v             # <<<<<<<<<<<<<<
 * 
 *     def elementval(self, x, p):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_v); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6930
 *             return self.new_gen(idealtwoelt0(self.g, t0, t1))
 * 
 *     def idealval(self, x, p):             # <<<<<<<<<<<<<<
 *         cdef long v
 *         t0GEN(x); t1GEN(p)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.idealval", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6938
 *         return v
 * 
 *     def elementval(self, x, p):             # <<<<<<<<<<<<<<
 *         cdef long v
 *         t0GEN(x); t1GEN(p)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_501elementval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_501elementval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_p = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("elementval (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_p,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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("elementval", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6938; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "elementval") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6938; __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_x = values[0];
      __pyx_v_p = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("elementval", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6938; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.elementval", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_500elementval(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_p);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_500elementval(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_p) {
    long __pyx_v_v;
    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("elementval", 0);

    /* "cypari_src/gen.pyx":6940
 *     def elementval(self, x, p):
 *         cdef long v
 *         t0GEN(x); t1GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         v = nfval(self.g, t0, t1)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6941
 *         cdef long v
 *         t0GEN(x); t1GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         v = nfval(self.g, t0, t1)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6942
 *         t0GEN(x); t1GEN(p)
 *         sig_on()
 *         v = nfval(self.g, t0, t1)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return v
 */
    __pyx_v_v = nfval(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1);

    /* "cypari_src/gen.pyx":6943
 *         sig_on()
 *         v = nfval(self.g, t0, t1)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return v
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":6944
 *         v = nfval(self.g, t0, t1)
 *         sig_off()
 *         return v             # <<<<<<<<<<<<<<
 * 
 *     def modreverse(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_v); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6938
 *         return v
 * 
 *     def elementval(self, x, p):             # <<<<<<<<<<<<<<
 *         cdef long v
 *         t0GEN(x); t1GEN(p)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.elementval", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6946
 *         return v
 * 
 *     def modreverse(self):             # <<<<<<<<<<<<<<
 *         """
 *         modreverse(x): reverse polymod of the polymod x, if it exists.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_503modreverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_502modreverse[] = "\n        modreverse(x): reverse polymod of the polymod x, if it exists.\n        \n        EXAMPLES:\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_503modreverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("modreverse (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_502modreverse(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_502modreverse(struct __pyx_obj_10cypari_src_3gen_gen *__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("modreverse", 0);

    /* "cypari_src/gen.pyx":6952
 *         EXAMPLES:
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(modreverse(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":6953
 *         """
 *         sig_on()
 *         return self.new_gen(modreverse(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def nfbasis(self, long flag=0, fa=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, modreverse(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6946
 *         return v
 * 
 *     def modreverse(self):             # <<<<<<<<<<<<<<
 *         """
 *         modreverse(x): reverse polymod of the polymod x, if it exists.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.modreverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":6955
 *         return self.new_gen(modreverse(self.g))
 * 
 *     def nfbasis(self, long flag=0, fa=0):             # <<<<<<<<<<<<<<
 *         """
 *         nfbasis(x, flag, fa): integral basis of the field QQ[a], where ``a`` is
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_505nfbasis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_504nfbasis[] = "\n        nfbasis(x, flag, fa): integral basis of the field QQ[a], where ``a`` is\n        a root of the polynomial x.\n        \n        Binary digits of ``flag`` mean:\n        \n         - 1: assume that no square of a prime > primelimit divides the\n              discriminant of ``x``.\n         - 2: use round 2 algorithm instead of round 4.\n        \n        If present, ``fa`` provides the matrix of a partial factorization of\n        the discriminant of ``x``, useful if one wants only an order maximal at\n        certain primes only.\n        \n        EXAMPLES::\n        \n            >>> pari('x^3 - 17').nfbasis()\n            [1, x, 1/3*x^2 - 1/3*x + 1/3]\n        \n        We test ``flag`` = 1, noting it gives a wrong result when the\n        discriminant (-4 * `p`^2 * `q` in the example below) has a big square\n        factor::\n        \n            >>> p = pari(10**10).nextprime(); q = (p+1).nextprime()\n            >>> f = pari('x^2') + p**2*q\n            >>> f.nfbasis(1)   # Wrong result\n            [1, x]\n            >>> f.nfbasis()    # Correct result\n            [1, 1/10000000019*x]\n            >>> f.nfbasis(fa = \"[2,2; %s,2]\"%p)    # Correct result and faster\n            [1, 1/10000000019*x]\n        \n        TESTS:\n        \n        ``flag`` = 2 should give the same result::\n            \n            >>> pari('x^3 - 17').nfbasis(flag = 2)\n            [1, x, 1/3*x^2 - 1/3*x + 1/3]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_505nfbasis(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    PyObject *__pyx_v_fa = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfbasis (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_fa,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fa);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nfbasis") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6955; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
      __pyx_v_fa = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("nfbasis", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6955; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.nfbasis", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_504nfbasis(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag, __pyx_v_fa);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_504nfbasis(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, PyObject *__pyx_v_fa) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nfbasis", 0);

    /* "cypari_src/gen.pyx":6996
 *         """
 *         global t0
 *         t0GEN(fa)             # <<<<<<<<<<<<<<
 *         if typ(t0) != t_MAT:
 *             t0 = <GEN>0
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_fa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":6997
 *         global t0
 *         t0GEN(fa)
 *         if typ(t0) != t_MAT:             # <<<<<<<<<<<<<<
 *             t0 = <GEN>0
 *         sig_on()
 */
    __pyx_t_2 = ((typ(__pyx_v_10cypari_src_3gen_t0) != t_MAT) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":6998
 *         t0GEN(fa)
 *         if typ(t0) != t_MAT:
 *             t0 = <GEN>0             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(nfbasis0(self.g, flag, t0))
 */
      __pyx_v_10cypari_src_3gen_t0 = ((GEN)0);
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":6999
 *         if typ(t0) != t_MAT:
 *             t0 = <GEN>0
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(nfbasis0(self.g, flag, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7000
 *             t0 = <GEN>0
 *         sig_on()
 *         return self.new_gen(nfbasis0(self.g, flag, t0))             # <<<<<<<<<<<<<<
 * 
 *     def nfbasis_d(self, long flag=0, fa=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, nfbasis0(__pyx_v_self->g, __pyx_v_flag, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":6955
 *         return self.new_gen(modreverse(self.g))
 * 
 *     def nfbasis(self, long flag=0, fa=0):             # <<<<<<<<<<<<<<
 *         """
 *         nfbasis(x, flag, fa): integral basis of the field QQ[a], where ``a`` is
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfbasis", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7002
 *         return self.new_gen(nfbasis0(self.g, flag, t0))
 * 
 *     def nfbasis_d(self, long flag=0, fa=0):             # <<<<<<<<<<<<<<
 *         """
 *         nfbasis_d(x): Return a basis of the number field defined over QQ
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_507nfbasis_d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_506nfbasis_d[] = "\n        nfbasis_d(x): Return a basis of the number field defined over QQ\n        by x and its discriminant.\n        \n        EXAMPLES::\n        \n            >>> F = pari('x^3-2').nfinit()\n            >>> F[0].nfbasis_d()\n            ([1, x, x^2], -108)\n        \n        ::\n        \n            >>> G = pari('x^5-11').nfinit()\n            >>> G[0].nfbasis_d()\n            ([1, x, x^2, x^3, x^4], 45753125)\n        \n        ::\n        \n            >>> pari([-2,0,0,1]).Polrev().nfbasis_d()\n            ([1, x, x^2], -108)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_507nfbasis_d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    PyObject *__pyx_v_fa = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfbasis_d (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_fa,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fa);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nfbasis_d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7002; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7002; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
      __pyx_v_fa = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("nfbasis_d", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7002; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.nfbasis_d", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_506nfbasis_d(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag, __pyx_v_fa);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_506nfbasis_d(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, PyObject *__pyx_v_fa) {
    GEN __pyx_v_disc;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_B = NULL;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_D = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nfbasis_d", 0);

    /* "cypari_src/gen.pyx":7026
 *         global t0
 *         cdef GEN disc
 *         t0GEN(fa)             # <<<<<<<<<<<<<<
 *         if typ(t0) != t_MAT:
 *             t0 = <GEN>0
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_fa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7027
 *         cdef GEN disc
 *         t0GEN(fa)
 *         if typ(t0) != t_MAT:             # <<<<<<<<<<<<<<
 *             t0 = <GEN>0
 *         sig_on()
 */
    __pyx_t_2 = ((typ(__pyx_v_10cypari_src_3gen_t0) != t_MAT) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":7028
 *         t0GEN(fa)
 *         if typ(t0) != t_MAT:
 *             t0 = <GEN>0             # <<<<<<<<<<<<<<
 *         sig_on()
 *         B = self.new_gen_noclear(nfbasis(self.g, &disc, flag, t0))
 */
      __pyx_v_10cypari_src_3gen_t0 = ((GEN)0);
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":7029
 *         if typ(t0) != t_MAT:
 *             t0 = <GEN>0
 *         sig_on()             # <<<<<<<<<<<<<<
 *         B = self.new_gen_noclear(nfbasis(self.g, &disc, flag, t0))
 *         D = self.new_gen(disc);
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7030
 *             t0 = <GEN>0
 *         sig_on()
 *         B = self.new_gen_noclear(nfbasis(self.g, &disc, flag, t0))             # <<<<<<<<<<<<<<
 *         D = self.new_gen(disc);
 *         return B,D
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen_noclear(__pyx_v_self, nfbasis(__pyx_v_self->g, (&__pyx_v_disc), __pyx_v_flag, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_B = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7031
 *         sig_on()
 *         B = self.new_gen_noclear(nfbasis(self.g, &disc, flag, t0))
 *         D = self.new_gen(disc);             # <<<<<<<<<<<<<<
 *         return B,D
 * 
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, __pyx_v_disc)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_D = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7032
 *         B = self.new_gen_noclear(nfbasis(self.g, &disc, flag, t0))
 *         D = self.new_gen(disc);
 *         return B,D             # <<<<<<<<<<<<<<
 * 
 *     def nfbasistoalg(nf, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_B));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_B));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_B));
    __Pyx_INCREF(((PyObject *)__pyx_v_D));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_D));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_D));
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7002
 *         return self.new_gen(nfbasis0(self.g, flag, t0))
 * 
 *     def nfbasis_d(self, long flag=0, fa=0):             # <<<<<<<<<<<<<<
 *         """
 *         nfbasis_d(x): Return a basis of the number field defined over QQ
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfbasis_d", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_B);
    __Pyx_XDECREF((PyObject *)__pyx_v_D);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7034
 *         return B,D
 * 
 *     def nfbasistoalg(nf, x):             # <<<<<<<<<<<<<<
 *         r"""
 *         Transforms the column vector ``x`` on the integral basis into an
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_509nfbasistoalg(PyObject *__pyx_v_nf, PyObject *__pyx_v_x); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_508nfbasistoalg[] = "\n        Transforms the column vector ``x`` on the integral basis into an\n        algebraic number.\n        \n        INPUT:\n        \n         - ``nf`` -- a number field\n         - ``x`` -- a column of rational numbers of length equal to the\n           degree of ``nf`` or a single rational number\n        \n        OUTPUT:\n        \n         - A POLMOD representing the element of ``nf`` whose coordinates\n           are ``x`` in the Z-basis of ``nf``.\n        \n        EXAMPLES::\n        \n            >>> K = pari('nfinit(x^3 - 17)')\n            >>> K.getattr('zk')\n            [1, 1/3*x^2 - 1/3*x + 1/3, x]\n            >>> K.nfbasistoalg(42)\n            Mod(42, x^3 - 17)\n            >>> K.nfbasistoalg(\"[3/2, -5, 0]~\")\n            Mod(-5/3*x^2 + 5/3*x - 1/6, x^3 - 17)\n            >>> K.getattr('zk') * pari(\"[3/2, -5, 0]~\")\n            -5/3*x^2 + 5/3*x - 1/6\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_509nfbasistoalg(PyObject *__pyx_v_nf, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfbasistoalg (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_508nfbasistoalg(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_nf), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_508nfbasistoalg(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nf, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nfbasistoalg", 0);

    /* "cypari_src/gen.pyx":7062
 *             -5/3*x^2 + 5/3*x - 1/6
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return nf.new_gen(basistoalg(nf.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7063
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return nf.new_gen(basistoalg(nf.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7064
 *         t0GEN(x)
 *         sig_on()
 *         return nf.new_gen(basistoalg(nf.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def nfbasistoalg_lift(nf, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_nf->__pyx_vtab)->new_gen(__pyx_v_nf, basistoalg(__pyx_v_nf->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7034
 *         return B,D
 * 
 *     def nfbasistoalg(nf, x):             # <<<<<<<<<<<<<<
 *         r"""
 *         Transforms the column vector ``x`` on the integral basis into an
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfbasistoalg", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7066
 *         return nf.new_gen(basistoalg(nf.g, t0))
 * 
 *     def nfbasistoalg_lift(nf, x):             # <<<<<<<<<<<<<<
 *         r"""
 *         Transforms the column vector ``x`` on the integral basis into a
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_511nfbasistoalg_lift(PyObject *__pyx_v_nf, PyObject *__pyx_v_x); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_510nfbasistoalg_lift[] = "\n        Transforms the column vector ``x`` on the integral basis into a\n        polynomial representing the algebraic number.\n        \n        INPUT:\n        \n         - ``nf`` -- a number field\n         - ``x`` -- a column of rational numbers of length equal to the\n           degree of ``nf`` or a single rational number\n        \n        OUTPUT:\n        \n         - ``nf.nfbasistoalg(x).lift()``\n        \n        EXAMPLES::\n        \n            >>> K = pari('x^3 - 17').nfinit()\n            >>> K.getattr('zk')\n            [1, 1/3*x^2 - 1/3*x + 1/3, x]\n            >>> K.nfbasistoalg_lift(42)\n            42\n            >>> K.nfbasistoalg_lift(\"[3/2, -5, 0]~\")\n            -5/3*x^2 + 5/3*x - 1/6\n            >>> K.getattr('zk') * pari(\"[3/2, -5, 0]~\")\n            -5/3*x^2 + 5/3*x - 1/6\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_511nfbasistoalg_lift(PyObject *__pyx_v_nf, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfbasistoalg_lift (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_510nfbasistoalg_lift(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_nf), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_510nfbasistoalg_lift(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_nf, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nfbasistoalg_lift", 0);

    /* "cypari_src/gen.pyx":7093
 *             -5/3*x^2 + 5/3*x - 1/6
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return nf.new_gen(gel(basistoalg(nf.g, t0), 2))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7094
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return nf.new_gen(gel(basistoalg(nf.g, t0), 2))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7095
 *         t0GEN(x)
 *         sig_on()
 *         return nf.new_gen(gel(basistoalg(nf.g, t0), 2))             # <<<<<<<<<<<<<<
 * 
 *     def nfdisc(self, long flag=0, p=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_nf->__pyx_vtab)->new_gen(__pyx_v_nf, gel(basistoalg(__pyx_v_nf->g, __pyx_v_10cypari_src_3gen_t0), 2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7066
 *         return nf.new_gen(basistoalg(nf.g, t0))
 * 
 *     def nfbasistoalg_lift(nf, x):             # <<<<<<<<<<<<<<
 *         r"""
 *         Transforms the column vector ``x`` on the integral basis into a
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfbasistoalg_lift", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7097
 *         return nf.new_gen(gel(basistoalg(nf.g, t0), 2))
 * 
 *     def nfdisc(self, long flag=0, p=0):             # <<<<<<<<<<<<<<
 *         """
 *         nfdisc(x): Return the discriminant of the number field defined over
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_513nfdisc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_512nfdisc[] = "\n        nfdisc(x): Return the discriminant of the number field defined over\n        QQ by x.\n        \n        EXAMPLES::\n        \n            >>> F = pari('x^3-2').nfinit()\n            >>> F[0].nfdisc()\n            -108\n        \n        ::\n        \n            >>> G = pari('x^5-11').nfinit()\n            >>> G[0].nfdisc()\n            45753125\n        \n        ::\n        \n            >>> f = pari('x^3-2')\n            >>> f\n            x^3 - 2\n            >>> f.nfdisc()\n            -108\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_513nfdisc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    PyObject *__pyx_v_p = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfdisc (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_p,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nfdisc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7097; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7097; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
      __pyx_v_p = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("nfdisc", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7097; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.nfdisc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_512nfdisc(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag, __pyx_v_p);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_512nfdisc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, PyObject *__pyx_v_p) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v__p = 0;
    GEN __pyx_v_g;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    GEN __pyx_t_3;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nfdisc", 0);

    /* "cypari_src/gen.pyx":7124
 *         cdef gen _p
 *         cdef GEN g
 *         if p != 0:             # <<<<<<<<<<<<<<
 *             _p = self.pari(p)
 *             g = _p.g
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_p, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7124; __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 = 7124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":7125
 *         cdef GEN g
 *         if p != 0:
 *             _p = self.pari(p)             # <<<<<<<<<<<<<<
 *             g = _p.g
 *         else:
 */
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->pari(__pyx_v_self, __pyx_v_p)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v__p = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":7126
 *         if p != 0:
 *             _p = self.pari(p)
 *             g = _p.g             # <<<<<<<<<<<<<<
 *         else:
 *             g = <GEN>NULL
 */
      __pyx_t_3 = __pyx_v__p->g;
      __pyx_v_g = __pyx_t_3;
      goto __pyx_L3;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":7128
 *             g = _p.g
 *         else:
 *             g = <GEN>NULL             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(nfdisc0(self.g, flag, g))
 */
      __pyx_v_g = ((GEN)NULL);
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":7129
 *         else:
 *             g = <GEN>NULL
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(nfdisc0(self.g, flag, g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7130
 *             g = <GEN>NULL
 *         sig_on()
 *         return self.new_gen(nfdisc0(self.g, flag, g))             # <<<<<<<<<<<<<<
 * 
 *     def nfeltreduce(self, x, I):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, nfdisc0(__pyx_v_self->g, __pyx_v_flag, __pyx_v_g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7097
 *         return nf.new_gen(gel(basistoalg(nf.g, t0), 2))
 * 
 *     def nfdisc(self, long flag=0, p=0):             # <<<<<<<<<<<<<<
 *         """
 *         nfdisc(x): Return the discriminant of the number field defined over
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfdisc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v__p);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7132
 *         return self.new_gen(nfdisc0(self.g, flag, g))
 * 
 *     def nfeltreduce(self, x, I):             # <<<<<<<<<<<<<<
 *         """
 *         Given an ideal I in Hermite normal form and an element x of the pari
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_515nfeltreduce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_514nfeltreduce[] = "\n        Given an ideal I in Hermite normal form and an element x of the pari \n        number field self, finds an element r in self such that x-r belongs \n        to the ideal and r is small.\n        \n        EXAMPLES::\n\n            >>> k = pari('x^2 + 5').nfinit()\n            >>> x = pari('x')\n            >>> I = k.idealhnf(x)\n            >>> k.nfeltreduce(12, I)\n            [2, 0]~\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_515nfeltreduce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    PyObject *__pyx_v_I = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfeltreduce (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_I,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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("nfeltreduce", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7132; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nfeltreduce") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7132; __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_x = values[0];
      __pyx_v_I = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("nfeltreduce", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7132; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.nfeltreduce", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_514nfeltreduce(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x, __pyx_v_I);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_514nfeltreduce(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_I) {
    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("nfeltreduce", 0);

    /* "cypari_src/gen.pyx":7146
 *             [2, 0]~
 *         """
 *         t0GEN(x); t1GEN(I)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(nfreduce(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_I); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7147
 *         """
 *         t0GEN(x); t1GEN(I)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(nfreduce(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7148
 *         t0GEN(x); t1GEN(I)
 *         sig_on()
 *         return self.new_gen(nfreduce(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def nffactor(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, nfreduce(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7132
 *         return self.new_gen(nfdisc0(self.g, flag, g))
 * 
 *     def nfeltreduce(self, x, I):             # <<<<<<<<<<<<<<
 *         """
 *         Given an ideal I in Hermite normal form and an element x of the pari
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfeltreduce", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7150
 *         return self.new_gen(nfreduce(self.g, t0, t1))
 * 
 *     def nffactor(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_517nffactor(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_517nffactor(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nffactor (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_516nffactor(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_516nffactor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nffactor", 0);

    /* "cypari_src/gen.pyx":7151
 * 
 *     def nffactor(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(nffactor(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7152
 *     def nffactor(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(nffactor(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7153
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(nffactor(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def nfgenerator(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, nffactor(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7150
 *         return self.new_gen(nfreduce(self.g, t0, t1))
 * 
 *     def nffactor(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nffactor", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7155
 *         return self.new_gen(nffactor(self.g, t0))
 * 
 *     def nfgenerator(self):             # <<<<<<<<<<<<<<
 *         f = self[0]
 *         x = f.variable()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_519nfgenerator(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_519nfgenerator(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfgenerator (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_518nfgenerator(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_518nfgenerator(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    PyObject *__pyx_v_f = NULL;
    PyObject *__pyx_v_x = 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("nfgenerator", 0);

    /* "cypari_src/gen.pyx":7156
 * 
 *     def nfgenerator(self):
 *         f = self[0]             # <<<<<<<<<<<<<<
 *         x = f.variable()
 *         return x.Mod(f)
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7156; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_f = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7157
 *     def nfgenerator(self):
 *         f = self[0]
 *         x = f.variable()             # <<<<<<<<<<<<<<
 *         return x.Mod(f)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_variable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_x = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7158
 *         f = self[0]
 *         x = f.variable()
 *         return x.Mod(f)             # <<<<<<<<<<<<<<
 * 
 *     def nfhilbert(self, a, b, p = None):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_Mod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_f);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_f);
      __Pyx_GIVEREF(__pyx_v_f);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7155
 *         return self.new_gen(nffactor(self.g, t0))
 * 
 *     def nfgenerator(self):             # <<<<<<<<<<<<<<
 *         f = self[0]
 *         x = f.variable()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfgenerator", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_f);
    __Pyx_XDECREF(__pyx_v_x);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7160
 *         return x.Mod(f)
 * 
 *     def nfhilbert(self, a, b, p = None):             # <<<<<<<<<<<<<<
 *         """
 *         nfhilbert(nf,a,b,{p}): if p is omitted, global Hilbert symbol (a,b)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_521nfhilbert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_520nfhilbert[] = "\n        nfhilbert(nf,a,b,{p}): if p is omitted, global Hilbert symbol (a,b)\n        in nf, that is 1 if X^2-aY^2-bZ^2 has a non-trivial solution (X,Y,Z)\n        in nf, -1 otherwise. Otherwise compute the local symbol modulo the\n        prime ideal p.\n\n        EXAMPLES::\n\n            >>> K = pari('x^3 - x + 1').nfinit()\n            >>> x = pari('x')\n            >>> K.nfhilbert(x, x+2)\n            -1\n            >>> P = K.idealprimedec(5)[0] # Primed ideal above 5\n            >>> K.nfhilbert(x, x+2, P)\n            -1\n            >>> P = K.idealprimedec(23)[1] # Prime ideal above 23, ramified\n            >>> K.nfhilbert(x, x+2, P)\n            1\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_521nfhilbert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_a = 0;
    PyObject *__pyx_v_b = 0;
    PyObject *__pyx_v_p = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfhilbert (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_p,0};
      PyObject* values[3] = {0,0,0};
      values[2] = ((PyObject *)Py_None);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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_a)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("nfhilbert", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nfhilbert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7160; __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);
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_a = values[0];
      __pyx_v_b = values[1];
      __pyx_v_p = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("nfhilbert", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7160; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.nfhilbert", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_520nfhilbert(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_a, __pyx_v_b, __pyx_v_p);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_520nfhilbert(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_p) {
    long __pyx_v_r;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nfhilbert", 0);

    /* "cypari_src/gen.pyx":7181
 *         """
 *         cdef long r
 *         t0GEN(a)             # <<<<<<<<<<<<<<
 *         t1GEN(b)
 *         if p:
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7182
 *         cdef long r
 *         t0GEN(a)
 *         t1GEN(b)             # <<<<<<<<<<<<<<
 *         if p:
 *             t2GEN(p)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7183
 *         t0GEN(a)
 *         t1GEN(b)
 *         if p:             # <<<<<<<<<<<<<<
 *             t2GEN(p)
 *             sig_on()
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_p); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":7184
 *         t1GEN(b)
 *         if p:
 *             t2GEN(p)             # <<<<<<<<<<<<<<
 *             sig_on()
 *             r = nfhilbert0(self.g, t0, t1, t2)
 */
      __pyx_t_1 = __pyx_f_10cypari_src_3gen_t2GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":7185
 *         if p:
 *             t2GEN(p)
 *             sig_on()             # <<<<<<<<<<<<<<
 *             r = nfhilbert0(self.g, t0, t1, t2)
 *         else:
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":7186
 *             t2GEN(p)
 *             sig_on()
 *             r = nfhilbert0(self.g, t0, t1, t2)             # <<<<<<<<<<<<<<
 *         else:
 *             sig_on()
 */
      __pyx_v_r = nfhilbert0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, __pyx_v_10cypari_src_3gen_t2);
      goto __pyx_L3;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":7188
 *             r = nfhilbert0(self.g, t0, t1, t2)
 *         else:
 *             sig_on()             # <<<<<<<<<<<<<<
 *             r = nfhilbert(self.g, t0, t1)
 *         P.clear_stack()
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":7189
 *         else:
 *             sig_on()
 *             r = nfhilbert(self.g, t0, t1)             # <<<<<<<<<<<<<<
 *         P.clear_stack()
 *         return r
 */
      __pyx_v_r = nfhilbert(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1);
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":7190
 *             sig_on()
 *             r = nfhilbert(self.g, t0, t1)
 *         P.clear_stack()             # <<<<<<<<<<<<<<
 *         return r
 * 
 */
    ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->clear_stack(__pyx_v_10cypari_src_3gen_P);

    /* "cypari_src/gen.pyx":7191
 *             r = nfhilbert(self.g, t0, t1)
 *         P.clear_stack()
 *         return r             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7160
 *         return x.Mod(f)
 * 
 *     def nfhilbert(self, a, b, p = None):             # <<<<<<<<<<<<<<
 *         """
 *         nfhilbert(nf,a,b,{p}): if p is omitted, global Hilbert symbol (a,b)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfhilbert", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7194
 * 
 * 
 *     def nfinit(self, long flag=0, long precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         nfinit(pol, {flag=0}): ``pol`` being a nonconstant irreducible
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_523nfinit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_522nfinit[] = "\n        nfinit(pol, {flag=0}): ``pol`` being a nonconstant irreducible\n        polynomial, gives a vector containing all the data necessary for PARI\n        to compute in this number field.\n        \n        ``flag`` is optional and can be set to:\n         - 0: default\n         - 1: do not compute different\n         - 2: first use polred to find a simpler polynomial\n         - 3: outputs a two-element vector [nf,Mod(a,P)], where nf is as in 2\n              and Mod(a,P) is a polmod equal to Mod(x,pol) and P=nf.pol\n        \n        EXAMPLES::\n            \n            >>> pari('x^3 - 17').nfinit()\n            [x^3 - 17, [1, 1], -867, 3, [[1, 1.68006..., 2.57128...; 1, -0.340034... + 2.65083...*I, -1.28564... - 2.22679...*I], [1, 1.68006..., 2.57128...; 1, 2.31080..., -3.51243...; 1, -2.99087..., 0.941154...], [1, 2, 3; 1, 2, -4; 1, -3, 1], [3, 1, 0; 1, -11, 17; 0, 17, 0], [51, 0, 16; 0, 17, 3; 0, 0, 1], [17, 0, -1; 0, 0, 3; -1, 3, 2], [51, [-17, 6, -1; 0, -18, 3; 1, 0, -16]]], [2.57128..., -1.28564... - 2.22679...*I], [1, 1/3*x^2 - 1/3*x + 1/3, x], [1, 0, -1; 0, 0, 3; 0, 1, 1], [1, 0, 0, 0, -4, 6, 0, 6, -1; 0, 1, 0, 1, 1, -1, 0, -1, 3; 0, 0, 1, 0, 2, 0, 1, 0, 1]]\n            \n        TESTS:\n        \n        This example only works after increasing precision::\n        \n            >>> pari('x^2 + 10^100 + 1').nfinit(precision=64)\n            Traceback (most recent call last):\n            ...\n            PariError: precision too low (10)\n            >>> pari('x^2 + 10^100 + 1').nfinit()\n            [...]\n\n        Throw a PARI error which is not precer::\n        \n            >>> pari('1.0').nfinit()\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_523nfinit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    long __pyx_v_precision;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfinit (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_precision,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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nfinit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7194; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7194; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
      if (values[1]) {
        __pyx_v_precision = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_precision == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7194; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_precision = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("nfinit", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7194; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.nfinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_522nfinit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_522nfinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, long __pyx_v_precision) {
    PyObject *__pyx_v_err = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    Py_ssize_t __pyx_t_7;
    PyObject *__pyx_t_8 = NULL;
    PyObject *__pyx_t_9 = NULL;
    PyObject *__pyx_t_10 = NULL;
    PyObject *__pyx_t_11 = NULL;
    int __pyx_t_12;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nfinit", 0);

    /* "cypari_src/gen.pyx":7232
 * 
 *         # If explicit precision is given, use only that
 *         if precision:             # <<<<<<<<<<<<<<
 *             return self._nfinit_with_prec(flag, precision)
 * 
 */
    __pyx_t_1 = (__pyx_v_precision != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":7233
 *         # If explicit precision is given, use only that
 *         if precision:
 *             return self._nfinit_with_prec(flag, precision)             # <<<<<<<<<<<<<<
 * 
 *         # Otherwise, start with 64 bits of precision and increase as needed:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nfinit_with_prec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_flag); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_precision); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      }
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":7236
 * 
 *         # Otherwise, start with 64 bits of precision and increase as needed:
 *         precision = 64             # <<<<<<<<<<<<<<
 *         while True:
 *             try:
 */
    __pyx_v_precision = 64;

    /* "cypari_src/gen.pyx":7237
 *         # Otherwise, start with 64 bits of precision and increase as needed:
 *         precision = 64
 *         while True:             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._nfinit_with_prec(flag, precision)
 */
    while (1) {

      /* "cypari_src/gen.pyx":7238
 *         precision = 64
 *         while True:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._nfinit_with_prec(flag, precision)
 *             except PariError, err:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {

          /* "cypari_src/gen.pyx":7239
 *         while True:
 *             try:
 *                 return self._nfinit_with_prec(flag, precision)             # <<<<<<<<<<<<<<
 *             except PariError, err:
 *                 if err.errnum() == precer:
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nfinit_with_prec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7239; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_flag); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7239; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_precision); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7239; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_4 = NULL;
          __pyx_t_7 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
              __pyx_t_7 = 1;
            }
          }
          __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7239; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
          }
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          __pyx_t_8 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7239; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_r = __pyx_t_2;
          __pyx_t_2 = 0;
          goto __pyx_L10_try_return;
        }
        __pyx_L6_error:;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cypari_src/gen.pyx":7240
 *             try:
 *                 return self._nfinit_with_prec(flag, precision)
 *             except PariError, err:             # <<<<<<<<<<<<<<
 *                 if err.errnum() == precer:
 *                     precision *= 2
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PariError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7240; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_12) {
          __Pyx_AddTraceback("cypari_src.gen.gen.nfinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7240; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_XDECREF_SET(__pyx_v_err, __pyx_t_3);

          /* "cypari_src/gen.pyx":7241
 *                 return self._nfinit_with_prec(flag, precision)
 *             except PariError, err:
 *                 if err.errnum() == precer:             # <<<<<<<<<<<<<<
 *                     precision *= 2
 *                 else:
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_err, __pyx_n_s_errnum); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7241; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_4 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
            }
          }
          if (__pyx_t_4) {
            __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7241; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7241; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          }
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyInt_From_int(precer); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7241; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7241; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7241; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_1) {

            /* "cypari_src/gen.pyx":7242
 *             except PariError, err:
 *                 if err.errnum() == precer:
 *                     precision *= 2             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise err
 */
            __pyx_v_precision = (__pyx_v_precision * 2);
            goto __pyx_L16;
          }
          /*else*/ {

            /* "cypari_src/gen.pyx":7244
 *                     precision *= 2
 *                 else:
 *                     raise err             # <<<<<<<<<<<<<<
 *             except:
 *                 print( sys.exc_info() )
 */
            __Pyx_Raise(__pyx_v_err, 0, 0, 0);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7244; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          }
          __pyx_L16:;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L7_exception_handled;
        }

        /* "cypari_src/gen.pyx":7245
 *                 else:
 *                     raise err
 *             except:             # <<<<<<<<<<<<<<
 *                 print( sys.exc_info() )
 * 
 */
        /*except:*/ {
          __Pyx_AddTraceback("cypari_src.gen.gen.nfinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7245; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);

          /* "cypari_src/gen.pyx":7246
 *                     raise err
 *             except:
 *                 print( sys.exc_info() )             # <<<<<<<<<<<<<<
 * 
 *     # NOTE: because of the way sig_on() and Cython exceptions work, this
 */
          __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7246; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7246; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_8)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
            }
          }
          if (__pyx_t_8) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7246; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          } else {
            __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7246; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          }
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7246; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7246; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L7_exception_handled;
        }
        __pyx_L8_except_error:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L10_try_return:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L0;
        __pyx_L7_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }

    /* "cypari_src/gen.pyx":7194
 * 
 * 
 *     def nfinit(self, long flag=0, long precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         nfinit(pol, {flag=0}): ``pol`` being a nonconstant irreducible
 */

    /* function exit code */
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_err);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7251
 *     # function MUST NOT be folded into nfinit() above. It has to be a
 *     # seperate function.
 *     def _nfinit_with_prec(self, long flag, long precision):             # <<<<<<<<<<<<<<
 *         """
 *         See ``self.nfinit()``.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_525_nfinit_with_prec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_524_nfinit_with_prec[] = "\n        See ``self.nfinit()``.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_525_nfinit_with_prec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    long __pyx_v_precision;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("_nfinit_with_prec (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_precision,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_flag)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("_nfinit_with_prec", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_nfinit_with_prec") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7251; __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_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_precision = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_precision == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("_nfinit_with_prec", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen._nfinit_with_prec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_524_nfinit_with_prec(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_524_nfinit_with_prec(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, long __pyx_v_precision) {
    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;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("_nfinit_with_prec", 0);

    /* "cypari_src/gen.pyx":7255
 *         See ``self.nfinit()``.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(nfinit0(self.g, flag, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7256
 *         """
 *         sig_on()
 *         return P.new_gen(nfinit0(self.g, flag, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def nfisisom(self, gen other):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_precision); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, nfinit0(__pyx_v_self->g, __pyx_v_flag, __pyx_t_6))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7251
 *     # function MUST NOT be folded into nfinit() above. It has to be a
 *     # seperate function.
 *     def _nfinit_with_prec(self, long flag, long precision):             # <<<<<<<<<<<<<<
 *         """
 *         See ``self.nfinit()``.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen._nfinit_with_prec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7258
 *         return P.new_gen(nfinit0(self.g, flag, pbw(precision)))
 * 
 *     def nfisisom(self, gen other):             # <<<<<<<<<<<<<<
 *         """
 *         nfisisom(x, y): Determine if the number fields defined by x and y
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_527nfisisom(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_526nfisisom[] = "\n        nfisisom(x, y): Determine if the number fields defined by x and y\n        are isomorphic. According to the PARI documentation, this is much\n        faster if at least one of x or y is a number field. If they are\n        isomorphic, it returns an embedding for the generators. If not,\n        returns 0.\n        \n        EXAMPLES::\n        \n            >>> F = pari('x^3-2').nfinit()\n            >>> G = pari('x^3-2').nfinit()\n            >>> F.nfisisom(G)\n            [x]\n        \n        ::\n        \n            >>> GG = pari('x^3-4').nfinit()\n            >>> F.nfisisom(GG)\n            [1/2*x^2]\n        \n        ::\n        \n            >>> F.nfisisom(GG)\n            [1/2*x^2]\n        \n        ::\n        \n            >>> F.nfisisom(GG[0])\n            [x^2]\n        \n        ::\n        \n            >>> H = pari('x^2-2').nfinit()\n            >>> F.nfisisom(H)\n            0\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_527nfisisom(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
    CYTHON_UNUSED int __pyx_lineno = 0;
    CYTHON_UNUSED const char *__pyx_filename = NULL;
    CYTHON_UNUSED int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfisisom (wrapper)", 0);
    if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10cypari_src_3gen_gen, 1, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_526nfisisom(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_other));

    /* function exit code */
    goto __pyx_L0;
    __pyx_L1_error:;
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_526nfisisom(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_other) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nfisisom", 0);

    /* "cypari_src/gen.pyx":7295
 *             0
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(nfisisom(self.g, other.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7296
 *         """
 *         sig_on()
 *         return P.new_gen(nfisisom(self.g, other.g))             # <<<<<<<<<<<<<<
 * 
 *     def nfrootsof1(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, nfisisom(__pyx_v_self->g, __pyx_v_other->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7258
 *         return P.new_gen(nfinit0(self.g, flag, pbw(precision)))
 * 
 *     def nfisisom(self, gen other):             # <<<<<<<<<<<<<<
 *         """
 *         nfisisom(x, y): Determine if the number fields defined by x and y
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfisisom", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7298
 *         return P.new_gen(nfisisom(self.g, other.g))
 * 
 *     def nfrootsof1(self):             # <<<<<<<<<<<<<<
 *         """
 *         nf.nfrootsof1()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_529nfrootsof1(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_528nfrootsof1[] = "\n        nf.nfrootsof1()\n        \n        number of roots of unity and primitive root of unity in the number\n        field nf.\n        \n        EXAMPLES::\n        \n            >>> nf = pari('x^2 + 1').nfinit()\n            >>> nf.nfrootsof1()\n            [4, -x]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_529nfrootsof1(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfrootsof1 (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_528nfrootsof1(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_528nfrootsof1(struct __pyx_obj_10cypari_src_3gen_gen *__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("nfrootsof1", 0);

    /* "cypari_src/gen.pyx":7311
 *             [4, -x]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(rootsof1(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7312
 *         """
 *         sig_on()
 *         return P.new_gen(rootsof1(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def nfsubfields(self, long d=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, rootsof1(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7298
 *         return P.new_gen(nfisisom(self.g, other.g))
 * 
 *     def nfrootsof1(self):             # <<<<<<<<<<<<<<
 *         """
 *         nf.nfrootsof1()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfrootsof1", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7314
 *         return P.new_gen(rootsof1(self.g))
 * 
 *     def nfsubfields(self, long d=0):             # <<<<<<<<<<<<<<
 *         """
 *         Find all subfields of degree d of number field nf (all subfields if
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_531nfsubfields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_530nfsubfields[] = "\n        Find all subfields of degree d of number field nf (all subfields if\n        d is null or omitted). Result is a vector of subfields, each being\n        given by [g,h], where g is an absolute equation and h expresses one\n        of the roots of g in terms of the root x of the polynomial defining\n        nf.\n        \n        INPUT:\n        \n        \n        -  ``self`` - nf number field\n        \n        -  ``d`` - C long integer\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_531nfsubfields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_d;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfsubfields (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_d);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nfsubfields") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7314; __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;
        }
      }
      if (values[0]) {
        __pyx_v_d = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_d == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_d = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("nfsubfields", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.nfsubfields", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_530nfsubfields(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_d);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_530nfsubfields(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_d) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nfsubfields", 0);

    /* "cypari_src/gen.pyx":7329
 *         -  ``d`` - C long integer
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(nfsubfields(self.g, d))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7330
 *         """
 *         sig_on()
 *         return self.new_gen(nfsubfields(self.g, d))             # <<<<<<<<<<<<<<
 * 
 *     def rnfcharpoly(self, T, a, v='x'):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, nfsubfields(__pyx_v_self->g, __pyx_v_d))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7314
 *         return P.new_gen(rootsof1(self.g))
 * 
 *     def nfsubfields(self, long d=0):             # <<<<<<<<<<<<<<
 *         """
 *         Find all subfields of degree d of number field nf (all subfields if
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfsubfields", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7332
 *         return self.new_gen(nfsubfields(self.g, d))
 * 
 *     def rnfcharpoly(self, T, a, v='x'):             # <<<<<<<<<<<<<<
 *         t0GEN(T); t1GEN(a); t2GEN(v)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_533rnfcharpoly(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_533rnfcharpoly(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_T = 0;
    PyObject *__pyx_v_a = 0;
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfcharpoly (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_T,&__pyx_n_s_a,&__pyx_n_s_v,0};
      PyObject* values[3] = {0,0,0};
      values[2] = ((PyObject *)__pyx_n_s_x);
      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 (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_T)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("rnfcharpoly", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7332; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rnfcharpoly") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7332; __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);
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_T = values[0];
      __pyx_v_a = values[1];
      __pyx_v_v = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("rnfcharpoly", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7332; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfcharpoly", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_532rnfcharpoly(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_T, __pyx_v_a, __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_532rnfcharpoly(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_T, PyObject *__pyx_v_a, PyObject *__pyx_v_v) {
    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("rnfcharpoly", 0);

    /* "cypari_src/gen.pyx":7333
 * 
 *     def rnfcharpoly(self, T, a, v='x'):
 *         t0GEN(T); t1GEN(a); t2GEN(v)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfcharpoly(self.g, t0, t1, gvar(t2)))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t2GEN(__pyx_v_v); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7334
 *     def rnfcharpoly(self, T, a, v='x'):
 *         t0GEN(T); t1GEN(a); t2GEN(v)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfcharpoly(self.g, t0, t1, gvar(t2)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7335
 *         t0GEN(T); t1GEN(a); t2GEN(v)
 *         sig_on()
 *         return self.new_gen(rnfcharpoly(self.g, t0, t1, gvar(t2)))             # <<<<<<<<<<<<<<
 * 
 *     def rnfdisc(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfcharpoly(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, gvar(__pyx_v_10cypari_src_3gen_t2)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7332
 *         return self.new_gen(nfsubfields(self.g, d))
 * 
 *     def rnfcharpoly(self, T, a, v='x'):             # <<<<<<<<<<<<<<
 *         t0GEN(T); t1GEN(a); t2GEN(v)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfcharpoly", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7337
 *         return self.new_gen(rnfcharpoly(self.g, t0, t1, gvar(t2)))
 * 
 *     def rnfdisc(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_535rnfdisc(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_535rnfdisc(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfdisc (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_534rnfdisc(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_534rnfdisc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("rnfdisc", 0);

    /* "cypari_src/gen.pyx":7338
 * 
 *     def rnfdisc(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfdiscf(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7339
 *     def rnfdisc(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfdiscf(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7340
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(rnfdiscf(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def rnfeltabstorel(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfdiscf(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7337
 *         return self.new_gen(rnfcharpoly(self.g, t0, t1, gvar(t2)))
 * 
 *     def rnfdisc(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfdisc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7342
 *         return self.new_gen(rnfdiscf(self.g, t0))
 * 
 *     def rnfeltabstorel(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_537rnfeltabstorel(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_537rnfeltabstorel(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfeltabstorel (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_536rnfeltabstorel(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_536rnfeltabstorel(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("rnfeltabstorel", 0);

    /* "cypari_src/gen.pyx":7343
 * 
 *     def rnfeltabstorel(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfelementabstorel(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7344
 *     def rnfeltabstorel(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfelementabstorel(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7345
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(rnfelementabstorel(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def rnfeltreltoabs(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfelementabstorel(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7342
 *         return self.new_gen(rnfdiscf(self.g, t0))
 * 
 *     def rnfeltabstorel(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfeltabstorel", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7347
 *         return self.new_gen(rnfelementabstorel(self.g, t0))
 * 
 *     def rnfeltreltoabs(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_539rnfeltreltoabs(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_539rnfeltreltoabs(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfeltreltoabs (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_538rnfeltreltoabs(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_538rnfeltreltoabs(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("rnfeltreltoabs", 0);

    /* "cypari_src/gen.pyx":7348
 * 
 *     def rnfeltreltoabs(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfelementreltoabs(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7349
 *     def rnfeltreltoabs(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfelementreltoabs(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7350
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(rnfelementreltoabs(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def rnfequation(self, poly, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfelementreltoabs(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7347
 *         return self.new_gen(rnfelementabstorel(self.g, t0))
 * 
 *     def rnfeltreltoabs(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfeltreltoabs", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7352
 *         return self.new_gen(rnfelementreltoabs(self.g, t0))
 * 
 *     def rnfequation(self, poly, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(poly)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_541rnfequation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_541rnfequation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_poly = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfequation (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_poly,&__pyx_n_s_flag,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_poly)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rnfequation") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7352; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_poly = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("rnfequation", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfequation", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_540rnfequation(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_poly, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_540rnfequation(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_poly, long __pyx_v_flag) {
    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("rnfequation", 0);

    /* "cypari_src/gen.pyx":7353
 * 
 *     def rnfequation(self, poly, long flag=0):
 *         t0GEN(poly)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfequation0(self.g, t0, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_poly); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7354
 *     def rnfequation(self, poly, long flag=0):
 *         t0GEN(poly)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfequation0(self.g, t0, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7355
 *         t0GEN(poly)
 *         sig_on()
 *         return self.new_gen(rnfequation0(self.g, t0, flag))             # <<<<<<<<<<<<<<
 * 
 *     def rnfidealabstorel(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfequation0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7352
 *         return self.new_gen(rnfelementreltoabs(self.g, t0))
 * 
 *     def rnfequation(self, poly, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(poly)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfequation", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7357
 *         return self.new_gen(rnfequation0(self.g, t0, flag))
 * 
 *     def rnfidealabstorel(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_543rnfidealabstorel(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_543rnfidealabstorel(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfidealabstorel (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_542rnfidealabstorel(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_542rnfidealabstorel(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("rnfidealabstorel", 0);

    /* "cypari_src/gen.pyx":7358
 * 
 *     def rnfidealabstorel(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfidealabstorel(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7359
 *     def rnfidealabstorel(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfidealabstorel(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7360
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(rnfidealabstorel(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def rnfidealdown(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfidealabstorel(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7357
 *         return self.new_gen(rnfequation0(self.g, t0, flag))
 * 
 *     def rnfidealabstorel(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfidealabstorel", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7362
 *         return self.new_gen(rnfidealabstorel(self.g, t0))
 * 
 *     def rnfidealdown(self, x):             # <<<<<<<<<<<<<<
 *         r"""
 *         rnfidealdown(rnf,x): finds the intersection of the ideal x with the base field.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_545rnfidealdown(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_544rnfidealdown[] = "\n        rnfidealdown(rnf,x): finds the intersection of the ideal x with the base field.\n\n        EXAMPLES:\n            >>> x = pari('x')\n            >>> y = pari('y')\n            >>> nf = pari(y**2 - 6*y + 24).nfinit()\n            >>> rnf = nf.rnfinit(x**2 - pari(y))\n\n        This is the relative HNF of the inert ideal (2) in rnf:\n\n            >>> P = pari('[[[1, 0]~, [0, 0]~; [0, 0]~, [1, 0]~], [[2, 0; 0, 2], [2, 0; 0, 1/2]]]')\n\n        And this is the HNF of the inert ideal (2) in nf:\n\n            >>> rnf.rnfidealdown(P)\n            [2, 0; 0, 2]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_545rnfidealdown(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfidealdown (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_544rnfidealdown(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_544rnfidealdown(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("rnfidealdown", 0);

    /* "cypari_src/gen.pyx":7381
 *             [2, 0; 0, 2]
 *         """
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfidealdown(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7382
 *         """
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfidealdown(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7383
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(rnfidealdown(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def rnfidealhnf(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfidealdown(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7362
 *         return self.new_gen(rnfidealabstorel(self.g, t0))
 * 
 *     def rnfidealdown(self, x):             # <<<<<<<<<<<<<<
 *         r"""
 *         rnfidealdown(rnf,x): finds the intersection of the ideal x with the base field.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfidealdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7385
 *         return self.new_gen(rnfidealdown(self.g, t0))
 * 
 *     def rnfidealhnf(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_547rnfidealhnf(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_547rnfidealhnf(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfidealhnf (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_546rnfidealhnf(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_546rnfidealhnf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("rnfidealhnf", 0);

    /* "cypari_src/gen.pyx":7386
 * 
 *     def rnfidealhnf(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfidealhermite(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7387
 *     def rnfidealhnf(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfidealhermite(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7388
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(rnfidealhermite(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def rnfidealnormrel(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfidealhermite(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7385
 *         return self.new_gen(rnfidealdown(self.g, t0))
 * 
 *     def rnfidealhnf(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfidealhnf", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7390
 *         return self.new_gen(rnfidealhermite(self.g, t0))
 * 
 *     def rnfidealnormrel(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_549rnfidealnormrel(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_549rnfidealnormrel(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfidealnormrel (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_548rnfidealnormrel(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_548rnfidealnormrel(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("rnfidealnormrel", 0);

    /* "cypari_src/gen.pyx":7391
 * 
 *     def rnfidealnormrel(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfidealnormrel(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7392
 *     def rnfidealnormrel(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfidealnormrel(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7393
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(rnfidealnormrel(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def rnfidealreltoabs(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfidealnormrel(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7390
 *         return self.new_gen(rnfidealhermite(self.g, t0))
 * 
 *     def rnfidealnormrel(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfidealnormrel", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7395
 *         return self.new_gen(rnfidealnormrel(self.g, t0))
 * 
 *     def rnfidealreltoabs(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_551rnfidealreltoabs(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_551rnfidealreltoabs(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfidealreltoabs (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_550rnfidealreltoabs(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_550rnfidealreltoabs(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("rnfidealreltoabs", 0);

    /* "cypari_src/gen.pyx":7396
 * 
 *     def rnfidealreltoabs(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfidealreltoabs(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7397
 *     def rnfidealreltoabs(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfidealreltoabs(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7398
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(rnfidealreltoabs(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def rnfidealtwoelt(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfidealreltoabs(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7395
 *         return self.new_gen(rnfidealnormrel(self.g, t0))
 * 
 *     def rnfidealreltoabs(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfidealreltoabs", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7400
 *         return self.new_gen(rnfidealreltoabs(self.g, t0))
 * 
 *     def rnfidealtwoelt(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_553rnfidealtwoelt(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_553rnfidealtwoelt(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfidealtwoelt (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_552rnfidealtwoelt(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_552rnfidealtwoelt(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("rnfidealtwoelt", 0);

    /* "cypari_src/gen.pyx":7401
 * 
 *     def rnfidealtwoelt(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfidealtwoelement(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7402
 *     def rnfidealtwoelt(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfidealtwoelement(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7403
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(rnfidealtwoelement(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def rnfinit(self, poly):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfidealtwoelement(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7400
 *         return self.new_gen(rnfidealreltoabs(self.g, t0))
 * 
 *     def rnfidealtwoelt(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfidealtwoelt", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7405
 *         return self.new_gen(rnfidealtwoelement(self.g, t0))
 * 
 *     def rnfinit(self, poly):             # <<<<<<<<<<<<<<
 *         """
 *         EXAMPLES: We construct a relative number field.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_555rnfinit(PyObject *__pyx_v_self, PyObject *__pyx_v_poly); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_554rnfinit[] = "\n        EXAMPLES: We construct a relative number field.\n        \n        ::\n        \n            >>> f = pari('y^3+y+1')\n            >>> K = f.nfinit()\n            >>> x = pari('x'); y = pari('y')\n            >>> g = pari('x^5 - x^2 + y')\n            >>> L = K.rnfinit(g)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_555rnfinit(PyObject *__pyx_v_self, PyObject *__pyx_v_poly) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfinit (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_554rnfinit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_poly));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_554rnfinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_poly) {
    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("rnfinit", 0);

    /* "cypari_src/gen.pyx":7417
 *             >>> L = K.rnfinit(g)
 *         """
 *         t0GEN(poly)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(rnfinit(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_poly); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7418
 *         """
 *         t0GEN(poly)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(rnfinit(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7419
 *         t0GEN(poly)
 *         sig_on()
 *         return P.new_gen(rnfinit(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def rnfisfree(self, poly):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, rnfinit(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7405
 *         return self.new_gen(rnfidealtwoelement(self.g, t0))
 * 
 *     def rnfinit(self, poly):             # <<<<<<<<<<<<<<
 *         """
 *         EXAMPLES: We construct a relative number field.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7421
 *         return P.new_gen(rnfinit(self.g, t0))
 * 
 *     def rnfisfree(self, poly):             # <<<<<<<<<<<<<<
 *         t0GEN(poly)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_557rnfisfree(PyObject *__pyx_v_self, PyObject *__pyx_v_poly); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_557rnfisfree(PyObject *__pyx_v_self, PyObject *__pyx_v_poly) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfisfree (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_556rnfisfree(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_poly));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_556rnfisfree(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_poly) {
    long __pyx_v_r;
    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("rnfisfree", 0);

    /* "cypari_src/gen.pyx":7422
 * 
 *     def rnfisfree(self, poly):
 *         t0GEN(poly)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         r = rnfisfree(self.g, t0)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_poly); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7423
 *     def rnfisfree(self, poly):
 *         t0GEN(poly)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         r = rnfisfree(self.g, t0)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7424
 *         t0GEN(poly)
 *         sig_on()
 *         r = rnfisfree(self.g, t0)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return r
 */
    __pyx_v_r = rnfisfree(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0);

    /* "cypari_src/gen.pyx":7425
 *         sig_on()
 *         r = rnfisfree(self.g, t0)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return r
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":7426
 *         r = rnfisfree(self.g, t0)
 *         sig_off()
 *         return r             # <<<<<<<<<<<<<<
 * 
 *     def quadhilbert(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7421
 *         return P.new_gen(rnfinit(self.g, t0))
 * 
 *     def rnfisfree(self, poly):             # <<<<<<<<<<<<<<
 *         t0GEN(poly)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfisfree", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7428
 *         return r
 * 
 *     def quadhilbert(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         Returns a polynomial over `\QQ` whose roots generate the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_559quadhilbert(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_558quadhilbert[] = "\n        Returns a polynomial over `\\QQ` whose roots generate the\n        Hilbert class field of the quadratic field of discriminant\n        ``self`` (which must be fundamental).\n        \n        EXAMPLES::\n            \n            >>> pari(-23).quadhilbert()\n            x^3 - x^2 + 1\n            >>> pari(145).quadhilbert()\n            x^4 - x^3 - 3*x^2 + x + 1\n            >>> pari(-12).quadhilbert()   # Not fundamental\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_559quadhilbert(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("quadhilbert (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_558quadhilbert(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_558quadhilbert(struct __pyx_obj_10cypari_src_3gen_gen *__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("quadhilbert", 0);

    /* "cypari_src/gen.pyx":7445
 *             PariError:  (5)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # Precision argument is only used for real quadratic extensions
 *         # and will be automatically increased by PARI if needed.
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7448
 *         # Precision argument is only used for real quadratic extensions
 *         # and will be automatically increased by PARI if needed.
 *         return P.new_gen(quadhilbert(self.g, DEFAULTPREC))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, quadhilbert(__pyx_v_self->g, DEFAULTPREC))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7428
 *         return r
 * 
 *     def quadhilbert(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         Returns a polynomial over `\QQ` whose roots generate the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.quadhilbert", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7454
 *     # 7: POLYNOMIALS and power series
 *     ##################################################
 *     def reverse(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the polynomial obtained by reversing the coefficients of
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_561reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_560reverse[] = "\n        Return the polynomial obtained by reversing the coefficients of\n        this polynomial.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_561reverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("reverse (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_560reverse(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_560reverse(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("reverse", 0);

    /* "cypari_src/gen.pyx":7459
 *         this polynomial.
 *         """
 *         return self.Vec().Polrev()             # <<<<<<<<<<<<<<
 * 
 *     def content(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Vec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Polrev); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7454
 *     # 7: POLYNOMIALS and power series
 *     ##################################################
 *     def reverse(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the polynomial obtained by reversing the coefficients of
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.reverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7461
 *         return self.Vec().Polrev()
 * 
 *     def content(self):             # <<<<<<<<<<<<<<
 *         """
 *         Greatest common divisor of all the components of ``self``.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_563content(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_562content[] = "\n        Greatest common divisor of all the components of ``self``.\n\n        EXAMPLES::\n\n            >>> pari(\"2*x^2 + 2\").content()\n            2\n            >>> pari(\"4*x^3 - 2*x/3 + 2/5\").content()\n            2/15\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_563content(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("content (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_562content(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_562content(struct __pyx_obj_10cypari_src_3gen_gen *__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("content", 0);

    /* "cypari_src/gen.pyx":7472
 *             2/15
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(content(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7473
 *         """
 *         sig_on()
 *         return self.new_gen(content(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def deriv(self, v=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, content(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7461
 *         return self.Vec().Polrev()
 * 
 *     def content(self):             # <<<<<<<<<<<<<<
 *         """
 *         Greatest common divisor of all the components of ``self``.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.content", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7475
 *         return self.new_gen(content(self.g))
 * 
 *     def deriv(self, v=-1):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(deriv(self.g, self.get_var(v)))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_565deriv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_565deriv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("deriv (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_v);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deriv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7475; __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_v = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("deriv", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7475; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.deriv", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_564deriv(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_564deriv(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v) {
    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("deriv", 0);

    /* "cypari_src/gen.pyx":7476
 * 
 *     def deriv(self, v=-1):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(deriv(self.g, self.get_var(v)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7477
 *     def deriv(self, v=-1):
 *         sig_on()
 *         return self.new_gen(deriv(self.g, self.get_var(v)))             # <<<<<<<<<<<<<<
 * 
 *     def eval(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, deriv(__pyx_v_self->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_v)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7475
 *         return self.new_gen(content(self.g))
 * 
 *     def deriv(self, v=-1):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(deriv(self.g, self.get_var(v)))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.deriv", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7479
 *         return self.new_gen(deriv(self.g, self.get_var(v)))
 * 
 *     def eval(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_567eval(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_567eval(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("eval (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_566eval(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_566eval(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("eval", 0);

    /* "cypari_src/gen.pyx":7480
 * 
 *     def eval(self, x):
 *         t0GEN(x)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(poleval(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7481
 *     def eval(self, x):
 *         t0GEN(x)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(poleval(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7482
 *         t0GEN(x)
 *         sig_on()
 *         return self.new_gen(poleval(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, poleval(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7479
 *         return self.new_gen(deriv(self.g, self.get_var(v)))
 * 
 *     def eval(self, x):             # <<<<<<<<<<<<<<
 *         t0GEN(x)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.eval", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7484
 *         return self.new_gen(poleval(self.g, t0))
 * 
 *     def __call__(self, x):             # <<<<<<<<<<<<<<
 *         return self.eval(x)
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_569__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_569__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_x = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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;
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7484; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
        goto __pyx_L5_argtuple_error;
      } else {
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      }
      __pyx_v_x = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7484; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_568__call__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_x);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_568__call__(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("__call__", 0);

    /* "cypari_src/gen.pyx":7485
 * 
 *     def __call__(self, x):
 *         return self.eval(x)             # <<<<<<<<<<<<<<
 * 
 *     def factornf(self, t):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7484
 *         return self.new_gen(poleval(self.g, t0))
 * 
 *     def __call__(self, x):             # <<<<<<<<<<<<<<
 *         return self.eval(x)
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7487
 *         return self.eval(x)
 * 
 *     def factornf(self, t):             # <<<<<<<<<<<<<<
 *         """
 *         Factorization of the polynomial ``self`` over the number field
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_571factornf(PyObject *__pyx_v_self, PyObject *__pyx_v_t); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_570factornf[] = "\n        Factorization of the polynomial ``self`` over the number field\n        defined by the polynomial ``t``.  This does not require that `t`\n        is integral, nor that the discriminant of the number field can be\n        factored.\n\n        EXAMPLES::\n\n            >>> pari('x^2-2').factornf(pari('a^2 - 1/8'))\n            [x + Mod(-4*a, 8*a^2 - 1), 1; x + Mod(4*a, 8*a^2 - 1), 1]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_571factornf(PyObject *__pyx_v_self, PyObject *__pyx_v_t) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("factornf (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_570factornf(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_t));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_570factornf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_t) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("factornf", 0);

    /* "cypari_src/gen.pyx":7499
 *             [x + Mod(-4*a, 8*a^2 - 1), 1; x + Mod(4*a, 8*a^2 - 1), 1]
 *         """
 *         t0GEN(t)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polfnf(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7500
 *         """
 *         t0GEN(t)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polfnf(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7501
 *         t0GEN(t)
 *         sig_on()
 *         return self.new_gen(polfnf(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def factorpadic(self, p, long r=20, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polfnf(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7487
 *         return self.eval(x)
 * 
 *     def factornf(self, t):             # <<<<<<<<<<<<<<
 *         """
 *         Factorization of the polynomial ``self`` over the number field
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.factornf", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7503
 *         return self.new_gen(polfnf(self.g, t0))
 * 
 *     def factorpadic(self, p, long r=20, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         self.factorpadic(p,r=20,flag=0): p-adic factorization of the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_573factorpadic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_572factorpadic[] = "\n        self.factorpadic(p,r=20,flag=0): p-adic factorization of the\n        polynomial x to precision r. flag is optional and may be set to 0\n        (use round 4) or 1 (use Buchmann-Lenstra)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_573factorpadic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_p = 0;
    long __pyx_v_r;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("factorpadic (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_r,&__pyx_n_s_flag,0};
      PyObject* values[3] = {0,0,0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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_p)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r);
            if (value) { values[1] = value; kw_args--; }
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorpadic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7503; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_p = values[0];
      if (values[1]) {
        __pyx_v_r = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_r == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_r = ((long)20);
      }
      if (values[2]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("factorpadic", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.factorpadic", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_572factorpadic(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_p, __pyx_v_r, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_572factorpadic(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p, long __pyx_v_r, long __pyx_v_flag) {
    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("factorpadic", 0);

    /* "cypari_src/gen.pyx":7509
 *         (use round 4) or 1 (use Buchmann-Lenstra)
 *         """
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(factorpadic0(self.g, t0, r, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7510
 *         """
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(factorpadic0(self.g, t0, r, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7511
 *         t0GEN(p)
 *         sig_on()
 *         return self.new_gen(factorpadic0(self.g, t0, r, flag))             # <<<<<<<<<<<<<<
 * 
 *     def factormod(self, p, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, factorpadic0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_r, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7503
 *         return self.new_gen(polfnf(self.g, t0))
 * 
 *     def factorpadic(self, p, long r=20, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         self.factorpadic(p,r=20,flag=0): p-adic factorization of the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.factorpadic", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7513
 *         return self.new_gen(factorpadic0(self.g, t0, r, flag))
 * 
 *     def factormod(self, p, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.factormod(p,flag=0): factorization mod p of the polynomial x
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_575factormod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_574factormod[] = "\n        x.factormod(p,flag=0): factorization mod p of the polynomial x\n        using Berlekamp. flag is optional, and can be 0: default or 1:\n        simple factormod, same except that only the degrees of the\n        irreducible factors are given.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_575factormod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_p = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("factormod (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_flag,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_p)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factormod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7513; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_p = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("factormod", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.factormod", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_574factormod(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_p, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_574factormod(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p, long __pyx_v_flag) {
    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("factormod", 0);

    /* "cypari_src/gen.pyx":7520
 *         irreducible factors are given.
 *         """
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(factormod0(self.g, t0, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7521
 *         """
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(factormod0(self.g, t0, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7522
 *         t0GEN(p)
 *         sig_on()
 *         return self.new_gen(factormod0(self.g, t0, flag))             # <<<<<<<<<<<<<<
 * 
 *     def intformal(self, y=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, factormod0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7513
 *         return self.new_gen(factorpadic0(self.g, t0, r, flag))
 * 
 *     def factormod(self, p, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.factormod(p,flag=0): factorization mod p of the polynomial x
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.factormod", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7524
 *         return self.new_gen(factormod0(self.g, t0, flag))
 * 
 *     def intformal(self, y=-1):             # <<<<<<<<<<<<<<
 *         """
 *         x.intformal(y): formal integration of x with respect to the main
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_577intformal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_576intformal[] = "\n        x.intformal(y): formal integration of x with respect to the main\n        variable of y, or to the main variable of x if y is omitted\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_577intformal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_y = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("intformal (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_y);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intformal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7524; __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_y = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("intformal", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7524; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.intformal", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_576intformal(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_y);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_576intformal(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y) {
    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("intformal", 0);

    /* "cypari_src/gen.pyx":7529
 *         variable of y, or to the main variable of x if y is omitted
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(integ(self.g, self.get_var(y)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7530
 *         """
 *         sig_on()
 *         return self.new_gen(integ(self.g, self.get_var(y)))             # <<<<<<<<<<<<<<
 * 
 *     def padicappr(self, a):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, integ(__pyx_v_self->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_y)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7524
 *         return self.new_gen(factormod0(self.g, t0, flag))
 * 
 *     def intformal(self, y=-1):             # <<<<<<<<<<<<<<
 *         """
 *         x.intformal(y): formal integration of x with respect to the main
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.intformal", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7532
 *         return self.new_gen(integ(self.g, self.get_var(y)))
 * 
 *     def padicappr(self, a):             # <<<<<<<<<<<<<<
 *         """
 *         x.padicappr(a): p-adic roots of the polynomial x congruent to a mod
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_579padicappr(PyObject *__pyx_v_self, PyObject *__pyx_v_a); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_578padicappr[] = "\n        x.padicappr(a): p-adic roots of the polynomial x congruent to a mod\n        p\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_579padicappr(PyObject *__pyx_v_self, PyObject *__pyx_v_a) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("padicappr (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_578padicappr(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_a));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_578padicappr(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_a) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("padicappr", 0);

    /* "cypari_src/gen.pyx":7537
 *         p
 *         """
 *         t0GEN(a)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(padicappr(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7538
 *         """
 *         t0GEN(a)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(padicappr(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7539
 *         t0GEN(a)
 *         sig_on()
 *         return self.new_gen(padicappr(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def newtonpoly(self, p):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, padicappr(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7532
 *         return self.new_gen(integ(self.g, self.get_var(y)))
 * 
 *     def padicappr(self, a):             # <<<<<<<<<<<<<<
 *         """
 *         x.padicappr(a): p-adic roots of the polynomial x congruent to a mod
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.padicappr", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7541
 *         return self.new_gen(padicappr(self.g, t0))
 * 
 *     def newtonpoly(self, p):             # <<<<<<<<<<<<<<
 *         """
 *         x.newtonpoly(p): Newton polygon of polynomial x with respect to the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_581newtonpoly(PyObject *__pyx_v_self, PyObject *__pyx_v_p); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_580newtonpoly[] = "\n        x.newtonpoly(p): Newton polygon of polynomial x with respect to the\n        prime p.\n        \n        EXAMPLES::\n        \n            >>> x = pari('y^8+6*y^6-27*y^5+1/9*y^2-y+1')\n            >>> x.newtonpoly(3)\n            [1, 1, -1/3, -1/3, -1/3, -1/3, -1/3, -1/3]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_581newtonpoly(PyObject *__pyx_v_self, PyObject *__pyx_v_p) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("newtonpoly (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_580newtonpoly(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_p));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_580newtonpoly(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p) {
    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("newtonpoly", 0);

    /* "cypari_src/gen.pyx":7552
 *             [1, 1, -1/3, -1/3, -1/3, -1/3, -1/3, -1/3]
 *         """
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(newtonpoly(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7553
 *         """
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(newtonpoly(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7554
 *         t0GEN(p)
 *         sig_on()
 *         return self.new_gen(newtonpoly(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def polcoeff(self, long n, var=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, newtonpoly(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7541
 *         return self.new_gen(padicappr(self.g, t0))
 * 
 *     def newtonpoly(self, p):             # <<<<<<<<<<<<<<
 *         """
 *         x.newtonpoly(p): Newton polygon of polynomial x with respect to the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.newtonpoly", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7556
 *         return self.new_gen(newtonpoly(self.g, t0))
 * 
 *     def polcoeff(self, long n, var=-1):             # <<<<<<<<<<<<<<
 *         """
 *         EXAMPLES::
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_583polcoeff(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_582polcoeff[] = "\n        EXAMPLES::\n        \n            >>> f = pari(\"x^2 + y^3 + x*y\")\n            >>> f\n            x^2 + y*x + y^3\n            >>> f.polcoeff(1)\n            y\n            >>> f.polcoeff(3)\n            0\n            >>> f.polcoeff(3, \"y\")\n            1\n            >>> f.polcoeff(1, \"y\")\n            x\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_583polcoeff(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    PyObject *__pyx_v_var = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polcoeff (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_var,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_n)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polcoeff") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7556; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7556; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_var = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polcoeff", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7556; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polcoeff", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_582polcoeff(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_n, __pyx_v_var);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_582polcoeff(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_var) {
    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("polcoeff", 0);

    /* "cypari_src/gen.pyx":7572
 *             x
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polcoeff0(self.g, n, self.get_var(var)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7573
 *         """
 *         sig_on()
 *         return self.new_gen(polcoeff0(self.g, n, self.get_var(var)))             # <<<<<<<<<<<<<<
 * 
 *     def polcompositum(self, pol2, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polcoeff0(__pyx_v_self->g, __pyx_v_n, ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_var)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7556
 *         return self.new_gen(newtonpoly(self.g, t0))
 * 
 *     def polcoeff(self, long n, var=-1):             # <<<<<<<<<<<<<<
 *         """
 *         EXAMPLES::
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polcoeff", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7575
 *         return self.new_gen(polcoeff0(self.g, n, self.get_var(var)))
 * 
 *     def polcompositum(self, pol2, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(pol2)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_585polcompositum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_585polcompositum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_pol2 = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polcompositum (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pol2,&__pyx_n_s_flag,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_pol2)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polcompositum") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7575; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_pol2 = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7575; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polcompositum", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7575; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polcompositum", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_584polcompositum(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_pol2, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_584polcompositum(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_pol2, long __pyx_v_flag) {
    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("polcompositum", 0);

    /* "cypari_src/gen.pyx":7576
 * 
 *     def polcompositum(self, pol2, long flag=0):
 *         t0GEN(pol2)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polcompositum0(self.g, t0, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_pol2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7577
 *     def polcompositum(self, pol2, long flag=0):
 *         t0GEN(pol2)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polcompositum0(self.g, t0, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7578
 *         t0GEN(pol2)
 *         sig_on()
 *         return self.new_gen(polcompositum0(self.g, t0, flag))             # <<<<<<<<<<<<<<
 * 
 *     def poldegree(self, var=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polcompositum0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7575
 *         return self.new_gen(polcoeff0(self.g, n, self.get_var(var)))
 * 
 *     def polcompositum(self, pol2, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(pol2)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polcompositum", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7580
 *         return self.new_gen(polcompositum0(self.g, t0, flag))
 * 
 *     def poldegree(self, var=-1):             # <<<<<<<<<<<<<<
 *         """
 *         f.poldegree(var=x): Return the degree of this polynomial.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_587poldegree(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_586poldegree[] = "\n        f.poldegree(var=x): Return the degree of this polynomial.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_587poldegree(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_var = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("poldegree (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_var,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "poldegree") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7580; __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_var = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("poldegree", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.poldegree", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_586poldegree(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_var);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_586poldegree(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_var) {
    long __pyx_v_n;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("poldegree", 0);

    /* "cypari_src/gen.pyx":7584
 *         f.poldegree(var=x): Return the degree of this polynomial.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         n = poldegree(self.g, self.get_var(var))
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7585
 *         """
 *         sig_on()
 *         n = poldegree(self.g, self.get_var(var))             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return n
 */
    __pyx_v_n = poldegree(__pyx_v_self->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_var));

    /* "cypari_src/gen.pyx":7586
 *         sig_on()
 *         n = poldegree(self.g, self.get_var(var))
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return n
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":7587
 *         n = poldegree(self.g, self.get_var(var))
 *         sig_off()
 *         return n             # <<<<<<<<<<<<<<
 * 
 *     def poldisc(self, var=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7580
 *         return self.new_gen(polcompositum0(self.g, t0, flag))
 * 
 *     def poldegree(self, var=-1):             # <<<<<<<<<<<<<<
 *         """
 *         f.poldegree(var=x): Return the degree of this polynomial.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.poldegree", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7589
 *         return n
 * 
 *     def poldisc(self, var=-1):             # <<<<<<<<<<<<<<
 *         """
 *         f.poldist(var=x): Return the discriminant of this polynomial.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_589poldisc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_588poldisc[] = "\n        f.poldist(var=x): Return the discriminant of this polynomial.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_589poldisc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_var = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("poldisc (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_var,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "poldisc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7589; __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_var = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("poldisc", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7589; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.poldisc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_588poldisc(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_var);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_588poldisc(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_var) {
    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("poldisc", 0);

    /* "cypari_src/gen.pyx":7593
 *         f.poldist(var=x): Return the discriminant of this polynomial.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(poldisc0(self.g, self.get_var(var)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7594
 *         """
 *         sig_on()
 *         return self.new_gen(poldisc0(self.g, self.get_var(var)))             # <<<<<<<<<<<<<<
 * 
 *     def poldiscreduced(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, poldisc0(__pyx_v_self->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_var)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7589
 *         return n
 * 
 *     def poldisc(self, var=-1):             # <<<<<<<<<<<<<<
 *         """
 *         f.poldist(var=x): Return the discriminant of this polynomial.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.poldisc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7596
 *         return self.new_gen(poldisc0(self.g, self.get_var(var)))
 * 
 *     def poldiscreduced(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(reduceddiscsmith(self.g))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_591poldiscreduced(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_591poldiscreduced(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("poldiscreduced (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_590poldiscreduced(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_590poldiscreduced(struct __pyx_obj_10cypari_src_3gen_gen *__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("poldiscreduced", 0);

    /* "cypari_src/gen.pyx":7597
 * 
 *     def poldiscreduced(self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(reduceddiscsmith(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7598
 *     def poldiscreduced(self):
 *         sig_on()
 *         return self.new_gen(reduceddiscsmith(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def polgalois(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, reduceddiscsmith(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7596
 *         return self.new_gen(poldisc0(self.g, self.get_var(var)))
 * 
 *     def poldiscreduced(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(reduceddiscsmith(self.g))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.poldiscreduced", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7600
 *         return self.new_gen(reduceddiscsmith(self.g))
 * 
 *     def polgalois(self):             # <<<<<<<<<<<<<<
 *         """
 *         f.polgalois(): Galois group of the polynomial f
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_593polgalois(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_592polgalois[] = "\n        f.polgalois(): Galois group of the polynomial f\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_593polgalois(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polgalois (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_592polgalois(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_592polgalois(struct __pyx_obj_10cypari_src_3gen_gen *__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("polgalois", 0);

    /* "cypari_src/gen.pyx":7604
 *         f.polgalois(): Galois group of the polynomial f
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polgalois(self.g, prec))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7605
 *         """
 *         sig_on()
 *         return self.new_gen(polgalois(self.g, prec))             # <<<<<<<<<<<<<<
 * 
 *     def nfgaloisconj(self, long flag=0, denom=None, long precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polgalois(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7600
 *         return self.new_gen(reduceddiscsmith(self.g))
 * 
 *     def polgalois(self):             # <<<<<<<<<<<<<<
 *         """
 *         f.polgalois(): Galois group of the polynomial f
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polgalois", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7607
 *         return self.new_gen(polgalois(self.g, prec))
 * 
 *     def nfgaloisconj(self, long flag=0, denom=None, long precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Edited from the pari documentation:
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_595nfgaloisconj(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_594nfgaloisconj[] = "\n        Edited from the pari documentation:\n\n        nfgaloisconj(nf): list of conjugates of a root of the\n        polynomial x=nf.pol in the same number field.\n\n        Uses a combination of Allombert's algorithm and nfroots.\n\n        EXAMPLES::\n\n            >>> nf = pari('x^2 + 2').nfinit()\n            >>> nf.nfgaloisconj()\n            [-x, x]~\n            >>> nf = pari('x^3 + 2').nfinit()\n            >>> nf.nfgaloisconj()\n            [x]~\n            >>> nf = pari('x^4 + 2').nfinit()\n            >>> nf.nfgaloisconj()\n            [-x, x]~\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_595nfgaloisconj(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    PyObject *__pyx_v_denom = 0;
    long __pyx_v_precision;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfgaloisconj (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_denom,&__pyx_n_s_precision,0};
      PyObject* values[3] = {0,0,0};
      values[1] = ((PyObject *)Py_None);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_denom);
            if (value) { values[1] = value; kw_args--; }
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nfgaloisconj") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7607; __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_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7607; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
      __pyx_v_denom = values[1];
      if (values[2]) {
        __pyx_v_precision = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_precision == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7607; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_precision = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("nfgaloisconj", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7607; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.nfgaloisconj", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_594nfgaloisconj(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag, __pyx_v_denom, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_594nfgaloisconj(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag, PyObject *__pyx_v_denom, long __pyx_v_precision) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *__pyx_t_7 = NULL;
    long __pyx_t_8;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nfgaloisconj", 0);

    /* "cypari_src/gen.pyx":7629
 *         """
 *         global t0
 *         if denom is not None:             # <<<<<<<<<<<<<<
 *             t0GEN(denom)
 *         else:
 */
    __pyx_t_1 = (__pyx_v_denom != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":7630
 *         global t0
 *         if denom is not None:
 *             t0GEN(denom)             # <<<<<<<<<<<<<<
 *         else:
 *             t0 = NULL
 */
      __pyx_t_3 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_denom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L3;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":7632
 *             t0GEN(denom)
 *         else:
 *             t0 = NULL             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(galoisconj0(self.g, flag, t0, pbw(precision)))
 */
      __pyx_v_10cypari_src_3gen_t0 = NULL;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":7633
 *         else:
 *             t0 = NULL
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(galoisconj0(self.g, flag, t0, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7634
 *             t0 = NULL
 *         sig_on()
 *         return self.new_gen(galoisconj0(self.g, flag, t0, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def nfroots(self, poly):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_precision); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, galoisconj0(__pyx_v_self->g, __pyx_v_flag, __pyx_v_10cypari_src_3gen_t0, __pyx_t_8))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7607
 *         return self.new_gen(polgalois(self.g, prec))
 * 
 *     def nfgaloisconj(self, long flag=0, denom=None, long precision=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         Edited from the pari documentation:
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfgaloisconj", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7636
 *         return self.new_gen(galoisconj0(self.g, flag, t0, pbw(precision)))
 * 
 *     def nfroots(self, poly):             # <<<<<<<<<<<<<<
 *         r"""
 *         Return the roots of `poly` in the number field self without
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_597nfroots(PyObject *__pyx_v_self, PyObject *__pyx_v_poly); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_596nfroots[] = "\n        Return the roots of `poly` in the number field self without\n        multiplicity. \n\n        EXAMPLES::\n\n            >>> y = pari('y'); x = pari('x')\n            >>> nf = pari('y^2 + 2').nfinit()\n            >>> nf.nfroots(x**2 + 2)\n            [Mod(-y, y^2 + 2), Mod(y, y^2 + 2)]\n            >>> nf = pari(y**3 + 2).nfinit()\n            >>> nf.nfroots(x**3 + 2)\n            [Mod(y, y^3 + 2)]\n            >>> nf = pari('y^4 + 2').nfinit()\n            >>> nf.nfroots(x**4 + 2)\n            [Mod(-y, y^4 + 2), Mod(y, y^4 + 2)]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_597nfroots(PyObject *__pyx_v_self, PyObject *__pyx_v_poly) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nfroots (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_596nfroots(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_poly));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_596nfroots(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_poly) {
    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("nfroots", 0);

    /* "cypari_src/gen.pyx":7654
 *             [Mod(-y, y^4 + 2), Mod(y, y^4 + 2)]
 *         """
 *         t0GEN(poly)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(nfroots(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_poly); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7655
 *         """
 *         t0GEN(poly)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(nfroots(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7656
 *         t0GEN(poly)
 *         sig_on()
 *         return self.new_gen(nfroots(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def polhensellift(self, y, p, long e):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, nfroots(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7636
 *         return self.new_gen(galoisconj0(self.g, flag, t0, pbw(precision)))
 * 
 *     def nfroots(self, poly):             # <<<<<<<<<<<<<<
 *         r"""
 *         Return the roots of `poly` in the number field self without
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.nfroots", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7658
 *         return self.new_gen(nfroots(self.g, t0))
 * 
 *     def polhensellift(self, y, p, long e):             # <<<<<<<<<<<<<<
 *         """
 *         self.polhensellift(y, p, e): lift the factorization y of self
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_599polhensellift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_598polhensellift[] = "\n        self.polhensellift(y, p, e): lift the factorization y of self\n        modulo p to a factorization modulo `p^e` using Hensel lift.\n        The factors in y must be pairwise relatively prime modulo p.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_599polhensellift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_y = 0;
    PyObject *__pyx_v_p = 0;
    long __pyx_v_e;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polhensellift (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_p,&__pyx_n_s_e,0};
      PyObject* values[3] = {0,0,0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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_y)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("polhensellift", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7658; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          case  2:
          if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("polhensellift", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7658; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polhensellift") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7658; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
        goto __pyx_L5_argtuple_error;
      } else {
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      }
      __pyx_v_y = values[0];
      __pyx_v_p = values[1];
      __pyx_v_e = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_e == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7658; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polhensellift", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7658; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polhensellift", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_598polhensellift(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_y, __pyx_v_p, __pyx_v_e);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_598polhensellift(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y, PyObject *__pyx_v_p, long __pyx_v_e) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polhensellift", 0);

    /* "cypari_src/gen.pyx":7664
 *         The factors in y must be pairwise relatively prime modulo p.
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         t1GEN(p)
 *         sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7665
 *         """
 *         t0GEN(y)
 *         t1GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polhensellift(self.g, t0, t1, e))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7666
 *         t0GEN(y)
 *         t1GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polhensellift(self.g, t0, t1, e))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7667
 *         t1GEN(p)
 *         sig_on()
 *         return self.new_gen(polhensellift(self.g, t0, t1, e))             # <<<<<<<<<<<<<<
 * 
 *     def polisirreducible(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polhensellift(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, __pyx_v_e))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7658
 *         return self.new_gen(nfroots(self.g, t0))
 * 
 *     def polhensellift(self, y, p, long e):             # <<<<<<<<<<<<<<
 *         """
 *         self.polhensellift(y, p, e): lift the factorization y of self
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polhensellift", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7669
 *         return self.new_gen(polhensellift(self.g, t0, t1, e))
 * 
 *     def polisirreducible(self):             # <<<<<<<<<<<<<<
 *         """
 *         f.polisirreducible(): Returns True if f is an irreducible
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_601polisirreducible(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_600polisirreducible[] = "\n        f.polisirreducible(): Returns True if f is an irreducible\n        non-constant polynomial, or False if f is reducible or constant.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_601polisirreducible(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polisirreducible (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_600polisirreducible(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_600polisirreducible(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polisirreducible", 0);

    /* "cypari_src/gen.pyx":7674
 *         non-constant polynomial, or False if f is reducible or constant.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return bool(self.new_gen(gisirreducible(self.g)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7675
 *         """
 *         sig_on()
 *         return bool(self.new_gen(gisirreducible(self.g)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, gisirreducible(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7669
 *         return self.new_gen(polhensellift(self.g, t0, t1, e))
 * 
 *     def polisirreducible(self):             # <<<<<<<<<<<<<<
 *         """
 *         f.polisirreducible(): Returns True if f is an irreducible
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polisirreducible", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7678
 * 
 * 
 *     def pollead(self, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         self.pollead(v): leading coefficient of polynomial or series self,
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_603pollead(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_602pollead[] = "\n        self.pollead(v): leading coefficient of polynomial or series self,\n        or self itself if self is a scalar. Error otherwise. With respect\n        to the main variable of self if v is omitted, with respect to the\n        variable v otherwise\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_603pollead(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("pollead (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_v);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pollead") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7678; __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_v = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("pollead", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7678; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.pollead", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_602pollead(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_602pollead(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v) {
    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("pollead", 0);

    /* "cypari_src/gen.pyx":7685
 *         variable v otherwise
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(pollead(self.g, self.get_var(v)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7686
 *         """
 *         sig_on()
 *         return self.new_gen(pollead(self.g, self.get_var(v)))             # <<<<<<<<<<<<<<
 * 
 *     def polrecip(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, pollead(__pyx_v_self->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_v)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7678
 * 
 * 
 *     def pollead(self, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         self.pollead(v): leading coefficient of polynomial or series self,
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.pollead", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7688
 *         return self.new_gen(pollead(self.g, self.get_var(v)))
 * 
 *     def polrecip(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polrecip(self.g))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_605polrecip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_605polrecip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polrecip (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_604polrecip(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_604polrecip(struct __pyx_obj_10cypari_src_3gen_gen *__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("polrecip", 0);

    /* "cypari_src/gen.pyx":7689
 * 
 *     def polrecip(self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polrecip(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7690
 *     def polrecip(self):
 *         sig_on()
 *         return self.new_gen(polrecip(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def polred(self, flag=0, fa=None):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polrecip(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7688
 *         return self.new_gen(pollead(self.g, self.get_var(v)))
 * 
 *     def polrecip(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polrecip(self.g))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polrecip", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7692
 *         return self.new_gen(polrecip(self.g))
 * 
 *     def polred(self, flag=0, fa=None):             # <<<<<<<<<<<<<<
 *         if fa is None:
 *             sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_607polred(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_607polred(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    PyObject *__pyx_v_fa = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polred (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_fa,0};
      PyObject* values[2] = {0,0};
      values[0] = ((PyObject *)__pyx_int_0);
      values[1] = ((PyObject *)Py_None);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fa);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polred") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7692; __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_flag = values[0];
      __pyx_v_fa = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polred", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7692; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polred", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_606polred(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag, __pyx_v_fa);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_606polred(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_fa) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    long __pyx_t_3;
    PyObject *__pyx_t_4 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polred", 0);

    /* "cypari_src/gen.pyx":7693
 * 
 *     def polred(self, flag=0, fa=None):
 *         if fa is None:             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return self.new_gen(polred0(self.g, flag, NULL))
 */
    __pyx_t_1 = (__pyx_v_fa == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":7694
 *     def polred(self, flag=0, fa=None):
 *         if fa is None:
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return self.new_gen(polred0(self.g, flag, NULL))
 *         else:
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":7695
 *         if fa is None:
 *             sig_on()
 *             return self.new_gen(polred0(self.g, flag, NULL))             # <<<<<<<<<<<<<<
 *         else:
 *             t0GEN(fa)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polred0(__pyx_v_self->g, __pyx_t_3, NULL))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":7697
 *             return self.new_gen(polred0(self.g, flag, NULL))
 *         else:
 *             t0GEN(fa)             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return self.new_gen(polred0(self.g, flag, t0))
 */
      __pyx_t_4 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_fa); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cypari_src/gen.pyx":7698
 *         else:
 *             t0GEN(fa)
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return self.new_gen(polred0(self.g, flag, t0))
 * 
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":7699
 *             t0GEN(fa)
 *             sig_on()
 *             return self.new_gen(polred0(self.g, flag, t0))             # <<<<<<<<<<<<<<
 * 
 *     def polredabs(self, flag=0):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polred0(__pyx_v_self->g, __pyx_t_3, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":7692
 *         return self.new_gen(polrecip(self.g))
 * 
 *     def polred(self, flag=0, fa=None):             # <<<<<<<<<<<<<<
 *         if fa is None:
 *             sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.polred", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7701
 *             return self.new_gen(polred0(self.g, flag, t0))
 * 
 *     def polredabs(self, flag=0):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polredabs0(self.g, flag))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_609polredabs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_609polredabs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polredabs (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polredabs") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7701; __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_flag = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polredabs", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7701; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polredabs", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_608polredabs(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_608polredabs(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag) {
    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("polredabs", 0);

    /* "cypari_src/gen.pyx":7702
 * 
 *     def polredabs(self, flag=0):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polredabs0(self.g, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7703
 *     def polredabs(self, flag=0):
 *         sig_on()
 *         return self.new_gen(polredabs0(self.g, flag))             # <<<<<<<<<<<<<<
 * 
 *     def polresultant(self, y, var=-1, flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polredabs0(__pyx_v_self->g, __pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7701
 *             return self.new_gen(polred0(self.g, flag, t0))
 * 
 *     def polredabs(self, flag=0):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polredabs0(self.g, flag))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.polredabs", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7705
 *         return self.new_gen(polredabs0(self.g, flag))
 * 
 *     def polresultant(self, y, var=-1, flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(y)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_611polresultant(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_611polresultant(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_y = 0;
    PyObject *__pyx_v_var = 0;
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polresultant (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_var,&__pyx_n_s_flag,0};
      PyObject* values[3] = {0,0,0};
      values[1] = ((PyObject *)__pyx_int_neg_1);
      values[2] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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_y)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var);
            if (value) { values[1] = value; kw_args--; }
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polresultant") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7705; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_y = values[0];
      __pyx_v_var = values[1];
      __pyx_v_flag = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polresultant", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7705; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polresultant", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_610polresultant(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_y, __pyx_v_var, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_610polresultant(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y, PyObject *__pyx_v_var, PyObject *__pyx_v_flag) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    long __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polresultant", 0);

    /* "cypari_src/gen.pyx":7706
 * 
 *     def polresultant(self, y, var=-1, flag=0):
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polresultant0(self.g, t0, self.get_var(var), flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7707
 *     def polresultant(self, y, var=-1, flag=0):
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polresultant0(self.g, t0, self.get_var(var), flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7708
 *         t0GEN(y)
 *         sig_on()
 *         return self.new_gen(polresultant0(self.g, t0, self.get_var(var), flag))             # <<<<<<<<<<<<<<
 * 
 *     def polroots(self, flag=0, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polresultant0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_var), __pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7705
 *         return self.new_gen(polredabs0(self.g, flag))
 * 
 *     def polresultant(self, y, var=-1, flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(y)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polresultant", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7710
 *         return self.new_gen(polresultant0(self.g, t0, self.get_var(var), flag))
 * 
 *     def polroots(self, flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         polroots(x,flag=0): complex roots of the polynomial x. flag is
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_613polroots(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_612polroots[] = "\n        polroots(x,flag=0): complex roots of the polynomial x. flag is\n        optional, and can be 0: default, uses Schonhage's method modified\n        by Gourdon, or 1: uses a modified Newton method.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_613polroots(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polroots (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_precision,0};
      PyObject* values[2] = {0,0};
      values[0] = ((PyObject *)__pyx_int_0);
      values[1] = ((PyObject *)__pyx_int_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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polroots") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7710; __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_flag = values[0];
      __pyx_v_precision = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polroots", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7710; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polroots", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_612polroots(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_612polroots(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_precision) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    long __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    long __pyx_t_6;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polroots", 0);

    /* "cypari_src/gen.pyx":7716
 *         by Gourdon, or 1: uses a modified Newton method.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(roots0(self.g, flag, pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7717
 *         """
 *         sig_on()
 *         return self.new_gen(roots0(self.g, flag, pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def polrootsmod(self, p, flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_precision); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, roots0(__pyx_v_self->g, __pyx_t_1, __pyx_t_6))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7710
 *         return self.new_gen(polresultant0(self.g, t0, self.get_var(var), flag))
 * 
 *     def polroots(self, flag=0, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         polroots(x,flag=0): complex roots of the polynomial x. flag is
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.gen.polroots", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7719
 *         return self.new_gen(roots0(self.g, flag, pbw(precision)))
 * 
 *     def polrootsmod(self, p, flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(p)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_615polrootsmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_615polrootsmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_p = 0;
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polrootsmod (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_flag,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_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_p)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polrootsmod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7719; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_p = values[0];
      __pyx_v_flag = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polrootsmod", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7719; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polrootsmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_614polrootsmod(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_p, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_614polrootsmod(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_flag) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    long __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polrootsmod", 0);

    /* "cypari_src/gen.pyx":7720
 * 
 *     def polrootsmod(self, p, flag=0):
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rootmod0(self.g, t0, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7721
 *     def polrootsmod(self, p, flag=0):
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rootmod0(self.g, t0, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7722
 *         t0GEN(p)
 *         sig_on()
 *         return self.new_gen(rootmod0(self.g, t0, flag))             # <<<<<<<<<<<<<<
 * 
 *     def polrootspadic(self, p, r=20):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rootmod0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7719
 *         return self.new_gen(roots0(self.g, flag, pbw(precision)))
 * 
 *     def polrootsmod(self, p, flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(p)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polrootsmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7724
 *         return self.new_gen(rootmod0(self.g, t0, flag))
 * 
 *     def polrootspadic(self, p, r=20):             # <<<<<<<<<<<<<<
 *         t0GEN(p)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_617polrootspadic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_617polrootspadic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_p = 0;
    PyObject *__pyx_v_r = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polrootspadic (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_r,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_20);
      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_p)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polrootspadic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7724; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_p = values[0];
      __pyx_v_r = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polrootspadic", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7724; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polrootspadic", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_616polrootspadic(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_p, __pyx_v_r);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_616polrootspadic(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_r) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    long __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polrootspadic", 0);

    /* "cypari_src/gen.pyx":7725
 * 
 *     def polrootspadic(self, p, r=20):
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rootpadic(self.g, t0, r))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7726
 *     def polrootspadic(self, p, r=20):
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rootpadic(self.g, t0, r))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7727
 *         t0GEN(p)
 *         sig_on()
 *         return self.new_gen(rootpadic(self.g, t0, r))             # <<<<<<<<<<<<<<
 * 
 *     def polrootspadicfast(self, p, r=20):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_r); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rootpadic(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7724
 *         return self.new_gen(rootmod0(self.g, t0, flag))
 * 
 *     def polrootspadic(self, p, r=20):             # <<<<<<<<<<<<<<
 *         t0GEN(p)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polrootspadic", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7729
 *         return self.new_gen(rootpadic(self.g, t0, r))
 * 
 *     def polrootspadicfast(self, p, r=20):             # <<<<<<<<<<<<<<
 *         t0GEN(p)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_619polrootspadicfast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_619polrootspadicfast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_p = 0;
    PyObject *__pyx_v_r = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polrootspadicfast (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_r,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_20);
      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_p)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polrootspadicfast") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7729; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_p = values[0];
      __pyx_v_r = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polrootspadicfast", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polrootspadicfast", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_618polrootspadicfast(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_p, __pyx_v_r);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_618polrootspadicfast(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_r) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    long __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polrootspadicfast", 0);

    /* "cypari_src/gen.pyx":7730
 * 
 *     def polrootspadicfast(self, p, r=20):
 *         t0GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rootpadicfast(self.g, t0, r))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7731
 *     def polrootspadicfast(self, p, r=20):
 *         t0GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rootpadicfast(self.g, t0, r))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7732
 *         t0GEN(p)
 *         sig_on()
 *         return self.new_gen(rootpadicfast(self.g, t0, r))             # <<<<<<<<<<<<<<
 * 
 *     def polsturm(self, a, b):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_r); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rootpadicfast(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7729
 *         return self.new_gen(rootpadic(self.g, t0, r))
 * 
 *     def polrootspadicfast(self, p, r=20):             # <<<<<<<<<<<<<<
 *         t0GEN(p)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polrootspadicfast", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7734
 *         return self.new_gen(rootpadicfast(self.g, t0, r))
 * 
 *     def polsturm(self, a, b):             # <<<<<<<<<<<<<<
 *         t0GEN(a)
 *         t1GEN(b)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_621polsturm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_621polsturm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_a = 0;
    PyObject *__pyx_v_b = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polsturm (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
      PyObject* values[2] = {0,0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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_a)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("polsturm", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7734; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polsturm") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7734; __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_a = values[0];
      __pyx_v_b = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polsturm", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7734; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polsturm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_620polsturm(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_a, __pyx_v_b);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_620polsturm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
    long __pyx_v_n;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polsturm", 0);

    /* "cypari_src/gen.pyx":7735
 * 
 *     def polsturm(self, a, b):
 *         t0GEN(a)             # <<<<<<<<<<<<<<
 *         t1GEN(b)
 *         sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7736
 *     def polsturm(self, a, b):
 *         t0GEN(a)
 *         t1GEN(b)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         n = sturmpart(self.g, t0, t1)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7737
 *         t0GEN(a)
 *         t1GEN(b)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         n = sturmpart(self.g, t0, t1)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7738
 *         t1GEN(b)
 *         sig_on()
 *         n = sturmpart(self.g, t0, t1)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return n
 */
    __pyx_v_n = sturmpart(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1);

    /* "cypari_src/gen.pyx":7739
 *         sig_on()
 *         n = sturmpart(self.g, t0, t1)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return n
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":7740
 *         n = sturmpart(self.g, t0, t1)
 *         sig_off()
 *         return n             # <<<<<<<<<<<<<<
 * 
 *     def polsturm_full(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7734
 *         return self.new_gen(rootpadicfast(self.g, t0, r))
 * 
 *     def polsturm(self, a, b):             # <<<<<<<<<<<<<<
 *         t0GEN(a)
 *         t1GEN(b)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polsturm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7742
 *         return n
 * 
 *     def polsturm_full(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         n = sturmpart(self.g, NULL, NULL)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_623polsturm_full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_623polsturm_full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polsturm_full (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_622polsturm_full(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_622polsturm_full(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    long __pyx_v_n;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polsturm_full", 0);

    /* "cypari_src/gen.pyx":7743
 * 
 *     def polsturm_full(self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         n = sturmpart(self.g, NULL, NULL)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7744
 *     def polsturm_full(self):
 *         sig_on()
 *         n = sturmpart(self.g, NULL, NULL)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return n
 */
    __pyx_v_n = sturmpart(__pyx_v_self->g, NULL, NULL);

    /* "cypari_src/gen.pyx":7745
 *         sig_on()
 *         n = sturmpart(self.g, NULL, NULL)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return n
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":7746
 *         n = sturmpart(self.g, NULL, NULL)
 *         sig_off()
 *         return n             # <<<<<<<<<<<<<<
 * 
 *     def polsylvestermatrix(self, g):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7742
 *         return n
 * 
 *     def polsturm_full(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         n = sturmpart(self.g, NULL, NULL)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polsturm_full", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7748
 *         return n
 * 
 *     def polsylvestermatrix(self, g):             # <<<<<<<<<<<<<<
 *         t0GEN(g)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_625polsylvestermatrix(PyObject *__pyx_v_self, PyObject *__pyx_v_g); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_625polsylvestermatrix(PyObject *__pyx_v_self, PyObject *__pyx_v_g) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polsylvestermatrix (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_624polsylvestermatrix(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_g));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_624polsylvestermatrix(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_g) {
    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("polsylvestermatrix", 0);

    /* "cypari_src/gen.pyx":7749
 * 
 *     def polsylvestermatrix(self, g):
 *         t0GEN(g)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(sylvestermatrix(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_g); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7750
 *     def polsylvestermatrix(self, g):
 *         t0GEN(g)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(sylvestermatrix(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7751
 *         t0GEN(g)
 *         sig_on()
 *         return self.new_gen(sylvestermatrix(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def polsym(self, long n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, sylvestermatrix(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7748
 *         return n
 * 
 *     def polsylvestermatrix(self, g):             # <<<<<<<<<<<<<<
 *         t0GEN(g)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polsylvestermatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7753
 *         return self.new_gen(sylvestermatrix(self.g, t0))
 * 
 *     def polsym(self, long n):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polsym(self.g, n))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_627polsym(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_627polsym(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polsym (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polsym", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_626polsym(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_626polsym(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polsym", 0);

    /* "cypari_src/gen.pyx":7754
 * 
 *     def polsym(self, long n):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polsym(self.g, n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7755
 *     def polsym(self, long n):
 *         sig_on()
 *         return self.new_gen(polsym(self.g, n))             # <<<<<<<<<<<<<<
 * 
 *     def serconvol(self, g):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polsym(__pyx_v_self->g, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7753
 *         return self.new_gen(sylvestermatrix(self.g, t0))
 * 
 *     def polsym(self, long n):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polsym(self.g, n))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.polsym", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7757
 *         return self.new_gen(polsym(self.g, n))
 * 
 *     def serconvol(self, g):             # <<<<<<<<<<<<<<
 *         t0GEN(g)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_629serconvol(PyObject *__pyx_v_self, PyObject *__pyx_v_g); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_629serconvol(PyObject *__pyx_v_self, PyObject *__pyx_v_g) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("serconvol (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_628serconvol(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_g));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_628serconvol(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_g) {
    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("serconvol", 0);

    /* "cypari_src/gen.pyx":7758
 * 
 *     def serconvol(self, g):
 *         t0GEN(g)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(convol(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_g); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7759
 *     def serconvol(self, g):
 *         t0GEN(g)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(convol(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7760
 *         t0GEN(g)
 *         sig_on()
 *         return self.new_gen(convol(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def serlaplace(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, convol(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7757
 *         return self.new_gen(polsym(self.g, n))
 * 
 *     def serconvol(self, g):             # <<<<<<<<<<<<<<
 *         t0GEN(g)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.serconvol", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7762
 *         return self.new_gen(convol(self.g, t0))
 * 
 *     def serlaplace(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(laplace(self.g))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_631serlaplace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_631serlaplace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("serlaplace (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_630serlaplace(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_630serlaplace(struct __pyx_obj_10cypari_src_3gen_gen *__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("serlaplace", 0);

    /* "cypari_src/gen.pyx":7763
 * 
 *     def serlaplace(self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(laplace(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7764
 *     def serlaplace(self):
 *         sig_on()
 *         return self.new_gen(laplace(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def serreverse(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, laplace(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7762
 *         return self.new_gen(convol(self.g, t0))
 * 
 *     def serlaplace(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(laplace(self.g))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.serlaplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7766
 *         return self.new_gen(laplace(self.g))
 * 
 *     def serreverse(self):             # <<<<<<<<<<<<<<
 *         """
 *         serreverse(f): reversion of the power series f.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_633serreverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_632serreverse[] = "\n        serreverse(f): reversion of the power series f.\n        \n        If f(t) is a series in t with valuation 1, find the series g(t)\n        such that g(f(t)) = t.\n        \n        EXAMPLES::\n        \n            >>> f = pari('x+x^2+x^3+O(x^4)'); f\n            x + x^2 + x^3 + O(x^4)\n            >>> g = f.serreverse(); g\n            x - x^2 + x^3 + O(x^4)\n            >>> f.subst('x',g)\n            x + O(x^4)\n            >>> g.subst('x',f)\n            x + O(x^4)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_633serreverse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("serreverse (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_632serreverse(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_632serreverse(struct __pyx_obj_10cypari_src_3gen_gen *__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("serreverse", 0);

    /* "cypari_src/gen.pyx":7784
 *             x + O(x^4)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(recip(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7785
 *         """
 *         sig_on()
 *         return self.new_gen(recip(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def thueinit(self, flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, recip(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7766
 *         return self.new_gen(laplace(self.g))
 * 
 *     def serreverse(self):             # <<<<<<<<<<<<<<
 *         """
 *         serreverse(f): reversion of the power series f.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.serreverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7787
 *         return self.new_gen(recip(self.g))
 * 
 *     def thueinit(self, flag=0):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(thueinit(self.g, flag, prec))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_635thueinit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_635thueinit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("thueinit (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "thueinit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7787; __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_flag = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("thueinit", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7787; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.thueinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_634thueinit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_634thueinit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag) {
    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("thueinit", 0);

    /* "cypari_src/gen.pyx":7788
 * 
 *     def thueinit(self, flag=0):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(thueinit(self.g, flag, prec))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7789
 *     def thueinit(self, flag=0):
 *         sig_on()
 *         return self.new_gen(thueinit(self.g, flag, prec))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, thueinit(__pyx_v_self->g, __pyx_t_1, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7787
 *         return self.new_gen(recip(self.g))
 * 
 *     def thueinit(self, flag=0):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(thueinit(self.g, flag, prec))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.thueinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7792
 * 
 * 
 *     def rnfisnorminit(self, polrel, long flag=2):             # <<<<<<<<<<<<<<
 *         t0GEN(polrel)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_637rnfisnorminit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_637rnfisnorminit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_polrel = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfisnorminit (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_polrel,&__pyx_n_s_flag,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_polrel)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rnfisnorminit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7792; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_polrel = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7792; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)2);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("rnfisnorminit", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7792; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfisnorminit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_636rnfisnorminit(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_polrel, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_636rnfisnorminit(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_polrel, long __pyx_v_flag) {
    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("rnfisnorminit", 0);

    /* "cypari_src/gen.pyx":7793
 * 
 *     def rnfisnorminit(self, polrel, long flag=2):
 *         t0GEN(polrel)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfisnorminit(self.g, t0, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_polrel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7794
 *     def rnfisnorminit(self, polrel, long flag=2):
 *         t0GEN(polrel)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfisnorminit(self.g, t0, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7795
 *         t0GEN(polrel)
 *         sig_on()
 *         return self.new_gen(rnfisnorminit(self.g, t0, flag))             # <<<<<<<<<<<<<<
 * 
 *     def rnfisnorm(self, T, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfisnorminit(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7792
 * 
 * 
 *     def rnfisnorminit(self, polrel, long flag=2):             # <<<<<<<<<<<<<<
 *         t0GEN(polrel)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfisnorminit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7797
 *         return self.new_gen(rnfisnorminit(self.g, t0, flag))
 * 
 *     def rnfisnorm(self, T, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(T)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_639rnfisnorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_639rnfisnorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_T = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("rnfisnorm (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_T,&__pyx_n_s_flag,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_T)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rnfisnorm") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7797; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_T = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7797; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("rnfisnorm", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7797; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfisnorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_638rnfisnorm(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_T, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_638rnfisnorm(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_T, long __pyx_v_flag) {
    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("rnfisnorm", 0);

    /* "cypari_src/gen.pyx":7798
 * 
 *     def rnfisnorm(self, T, long flag=0):
 *         t0GEN(T)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(rnfisnorm(t0, self.g, flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7799
 *     def rnfisnorm(self, T, long flag=0):
 *         t0GEN(T)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(rnfisnorm(t0, self.g, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7800
 *         t0GEN(T)
 *         sig_on()
 *         return self.new_gen(rnfisnorm(t0, self.g, flag))             # <<<<<<<<<<<<<<
 * 
 *     ###########################################
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, rnfisnorm(__pyx_v_10cypari_src_3gen_t0, __pyx_v_self->g, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7797
 *         return self.new_gen(rnfisnorminit(self.g, t0, flag))
 * 
 *     def rnfisnorm(self, T, long flag=0):             # <<<<<<<<<<<<<<
 *         t0GEN(T)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.rnfisnorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7806
 *     ###########################################
 * 
 *     def vecextract(self, y, z=None):             # <<<<<<<<<<<<<<
 *         r"""
 *         self.vecextract(y,z): extraction of the components of the matrix or
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_641vecextract(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_640vecextract[] = "\n        self.vecextract(y,z): extraction of the components of the matrix or\n        vector x according to y and z. If z is omitted, y designates\n        columns, otherwise y corresponds to rows and z to columns. y and z\n        can be vectors (of indices), strings (indicating ranges as\n        in\"1..10\") or masks (integers whose binary representation indicates\n        the indices to extract, from left to right 1, 2, 4, 8, etc.)\n        \n        .. note::\n\n           This function uses the PARI row and column indexing, so the\n           first row or column is indexed by 1 instead of 0.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_641vecextract(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_y = 0;
    PyObject *__pyx_v_z = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("vecextract (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_z,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)Py_None);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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_y)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vecextract") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7806; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_y = values[0];
      __pyx_v_z = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("vecextract", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.vecextract", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_640vecextract(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_y, __pyx_v_z);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_640vecextract(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y, PyObject *__pyx_v_z) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_t_3;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("vecextract", 0);

    /* "cypari_src/gen.pyx":7820
 *            first row or column is indexed by 1 instead of 0.
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         if z is None:
 *             sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7821
 *         """
 *         t0GEN(y)
 *         if z is None:             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return P.new_gen(shallowextract(self.g, t0))
 */
    __pyx_t_2 = (__pyx_v_z == Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cypari_src/gen.pyx":7822
 *         t0GEN(y)
 *         if z is None:
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return P.new_gen(shallowextract(self.g, t0))
 *         else:
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":7823
 *         if z is None:
 *             sig_on()
 *             return P.new_gen(shallowextract(self.g, t0))             # <<<<<<<<<<<<<<
 *         else:
 *             t1GEN(z)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, shallowextract(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":7825
 *             return P.new_gen(shallowextract(self.g, t0))
 *         else:
 *             t1GEN(z)             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return P.new_gen(extract0(self.g, t0, t1))
 */
      __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":7826
 *         else:
 *             t1GEN(z)
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return P.new_gen(extract0(self.g, t0, t1))
 * 
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":7827
 *             t1GEN(z)
 *             sig_on()
 *             return P.new_gen(extract0(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def ncols(self):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, extract0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":7806
 *     ###########################################
 * 
 *     def vecextract(self, y, z=None):             # <<<<<<<<<<<<<<
 *         r"""
 *         self.vecextract(y,z): extraction of the components of the matrix or
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.vecextract", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7829
 *             return P.new_gen(extract0(self.g, t0, t1))
 * 
 *     def ncols(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of columns of self.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_643ncols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_642ncols[] = "\n        Return the number of columns of self.\n        \n        EXAMPLES::\n        \n            >>> pari('matrix(19,8)').ncols()\n            8\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_643ncols(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ncols (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_642ncols(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_642ncols(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    long __pyx_v_n;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ncols", 0);

    /* "cypari_src/gen.pyx":7839
 *         """
 *         cdef long n
 *         sig_on()             # <<<<<<<<<<<<<<
 *         n = glength(self.g)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7840
 *         cdef long n
 *         sig_on()
 *         n = glength(self.g)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return n
 */
    __pyx_v_n = glength(__pyx_v_self->g);

    /* "cypari_src/gen.pyx":7841
 *         sig_on()
 *         n = glength(self.g)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return n
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":7842
 *         n = glength(self.g)
 *         sig_off()
 *         return n             # <<<<<<<<<<<<<<
 * 
 *     def nrows(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7829
 *             return P.new_gen(extract0(self.g, t0, t1))
 * 
 *     def ncols(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of columns of self.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ncols", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7844
 *         return n
 * 
 *     def nrows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of rows of self.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_645nrows(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_644nrows[] = "\n        Return the number of rows of self.\n        \n        EXAMPLES::\n        \n            >>> pari('matrix(19,8)').nrows()\n            19\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_645nrows(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nrows (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_644nrows(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_644nrows(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    long __pyx_v_n;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    int __pyx_t_4;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nrows", 0);

    /* "cypari_src/gen.pyx":7854
 *         """
 *         cdef long n
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # if this matrix has no columns
 *         # then it has no rows.
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7857
 *         # if this matrix has no columns
 *         # then it has no rows.
 *         if self.ncols() == 0:             # <<<<<<<<<<<<<<
 *             sig_off()
 *             return 0
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ncols); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "cypari_src/gen.pyx":7858
 *         # then it has no rows.
 *         if self.ncols() == 0:
 *             sig_off()             # <<<<<<<<<<<<<<
 *             return 0
 *         n = glength(<GEN>(self.g[1]))
 */
      __pyx_f_10cypari_src_3gen_sig_off();

      /* "cypari_src/gen.pyx":7859
 *         if self.ncols() == 0:
 *             sig_off()
 *             return 0             # <<<<<<<<<<<<<<
 *         n = glength(<GEN>(self.g[1]))
 *         sig_off()
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_int_0);
      __pyx_r = __pyx_int_0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":7860
 *             sig_off()
 *             return 0
 *         n = glength(<GEN>(self.g[1]))             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return n
 */
    __pyx_v_n = glength(((GEN)(__pyx_v_self->g[1])));

    /* "cypari_src/gen.pyx":7861
 *             return 0
 *         n = glength(<GEN>(self.g[1]))
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return n
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":7862
 *         n = glength(<GEN>(self.g[1]))
 *         sig_off()
 *         return n             # <<<<<<<<<<<<<<
 * 
 *     def mattranspose(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7844
 *         return n
 * 
 *     def nrows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of rows of self.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.nrows", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7864
 *         return n
 * 
 *     def mattranspose(self):             # <<<<<<<<<<<<<<
 *         """
 *         Transpose of the matrix self.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_647mattranspose(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_646mattranspose[] = "\n        Transpose of the matrix self.\n        \n        EXAMPLES::\n        \n            >>> pari('[1,2,3; 4,5,6;  7,8,9]').mattranspose()\n            [1, 4, 7; 2, 5, 8; 3, 6, 9]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_647mattranspose(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("mattranspose (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_646mattranspose(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

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

    /* "cypari_src/gen.pyx":7873
 *             [1, 4, 7; 2, 5, 8; 3, 6, 9]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(gtrans(self.g)).Mat()
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7874
 *         """
 *         sig_on()
 *         return self.new_gen(gtrans(self.g)).Mat()             # <<<<<<<<<<<<<<
 * 
 *     def matadjoint(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, gtrans(__pyx_v_self->g))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Mat_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7864
 *         return n
 * 
 *     def mattranspose(self):             # <<<<<<<<<<<<<<
 *         """
 *         Transpose of the matrix self.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.mattranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7876
 *         return self.new_gen(gtrans(self.g)).Mat()
 * 
 *     def matadjoint(self):             # <<<<<<<<<<<<<<
 *         """
 *         matadjoint(x): adjoint matrix of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_649matadjoint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_648matadjoint[] = "\n        matadjoint(x): adjoint matrix of x.\n        \n        EXAMPLES::\n        \n            >>> pari('[1,2,3; 4,5,6;  7,8,9]').matadjoint()\n            [-3, 6, -3; 6, -12, 6; -3, 6, -3]\n            >>> pari('[a,b,c; d,e,f; g,h,i]').matadjoint()\n            [(i*e - h*f), (-i*b + h*c), (f*b - e*c); (-i*d + g*f), i*a - g*c, -f*a + d*c; (h*d - g*e), -h*a + g*b, e*a - d*b]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_649matadjoint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("matadjoint (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_648matadjoint(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

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

    /* "cypari_src/gen.pyx":7887
 *             [(i*e - h*f), (-i*b + h*c), (f*b - e*c); (-i*d + g*f), i*a - g*c, -f*a + d*c; (h*d - g*e), -h*a + g*b, e*a - d*b]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(adj(self.g)).Mat()
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7888
 *         """
 *         sig_on()
 *         return self.new_gen(adj(self.g)).Mat()             # <<<<<<<<<<<<<<
 * 
 *     def qflll(self, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, adj(__pyx_v_self->g))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Mat_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7876
 *         return self.new_gen(gtrans(self.g)).Mat()
 * 
 *     def matadjoint(self):             # <<<<<<<<<<<<<<
 *         """
 *         matadjoint(x): adjoint matrix of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.matadjoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7890
 *         return self.new_gen(adj(self.g)).Mat()
 * 
 *     def qflll(self, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         qflll(x,flag=0): LLL reduction of the vectors forming the matrix x
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_651qflll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_650qflll[] = "\n        qflll(x,flag=0): LLL reduction of the vectors forming the matrix x\n        (gives the unimodular transformation matrix). The columns of x must\n        be linearly independent, unless specified otherwise below. flag is\n        optional, and can be 0: default, 1: assumes x is integral, columns\n        may be dependent, 2: assumes x is integral, returns a partially\n        reduced basis, 4: assumes x is integral, returns [K,I] where K is\n        the integer kernel of x and I the LLL reduced image, 5: same as 4\n        but x may have polynomial coefficients, 8: same as 0 but x may have\n        polynomial coefficients.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_651qflll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("qflll (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "qflll") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7890; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7890; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("qflll", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7890; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.qflll", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_650qflll(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_650qflll(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag) {
    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("qflll", 0);

    /* "cypari_src/gen.pyx":7902
 *         polynomial coefficients.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(qflll0(self.g,flag)).Mat()
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7903
 *         """
 *         sig_on()
 *         return self.new_gen(qflll0(self.g,flag)).Mat()             # <<<<<<<<<<<<<<
 * 
 *     def qflllgram(self, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, qflll0(__pyx_v_self->g, __pyx_v_flag))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Mat_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7890
 *         return self.new_gen(adj(self.g)).Mat()
 * 
 *     def qflll(self, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         qflll(x,flag=0): LLL reduction of the vectors forming the matrix x
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.qflll", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7905
 *         return self.new_gen(qflll0(self.g,flag)).Mat()
 * 
 *     def qflllgram(self, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         qflllgram(x,flag=0): LLL reduction of the lattice whose gram matrix
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_653qflllgram(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_652qflllgram[] = "\n        qflllgram(x,flag=0): LLL reduction of the lattice whose gram matrix\n        is x (gives the unimodular transformation matrix). flag is optional\n        and can be 0: default,1: lllgramint algorithm for integer matrices,\n        4: lllgramkerim giving the kernel and the LLL reduced image, 5:\n        lllgramkerimgen same when the matrix has polynomial coefficients,\n        8: lllgramgen, same as qflllgram when the coefficients are\n        polynomials.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_653qflllgram(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("qflllgram (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "qflllgram") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7905; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("qflllgram", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7905; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.qflllgram", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_652qflllgram(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_652qflllgram(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag) {
    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("qflllgram", 0);

    /* "cypari_src/gen.pyx":7915
 *         polynomials.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(qflllgram0(self.g,flag)).Mat()
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7916
 *         """
 *         sig_on()
 *         return self.new_gen(qflllgram0(self.g,flag)).Mat()             # <<<<<<<<<<<<<<
 * 
 *     def lllgram(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, qflllgram0(__pyx_v_self->g, __pyx_v_flag))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Mat_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7905
 *         return self.new_gen(qflll0(self.g,flag)).Mat()
 * 
 *     def qflllgram(self, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         qflllgram(x,flag=0): LLL reduction of the lattice whose gram matrix
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.qflllgram", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7918
 *         return self.new_gen(qflllgram0(self.g,flag)).Mat()
 * 
 *     def lllgram(self):             # <<<<<<<<<<<<<<
 *         return self.qflllgram(0)
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_655lllgram(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_655lllgram(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("lllgram (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_654lllgram(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_654lllgram(struct __pyx_obj_10cypari_src_3gen_gen *__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("lllgram", 0);

    /* "cypari_src/gen.pyx":7919
 * 
 *     def lllgram(self):
 *         return self.qflllgram(0)             # <<<<<<<<<<<<<<
 * 
 *     def lllgramint(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qflllgram); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7918
 *         return self.new_gen(qflllgram0(self.g,flag)).Mat()
 * 
 *     def lllgram(self):             # <<<<<<<<<<<<<<
 *         return self.qflllgram(0)
 * 
 */

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

  /* "cypari_src/gen.pyx":7921
 *         return self.qflllgram(0)
 * 
 *     def lllgramint(self):             # <<<<<<<<<<<<<<
 *         return self.qflllgram(1)
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_657lllgramint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_657lllgramint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("lllgramint (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_656lllgramint(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_656lllgramint(struct __pyx_obj_10cypari_src_3gen_gen *__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("lllgramint", 0);

    /* "cypari_src/gen.pyx":7922
 * 
 *     def lllgramint(self):
 *         return self.qflllgram(1)             # <<<<<<<<<<<<<<
 * 
 *     def qfminim(self, B, max, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qflllgram); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7921
 *         return self.qflllgram(0)
 * 
 *     def lllgramint(self):             # <<<<<<<<<<<<<<
 *         return self.qflllgram(1)
 * 
 */

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

  /* "cypari_src/gen.pyx":7924
 *         return self.qflllgram(1)
 * 
 *     def qfminim(self, B, max, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         qfminim(x,bound,maxnum,flag=0): number of vectors of square norm =
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_659qfminim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_658qfminim[] = "\n        qfminim(x,bound,maxnum,flag=0): number of vectors of square norm =\n        bound, maximum norm and list of vectors for the integral and\n        definite quadratic form x; minimal non-zero vectors if bound=0.\n        flag is optional, and can be 0: default; 1: returns the first\n        minimal vector found (ignore maxnum); 2: as 0 but uses a more\n        robust, slower implementation, valid for non integral quadratic\n        forms.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_659qfminim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_B = 0;
    PyObject *__pyx_v_max = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("qfminim (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_max,&__pyx_n_s_flag,0};
      PyObject* values[3] = {0,0,0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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_B)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("qfminim", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7924; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "qfminim") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7924; __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);
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_B = values[0];
      __pyx_v_max = values[1];
      if (values[2]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7924; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("qfminim", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7924; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.qfminim", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_658qfminim(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_B, __pyx_v_max, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_658qfminim(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_B, PyObject *__pyx_v_max, long __pyx_v_flag) {
    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("qfminim", 0);

    /* "cypari_src/gen.pyx":7934
 *         forms.
 *         """
 *         t0GEN(B)             # <<<<<<<<<<<<<<
 *         t1GEN(max)
 *         sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_B); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7935
 *         """
 *         t0GEN(B)
 *         t1GEN(max)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(qfminim0(self.g,t0,t1,flag,precdl))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7936
 *         t0GEN(B)
 *         t1GEN(max)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(qfminim0(self.g,t0,t1,flag,precdl))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7937
 *         t1GEN(max)
 *         sig_on()
 *         return self.new_gen(qfminim0(self.g,t0,t1,flag,precdl))             # <<<<<<<<<<<<<<
 * 
 *     def qfrep(self, B, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, qfminim0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, __pyx_v_flag, precdl))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7924
 *         return self.qflllgram(1)
 * 
 *     def qfminim(self, B, max, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         qfminim(x,bound,maxnum,flag=0): number of vectors of square norm =
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.qfminim", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7939
 *         return self.new_gen(qfminim0(self.g,t0,t1,flag,precdl))
 * 
 *     def qfrep(self, B, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         qfrep(x,B,flag=0): vector of (half) the number of vectors of norms
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_661qfrep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_660qfrep[] = "\n        qfrep(x,B,flag=0): vector of (half) the number of vectors of norms\n        from 1 to B for the integral and definite quadratic form x. Binary\n        digits of flag mean 1: count vectors of even norm from 1 to 2B, 2:\n        return a t_VECSMALL instead of a t_VEC.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_661qfrep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_B = 0;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("qfrep (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_flag,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_B)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "qfrep") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7939; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_B = values[0];
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("qfrep", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.qfrep", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_660qfrep(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_B, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_660qfrep(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_B, long __pyx_v_flag) {
    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("qfrep", 0);

    /* "cypari_src/gen.pyx":7946
 *         return a t_VECSMALL instead of a t_VEC.
 *         """
 *         t0GEN(B)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(qfrep0(self.g,t0,flag))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_B); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7947
 *         """
 *         t0GEN(B)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(qfrep0(self.g,t0,flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7948
 *         t0GEN(B)
 *         sig_on()
 *         return self.new_gen(qfrep0(self.g,t0,flag))             # <<<<<<<<<<<<<<
 * 
 *     def matsolve(self, B):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, qfrep0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7939
 *         return self.new_gen(qfminim0(self.g,t0,t1,flag,precdl))
 * 
 *     def qfrep(self, B, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         qfrep(x,B,flag=0): vector of (half) the number of vectors of norms
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.qfrep", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7950
 *         return self.new_gen(qfrep0(self.g,t0,flag))
 * 
 *     def matsolve(self, B):             # <<<<<<<<<<<<<<
 *         """
 *         matsolve(B): Solve the linear system Mx=B for an invertible matrix
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_663matsolve(PyObject *__pyx_v_self, PyObject *__pyx_v_B); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_662matsolve[] = "\n        matsolve(B): Solve the linear system Mx=B for an invertible matrix\n        M\n        \n        matsolve(B) uses Gaussian elimination to solve Mx=B, where M is\n        invertible and B is a column vector.\n        \n        The corresponding pari library routine is gauss. The gp-interface\n        name matsolve has been given preference here.\n        \n        INPUT:\n        \n        \n        -  ``B`` - a column vector of the same dimension as the\n           square matrix self\n        \n        \n        EXAMPLES::\n        \n            >>> pari('[1,1;1,-1]').matsolve(pari('[1;0]'))\n            [1/2; 1/2]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_663matsolve(PyObject *__pyx_v_self, PyObject *__pyx_v_B) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("matsolve (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_662matsolve(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_B));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_662matsolve(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_B) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("matsolve", 0);

    /* "cypari_src/gen.pyx":7973
 *             [1/2; 1/2]
 *         """
 *         t0GEN(B)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(gauss(self.g,t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_B); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":7974
 *         """
 *         t0GEN(B)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(gauss(self.g,t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":7975
 *         t0GEN(B)
 *         sig_on()
 *         return self.new_gen(gauss(self.g,t0))             # <<<<<<<<<<<<<<
 * 
 *     def matker(self, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, gauss(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7950
 *         return self.new_gen(qfrep0(self.g,t0,flag))
 * 
 *     def matsolve(self, B):             # <<<<<<<<<<<<<<
 *         """
 *         matsolve(B): Solve the linear system Mx=B for an invertible matrix
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.matsolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":7977
 *         return self.new_gen(gauss(self.g,t0))
 * 
 *     def matker(self, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return a basis of the kernel of this matrix.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_665matker(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_664matker[] = "\n        Return a basis of the kernel of this matrix.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - optional; may be set to 0: default;\n           non-zero: x is known to have integral entries.\n        \n        \n        EXAMPLES::\n        \n            >>> pari('[1,2,3;4,5,6;7,8,9]').matker()\n            [1; -2; 1]\n        \n        With algorithm 1, even if the matrix has integer entries the kernel\n        need not be saturated (which is weird)::\n        \n            >>> pari('[1,2,3;4,5,6;7,8,9]').matker(1)\n            [3; -6; 3]\n            >>> pari('matrix(3,3,i,j,i)').matker()\n            [-1, -1; 1, 0; 0, 1]\n            >>> pari('[1,2,3;4,5,6;7,8,9]*Mod(1,2)').matker()\n            [Mod(1, 2); Mod(0, 2); Mod(1, 2)]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_665matker(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("matker (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matker") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7977; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7977; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("matker", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7977; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.matker", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_664matker(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_664matker(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag) {
    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("matker", 0);

    /* "cypari_src/gen.pyx":8003
 *             [Mod(1, 2); Mod(0, 2); Mod(1, 2)]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(matker0(self.g, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8004
 *         """
 *         sig_on()
 *         return self.new_gen(matker0(self.g, flag))             # <<<<<<<<<<<<<<
 * 
 *     def matkerint(self, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, matker0(__pyx_v_self->g, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":7977
 *         return self.new_gen(gauss(self.g,t0))
 * 
 *     def matker(self, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return a basis of the kernel of this matrix.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.matker", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8006
 *         return self.new_gen(matker0(self.g, flag))
 * 
 *     def matkerint(self, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the integer kernel of a matrix.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_667matkerint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_666matkerint[] = "\n        Return the integer kernel of a matrix.\n        \n        This is the LLL-reduced Z-basis of the kernel of the matrix x with\n        integral entries.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - optional, and may be set to 0: default,\n           uses a modified LLL, 1: uses matrixqz.\n        \n        \n        EXAMPLES::\n        \n            >>> pari('[2,1;2,1]').matker()\n            [-1/2; 1]\n            >>> pari('[2,1;2,1]').matkerint()\n            [1; -2]\n            >>> pari('[2,1;2,1]').matkerint(1)\n            [1; -2]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_667matkerint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("matkerint (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matkerint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8006; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("matkerint", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.matkerint", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_666matkerint(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_666matkerint(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag) {
    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("matkerint", 0);

    /* "cypari_src/gen.pyx":8029
 *             [1; -2]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(matkerint0(self.g, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8030
 *         """
 *         sig_on()
 *         return self.new_gen(matkerint0(self.g, flag))             # <<<<<<<<<<<<<<
 * 
 *     def matdet(self, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, matkerint0(__pyx_v_self->g, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8006
 *         return self.new_gen(matker0(self.g, flag))
 * 
 *     def matkerint(self, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the integer kernel of a matrix.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.matkerint", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8032
 *         return self.new_gen(matkerint0(self.g, flag))
 * 
 *     def matdet(self, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the determinant of this matrix.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_669matdet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_668matdet[] = "\n        Return the determinant of this matrix.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - (optional) flag 0: using Gauss-Bareiss.\n           1: use classical Gaussian elimination (slightly better for integer\n           entries)\n        \n        \n        EXAMPLES::\n        \n            >>> pari('[1,2; 3,4]').matdet(0)\n            -2\n            >>> pari('[1,2; 3,4]').matdet(1)\n            -2\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_669matdet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("matdet (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matdet") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8032; __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;
        }
      }
      if (values[0]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8032; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("matdet", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8032; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.matdet", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_668matdet(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_668matdet(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_flag) {
    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("matdet", 0);

    /* "cypari_src/gen.pyx":8051
 *             -2
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(det0(self.g, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8052
 *         """
 *         sig_on()
 *         return self.new_gen(det0(self.g, flag))             # <<<<<<<<<<<<<<
 * 
 *     def trace(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, det0(__pyx_v_self->g, __pyx_v_flag))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8032
 *         return self.new_gen(matkerint0(self.g, flag))
 * 
 *     def matdet(self, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the determinant of this matrix.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.matdet", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8054
 *         return self.new_gen(det0(self.g, flag))
 * 
 *     def trace(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the trace of this PARI object.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_671trace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_670trace[] = "\n        Return the trace of this PARI object.\n        \n        EXAMPLES::\n        \n            >>> pari('[1,2; 3,4]').trace()  \n            5\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_671trace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("trace (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_670trace(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_670trace(struct __pyx_obj_10cypari_src_3gen_gen *__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("trace", 0);

    /* "cypari_src/gen.pyx":8063
 *             5
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(gtrace(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8064
 *         """
 *         sig_on()
 *         return self.new_gen(gtrace(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def mathnf(self, flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, gtrace(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8054
 *         return self.new_gen(det0(self.g, flag))
 * 
 *     def trace(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the trace of this PARI object.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8066
 *         return self.new_gen(gtrace(self.g))
 * 
 *     def mathnf(self, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         A.mathnf(flag=0): (upper triangular) Hermite normal form of A,
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_673mathnf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_672mathnf[] = "\n        A.mathnf(flag=0): (upper triangular) Hermite normal form of A,\n        basis for the lattice formed by the columns of A.\n        \n        INPUT:\n        \n        \n        -  ``flag`` - optional, value range from 0 to 4 (0 if\n           omitted), meaning : 0: naive algorithm\n        \n        -  ``1: Use Batut's algorithm`` - output 2-component\n           vector [H,U] such that H is the HNF of A, and U is a unimodular\n           matrix such that xU=H. 3: Use Batut's algorithm. Output [H,U,P]\n           where P is a permutation matrix such that P A U = H. 4: As 1, using\n           a heuristic variant of LLL reduction along the way.\n        \n        \n        EXAMPLES::\n        \n            >>> pari('[1,2,3; 4,5,6;  7,8,9]').mathnf()\n            [6, 1; 3, 1; 0, 1]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_673mathnf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("mathnf (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mathnf") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8066; __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_flag = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("mathnf", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8066; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.mathnf", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_672mathnf(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_672mathnf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag) {
    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("mathnf", 0);

    /* "cypari_src/gen.pyx":8089
 *             [6, 1; 3, 1; 0, 1]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(mathnf0(self.g, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8090
 *         """
 *         sig_on()
 *         return self.new_gen(mathnf0(self.g, flag))             # <<<<<<<<<<<<<<
 * 
 *     def mathnfmod(self, d):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, mathnf0(__pyx_v_self->g, __pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8066
 *         return self.new_gen(gtrace(self.g))
 * 
 *     def mathnf(self, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         A.mathnf(flag=0): (upper triangular) Hermite normal form of A,
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.mathnf", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8092
 *         return self.new_gen(mathnf0(self.g, flag))
 * 
 *     def mathnfmod(self, d):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the Hermite normal form if d is a multiple of the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_675mathnfmod(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_674mathnfmod[] = "\n        Returns the Hermite normal form if d is a multiple of the\n        determinant\n        \n        Beware that PARI's concept of a Hermite normal form is an upper\n        triangular matrix with the same column space as the input matrix.\n        \n        INPUT:\n        \n        \n        -  ``d`` - multiple of the determinant of self\n        \n        \n        EXAMPLES::\n        \n            >>> M = pari('[1,2,3; 4,5,6; 7,8,11]')\n            >>> d = M.matdet()\n            >>> M.mathnfmod(d)\n            [6, 4, 3; 0, 1, 0; 0, 0, 1]\n        \n        Note that d really needs to be a multiple of the discriminant, not\n        just of the exponent of the cokernel::\n        \n            >>> M=pari('[1,0,0; 0,2,0; 0,0,6]')\n            >>> M.mathnfmod(6)\n            [1, 0, 0; 0, 1, 0; 0, 0, 6]\n            >>> M.mathnfmod(12)\n            [1, 0, 0; 0, 2, 0; 0, 0, 6]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_675mathnfmod(PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("mathnfmod (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_674mathnfmod(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_d));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_674mathnfmod(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_d) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("mathnfmod", 0);

    /* "cypari_src/gen.pyx":8122
 *             [1, 0, 0; 0, 2, 0; 0, 0, 6]
 *         """
 *         t0GEN(d)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(hnfmod(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8123
 *         """
 *         t0GEN(d)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(hnfmod(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8124
 *         t0GEN(d)
 *         sig_on()
 *         return self.new_gen(hnfmod(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def mathnfmodid(self, d):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, hnfmod(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8092
 *         return self.new_gen(mathnf0(self.g, flag))
 * 
 *     def mathnfmod(self, d):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the Hermite normal form if d is a multiple of the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.mathnfmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8126
 *         return self.new_gen(hnfmod(self.g, t0))
 * 
 *     def mathnfmodid(self, d):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the Hermite Normal Form of M concatenated with d\*Identity
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_677mathnfmodid(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_676mathnfmodid[] = "\n        Returns the Hermite Normal Form of M concatenated with d\\*Identity\n        \n        Beware that PARI's concept of a Hermite normal form is a maximal\n        rank upper triangular matrix with the same column space as the\n        input matrix.\n        \n        INPUT:\n        \n        \n        -  ``d`` - Determines\n        \n        \n        EXAMPLES::\n        \n            >>> M=pari('[1,0,0; 0,2,0; 0,0,6]')\n            >>> pari(M).mathnfmodid(6)\n            [1, 0, 0; 0, 2, 0; 0, 0, 6]\n        \n        This routine is not completely equivalent to mathnfmod::\n        \n            >>> pari(M).mathnfmod(6)\n            [1, 0, 0; 0, 1, 0; 0, 0, 6]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_677mathnfmodid(PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("mathnfmodid (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_676mathnfmodid(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_d));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_676mathnfmodid(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_d) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("mathnfmodid", 0);

    /* "cypari_src/gen.pyx":8151
 *             [1, 0, 0; 0, 1, 0; 0, 0, 6]
 *         """
 *         t0GEN(d)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(hnfmodid(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8152
 *         """
 *         t0GEN(d)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(hnfmodid(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8153
 *         t0GEN(d)
 *         sig_on()
 *         return self.new_gen(hnfmodid(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def matsnf(self, flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, hnfmodid(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8126
 *         return self.new_gen(hnfmod(self.g, t0))
 * 
 *     def mathnfmodid(self, d):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the Hermite Normal Form of M concatenated with d\*Identity
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.mathnfmodid", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8155
 *         return self.new_gen(hnfmodid(self.g, t0))
 * 
 *     def matsnf(self, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.matsnf(flag=0): Smith normal form (i.e. elementary divisors) of
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_679matsnf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_678matsnf[] = "\n        x.matsnf(flag=0): Smith normal form (i.e. elementary divisors) of\n        the matrix x, expressed as a vector d. Binary digits of flag mean\n        1: returns [u,v,d] where d=u\\*x\\*v, otherwise only the diagonal d\n        is returned, 2: allow polynomial entries, otherwise assume x is\n        integral, 4: removes all information corresponding to entries equal\n        to 1 in d.\n        \n        EXAMPLES::\n        \n            >>> pari('[1,2,3; 4,5,6;  7,8,9]').matsnf()\n            [0, 3, 1]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_679matsnf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("matsnf (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matsnf") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8155; __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_flag = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("matsnf", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.matsnf", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_678matsnf(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_678matsnf(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag) {
    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("matsnf", 0);

    /* "cypari_src/gen.pyx":8169
 *             [0, 3, 1]
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(matsnf0(self.g, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8170
 *         """
 *         sig_on()
 *         return self.new_gen(matsnf0(self.g, flag))             # <<<<<<<<<<<<<<
 * 
 *     def matrank(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, matsnf0(__pyx_v_self->g, __pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8155
 *         return self.new_gen(hnfmodid(self.g, t0))
 * 
 *     def matsnf(self, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         x.matsnf(flag=0): Smith normal form (i.e. elementary divisors) of
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.matsnf", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8172
 *         return self.new_gen(matsnf0(self.g, flag))
 * 
 *     def matrank(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         Return the rank of this Pari matrix (we hope!).
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_681matrank(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_680matrank[] = "\n        Return the rank of this Pari matrix (we hope!).\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_681matrank(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("matrank (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_680matrank(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_680matrank(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    long __pyx_v_rk;
    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("matrank", 0);

    /* "cypari_src/gen.pyx":8177
 *         """
 *         cdef long rk
 *         sig_on()             # <<<<<<<<<<<<<<
 *         rk = rank(self.g)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8178
 *         cdef long rk
 *         sig_on()
 *         rk = rank(self.g)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return rk
 */
    __pyx_v_rk = rank(__pyx_v_self->g);

    /* "cypari_src/gen.pyx":8179
 *         sig_on()
 *         rk = rank(self.g)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return rk
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":8180
 *         rk = rank(self.g)
 *         sig_off()
 *         return rk             # <<<<<<<<<<<<<<
 * 
 *     def matfrobenius(self, flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_rk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8172
 *         return self.new_gen(matsnf0(self.g, flag))
 * 
 *     def matrank(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         Return the rank of this Pari matrix (we hope!).
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.matrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8182
 *         return rk
 * 
 *     def matfrobenius(self, flag=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         M.matfrobenius(flag=0): Return the Frobenius form of the square
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_683matfrobenius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_682matfrobenius[] = "\n        M.matfrobenius(flag=0): Return the Frobenius form of the square\n        matrix M. If flag is 1, return only the elementary divisors (a list\n        of polynomials). If flag is 2, return a two-components vector [F,B]\n        where F is the Frobenius form and B is the basis change so that\n        `M=B^{-1} F B`.\n        \n        EXAMPLES::\n        \n            >>> a = pari('[1,2;3,4]')\n            >>> a.matfrobenius()\n            [0, 2; 1, 5]\n            >>> a.matfrobenius(flag=1)\n            [x^2 - 5*x - 2]\n            >>> a.matfrobenius(2)\n            [[0, 2; 1, 5], [1, -1/3; 0, 1/3]]\n            >>> v = a.matfrobenius(2)\n            >>> v[0]\n            [0, 2; 1, 5]\n            >>> v[1]**(-1)*v[0]*v[1]\n            [1, 2; 3, 4]\n        \n        We let t be the matrix of `T_2` acting on modular symbols\n        of level 43, which was computed using\n        ``ModularSymbols(43,sign=1).T(2).matrix()``::\n        \n            >>> t = pari('[3, -2, 0, 0; 0, -2, 0, 1; 0, -1, -2, 2; 0, -2, 0, 2]')\n            >>> t.matfrobenius()\n            [0, 0, 0, -12; 1, 0, 0, -2; 0, 1, 0, 8; 0, 0, 1, 1]\n            >>> t.charpoly('x')\n            x^4 - x^3 - 8*x^2 + 2*x + 12\n            >>> t.matfrobenius(1)\n            [x^4 - x^3 - 8*x^2 + 2*x + 12]\n        \n        AUTHORS:\n\n        - Martin Albrect (2006-04-02)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_683matfrobenius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("matfrobenius (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matfrobenius") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8182; __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_flag = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("matfrobenius", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.matfrobenius", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_682matfrobenius(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_682matfrobenius(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag) {
    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("matfrobenius", 0);

    /* "cypari_src/gen.pyx":8221
 *         - Martin Albrect (2006-04-02)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(matfrobenius(self.g, flag, 0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8222
 *         """
 *         sig_on()
 *         return self.new_gen(matfrobenius(self.g, flag, 0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, matfrobenius(__pyx_v_self->g, __pyx_t_1, 0))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8182
 *         return rk
 * 
 *     def matfrobenius(self, flag=0):             # <<<<<<<<<<<<<<
 *         r"""
 *         M.matfrobenius(flag=0): Return the Frobenius form of the square
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.matfrobenius", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8228
 *     # polarit2.c
 *     ###########################################
 *     def factor(gen self, limit=-1, bint proof=1):             # <<<<<<<<<<<<<<
 *         """
 *         Return the factorization of x.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_685factor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_684factor[] = "\n        Return the factorization of x.\n        \n        INPUT:\n        \n        \n        -  ``limit`` - (default: -1) is optional and can be set\n           whenever x is of (possibly recursive) rational type. If limit is\n           set return partial factorization, using primes up to limit (up to\n           primelimit if limit=0).\n        \n        \n        proof - (default: True) optional. If False (not the default),\n        returned factors `<10^{15}` may only be pseudoprimes.\n        \n        .. note::\n\n           In the standard PARI/GP interpreter and C-library the\n           factor command *always* has proof=False, so beware!\n        \n        EXAMPLES::\n        \n            >>> pari('x^10-1').factor()\n            [x - 1, 1; x + 1, 1; x^4 - x^3 + x^2 - x + 1, 1; x^4 + x^3 + x^2 + x + 1, 1]\n            >>> pari('2^100-1').factor()\n            [3, 1; 5, 3; 11, 1; 31, 1; 41, 1; 101, 1; 251, 1; 601, 1; 1801, 1; 4051, 1; 8101, 1; 268501, 1]\n            >>> pari('2^100-1').factor(proof=False)\n            [3, 1; 5, 3; 11, 1; 31, 1; 41, 1; 101, 1; 251, 1; 601, 1; 1801, 1; 4051, 1; 8101, 1; 268501, 1]\n        \n        We illustrate setting a limit::\n        \n            >>> (pari(10**50).nextprime()*pari(10**60).nextprime()*pari(10**4).nextprime()).factor(10**5)\n            [10007, 1; 100000000000000000000000000000000000000000000000151000000000700000000000000000000000000000000000000000000001057, 1]\n        \n        PARI doesn't have an algorithm for factoring multivariate\n        polynomials::\n        \n            >>> pari('x^3 - y^3').factor()\n            Traceback (most recent call last):\n            ...\n            PariError:  (7)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_685factor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_limit = 0;
    int __pyx_v_proof;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("factor (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_limit,&__pyx_n_s_proof,0};
      PyObject* values[2] = {0,0};
      values[0] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_limit);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_proof);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8228; __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_limit = values[0];
      if (values[1]) {
        __pyx_v_proof = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_proof == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_proof = ((int)1);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("factor", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.factor", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_684factor(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_limit, __pyx_v_proof);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_684factor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_limit, int __pyx_v_proof) {
    int __pyx_v_r;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_z = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    int __pyx_t_3;
    long __pyx_t_4;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("factor", 0);

    /* "cypari_src/gen.pyx":8272
 *         """
 *         cdef int r
 *         if limit == -1 and typ(self.g) == t_INT and proof:             # <<<<<<<<<<<<<<
 *             global avma, stack_mark
 *             sig_on()
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_limit, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_3 = ((typ(__pyx_v_self->g) == t_INT) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_proof != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L4_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":8274
 *         if limit == -1 and typ(self.g) == t_INT and proof:
 *             global avma, stack_mark
 *             sig_on()             # <<<<<<<<<<<<<<
 *             set_mark()
 *             r = factorint_withproof_sage(&t0, self.g, ten_to_15)
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":8275
 *             global avma, stack_mark
 *             sig_on()
 *             set_mark()             # <<<<<<<<<<<<<<
 *             r = factorint_withproof_sage(&t0, self.g, ten_to_15)
 *             z = P.new_gen(t0)
 */
      __pyx_f_10cypari_src_3gen_set_mark();

      /* "cypari_src/gen.pyx":8276
 *             sig_on()
 *             set_mark()
 *             r = factorint_withproof_sage(&t0, self.g, ten_to_15)             # <<<<<<<<<<<<<<
 *             z = P.new_gen(t0)
 *             avma = stack_mark
 */
      __pyx_v_r = factorint_withproof_sage((&__pyx_v_10cypari_src_3gen_t0), __pyx_v_self->g, __pyx_v_10cypari_src_3gen_ten_to_15);

      /* "cypari_src/gen.pyx":8277
 *             set_mark()
 *             r = factorint_withproof_sage(&t0, self.g, ten_to_15)
 *             z = P.new_gen(t0)             # <<<<<<<<<<<<<<
 *             avma = stack_mark
 *             if not r:
 */
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_v_10cypari_src_3gen_t0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_z = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cypari_src/gen.pyx":8278
 *             r = factorint_withproof_sage(&t0, self.g, ten_to_15)
 *             z = P.new_gen(t0)
 *             avma = stack_mark             # <<<<<<<<<<<<<<
 *             if not r:
 *                 return z
 */
      avma = __pyx_v_10cypari_src_3gen_stack_mark;

      /* "cypari_src/gen.pyx":8279
 *             z = P.new_gen(t0)
 *             avma = stack_mark
 *             if not r:             # <<<<<<<<<<<<<<
 *                 return z
 *             else:
 */
      __pyx_t_1 = ((!(__pyx_v_r != 0)) != 0);
      if (__pyx_t_1) {

        /* "cypari_src/gen.pyx":8280
 *             avma = stack_mark
 *             if not r:
 *                 return z             # <<<<<<<<<<<<<<
 *             else:
 *                 return _factor_int_when_pari_factor_failed(self, z)
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(((PyObject *)__pyx_v_z));
        __pyx_r = ((PyObject *)__pyx_v_z);
        goto __pyx_L0;
      }
      /*else*/ {

        /* "cypari_src/gen.pyx":8282
 *                 return z
 *             else:
 *                 return _factor_int_when_pari_factor_failed(self, z)             # <<<<<<<<<<<<<<
 *         else:
 *             sig_on()
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __pyx_f_10cypari_src_3gen__factor_int_when_pari_factor_failed(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_z)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
      }
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":8284
 *                 return _factor_int_when_pari_factor_failed(self, z)
 *         else:
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return P.new_gen(factor0(self.g, limit))
 * 
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":8285
 *         else:
 *             sig_on()
 *             return P.new_gen(factor0(self.g, limit))             # <<<<<<<<<<<<<<
 * 
 *     ###########################################
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyInt_As_long(__pyx_v_limit); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, factor0(__pyx_v_self->g, __pyx_t_4))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8228
 *     # polarit2.c
 *     ###########################################
 *     def factor(gen self, limit=-1, bint proof=1):             # <<<<<<<<<<<<<<
 *         """
 *         Return the factorization of x.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.factor", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_z);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8291
 *     ###########################################
 * 
 *     def hilbert(x, y, p):             # <<<<<<<<<<<<<<
 *         cdef long ret
 *         t0GEN(y)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_687hilbert(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_687hilbert(PyObject *__pyx_v_x, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_y = 0;
    PyObject *__pyx_v_p = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("hilbert (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_p,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_y)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("hilbert", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8291; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hilbert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8291; __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_y = values[0];
      __pyx_v_p = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("hilbert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8291; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.hilbert", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_686hilbert(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_x), __pyx_v_y, __pyx_v_p);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_686hilbert(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_p) {
    long __pyx_v_ret;
    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("hilbert", 0);

    /* "cypari_src/gen.pyx":8293
 *     def hilbert(x, y, p):
 *         cdef long ret
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         t1GEN(p)
 *         sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8294
 *         cdef long ret
 *         t0GEN(y)
 *         t1GEN(p)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         ret = hilbert0(x.g, t0, t1)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8295
 *         t0GEN(y)
 *         t1GEN(p)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         ret = hilbert0(x.g, t0, t1)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8296
 *         t1GEN(p)
 *         sig_on()
 *         ret = hilbert0(x.g, t0, t1)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return ret
 */
    __pyx_v_ret = hilbert(__pyx_v_x->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1);

    /* "cypari_src/gen.pyx":8297
 *         sig_on()
 *         ret = hilbert0(x.g, t0, t1)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":8298
 *         ret = hilbert0(x.g, t0, t1)
 *         sig_off()
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def chinese(self, y):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_ret); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8291
 *     ###########################################
 * 
 *     def hilbert(x, y, p):             # <<<<<<<<<<<<<<
 *         cdef long ret
 *         t0GEN(y)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.hilbert", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8300
 *         return ret
 * 
 *     def chinese(self, y):             # <<<<<<<<<<<<<<
 *         t0GEN(y)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_689chinese(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_689chinese(PyObject *__pyx_v_self, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("chinese (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_688chinese(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_688chinese(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y) {
    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("chinese", 0);

    /* "cypari_src/gen.pyx":8301
 * 
 *     def chinese(self, y):
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(chinese(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8302
 *     def chinese(self, y):
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(chinese(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8303
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(chinese(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def order(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, chinese(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8300
 *         return ret
 * 
 *     def chinese(self, y):             # <<<<<<<<<<<<<<
 *         t0GEN(y)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.chinese", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8305
 *         return P.new_gen(chinese(self.g, t0))
 * 
 *     def order(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(order(self.g))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_691order(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_691order(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("order (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_690order(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_690order(struct __pyx_obj_10cypari_src_3gen_gen *__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("order", 0);

    /* "cypari_src/gen.pyx":8306
 * 
 *     def order(self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(order(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8307
 *     def order(self):
 *         sig_on()
 *         return P.new_gen(order(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def znprimroot(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, order(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8305
 *         return P.new_gen(chinese(self.g, t0))
 * 
 *     def order(self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(order(self.g))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.order", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8309
 *         return P.new_gen(order(self.g))
 * 
 *     def znprimroot(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a primitive root modulo self, whenever it exists.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_693znprimroot(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_692znprimroot[] = "\n        Return a primitive root modulo self, whenever it exists.\n        \n        This is a generator of the group `(\\ZZ/n\\ZZ)^*`, whenever\n        this group is cyclic, i.e. if `n=4` or `n=p^k` or\n        `n=2p^k`, where `p` is an odd prime and `k`\n        is a natural number.\n        \n        INPUT:\n        \n        \n        -  ``self`` - positive integer equal to 4, or a power\n           of an odd prime, or twice a power of an odd prime\n        \n        \n        OUTPUT: gen\n        \n        EXAMPLES::\n        \n            >>> pari(4).znprimroot()\n            Mod(3, 4)\n            >>> pari('10007^3').znprimroot()\n            Mod(5, 1002101470343)\n            >>> pari('2*109^10').znprimroot()\n            Mod(236736367459211723407, 473472734918423446802)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_693znprimroot(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("znprimroot (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_692znprimroot(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_692znprimroot(struct __pyx_obj_10cypari_src_3gen_gen *__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("znprimroot", 0);

    /* "cypari_src/gen.pyx":8336
 *             Mod(236736367459211723407, 473472734918423446802)
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(znprimroot0(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8337
 *         """
 *         sig_on()
 *         return P.new_gen(znprimroot0(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def __abs__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, znprimroot0(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8309
 *         return P.new_gen(order(self.g))
 * 
 *     def znprimroot(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a primitive root modulo self, whenever it exists.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.znprimroot", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8339
 *         return P.new_gen(znprimroot0(self.g))
 * 
 *     def __abs__(self):             # <<<<<<<<<<<<<<
 *         return self.abs()
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_695__abs__(PyObject *__pyx_v_self); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_695__abs__(PyObject *__pyx_v_self) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__abs__ (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_694__abs__(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

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

    /* "cypari_src/gen.pyx":8340
 * 
 *     def __abs__(self):
 *         return self.abs()             # <<<<<<<<<<<<<<
 * 
 *     def norm(gen self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8339
 *         return P.new_gen(znprimroot0(self.g))
 * 
 *     def __abs__(self):             # <<<<<<<<<<<<<<
 *         return self.abs()
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.__abs__", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8342
 *         return self.abs()
 * 
 *     def norm(gen self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gnorm(self.g))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_697norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_697norm(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("norm (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_696norm(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_696norm(struct __pyx_obj_10cypari_src_3gen_gen *__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("norm", 0);

    /* "cypari_src/gen.pyx":8343
 * 
 *     def norm(gen self):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gnorm(self.g))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8344
 *     def norm(gen self):
 *         sig_on()
 *         return P.new_gen(gnorm(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def nextprime(gen self, bint add_one=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gnorm(__pyx_v_self->g))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8342
 *         return self.abs()
 * 
 *     def norm(gen self):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gnorm(self.g))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8346
 *         return P.new_gen(gnorm(self.g))
 * 
 *     def nextprime(gen self, bint add_one=0):             # <<<<<<<<<<<<<<
 *         """
 *         nextprime(x): smallest pseudoprime greater than or equal to `x`.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_699nextprime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_698nextprime[] = "\n        nextprime(x): smallest pseudoprime greater than or equal to `x`.\n        If ``add_one`` is non-zero, return the smallest pseudoprime\n        strictly greater than `x`.\n        \n        EXAMPLES::\n        \n            >>> pari(1).nextprime()\n            2\n            >>> pari(2).nextprime()\n            2\n            >>> pari(2).nextprime(add_one = 1)\n            3\n            >>> pari(2**100).nextprime()\n            1267650600228229401496703205653\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_699nextprime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    int __pyx_v_add_one;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nextprime (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_add_one,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_add_one);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nextprime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8346; __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;
        }
      }
      if (values[0]) {
        __pyx_v_add_one = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_add_one == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_add_one = ((int)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("nextprime", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.nextprime", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_698nextprime(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_add_one);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_698nextprime(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, int __pyx_v_add_one) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nextprime", 0);

    /* "cypari_src/gen.pyx":8363
 *             1267650600228229401496703205653
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if add_one:
 *             return P.new_gen(gnextprime(gaddsg(1,self.g)))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8364
 *         """
 *         sig_on()
 *         if add_one:             # <<<<<<<<<<<<<<
 *             return P.new_gen(gnextprime(gaddsg(1,self.g)))
 *         return P.new_gen(gnextprime(self.g))
 */
    __pyx_t_1 = (__pyx_v_add_one != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":8365
 *         sig_on()
 *         if add_one:
 *             return P.new_gen(gnextprime(gaddsg(1,self.g)))             # <<<<<<<<<<<<<<
 *         return P.new_gen(gnextprime(self.g))
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gnextprime(gaddsg(1, __pyx_v_self->g)))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8366
 *         if add_one:
 *             return P.new_gen(gnextprime(gaddsg(1,self.g)))
 *         return P.new_gen(gnextprime(self.g))             # <<<<<<<<<<<<<<
 * 
 *     def change_variable_name(self, var):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gnextprime(__pyx_v_self->g))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8346
 *         return P.new_gen(gnorm(self.g))
 * 
 *     def nextprime(gen self, bint add_one=0):             # <<<<<<<<<<<<<<
 *         """
 *         nextprime(x): smallest pseudoprime greater than or equal to `x`.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.nextprime", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8368
 *         return P.new_gen(gnextprime(self.g))
 * 
 *     def change_variable_name(self, var):             # <<<<<<<<<<<<<<
 *         """
 *         In ``self``, which must be a ``t_POL`` or ``t_SER``, set the
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_701change_variable_name(PyObject *__pyx_v_self, PyObject *__pyx_v_var); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_700change_variable_name[] = "\n        In ``self``, which must be a ``t_POL`` or ``t_SER``, set the\n        variable to ``var``.  If the variable of ``self`` is already\n        ``var``, then return ``self``.\n\n        .. WARNING::\n\n            You should be careful with variable priorities when\n            applying this on a polynomial or series of which the\n            coefficients have polynomial components.  To be safe, only\n            use this function on polynomials with integer or rational\n            coefficients.  For a safer alternative, use :meth:`subst`.\n\n        EXAMPLES::\n        \n            >>> f = pari('x^3 + 17*x + 3')\n            >>> f.change_variable_name(\"y\")\n            y^3 + 17*y + 3\n            >>> f = pari('1 + 2*y + O(y^10)')\n            >>> f.change_variable_name(\"q\")\n            1 + 2*q + O(q^10)\n            >>> f.change_variable_name(\"y\") is f\n            True\n\n        In PARI, ``I`` refers to the square root of -1, so it cannot be\n        used as variable name.  Note the difference with :meth:`subst`::\n\n            >>> f = pari('x^2 + 1')\n            >>> f.change_variable_name(\"I\")\n            Traceback (most recent call last):\n            ...\n            PariError:  (5)\n            >>> f.subst(\"x\", \"I\")\n            0\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_701change_variable_name(PyObject *__pyx_v_self, PyObject *__pyx_v_var) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("change_variable_name (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_700change_variable_name(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_var));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_700change_variable_name(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_var) {
    long __pyx_v_n;
    GEN __pyx_v_z;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("change_variable_name", 0);

    /* "cypari_src/gen.pyx":8404
 *             0
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         cdef long n = P.get_var(var)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8405
 *         """
 *         sig_on()
 *         cdef long n = P.get_var(var)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         if varn(self.g) == n:
 */
    __pyx_v_n = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_var);

    /* "cypari_src/gen.pyx":8406
 *         sig_on()
 *         cdef long n = P.get_var(var)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         if varn(self.g) == n:
 *             return self
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":8407
 *         cdef long n = P.get_var(var)
 *         sig_off()
 *         if varn(self.g) == n:             # <<<<<<<<<<<<<<
 *             return self
 *         if typ(self.g) != t_POL and typ(self.g) != t_SER:
 */
    __pyx_t_1 = ((varn(__pyx_v_self->g) == __pyx_v_n) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":8408
 *         sig_off()
 *         if varn(self.g) == n:
 *             return self             # <<<<<<<<<<<<<<
 *         if typ(self.g) != t_POL and typ(self.g) != t_SER:
 *             raise TypeError("change_variable_name() only works "
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __pyx_r = ((PyObject *)__pyx_v_self);
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8409
 *         if varn(self.g) == n:
 *             return self
 *         if typ(self.g) != t_POL and typ(self.g) != t_SER:             # <<<<<<<<<<<<<<
 *             raise TypeError("change_variable_name() only works "
 *                             "for polynomials or power series")
 */
    __pyx_t_2 = ((typ(__pyx_v_self->g) != t_POL) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = ((typ(__pyx_v_self->g) != t_SER) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":8410
 *             return self
 *         if typ(self.g) != t_POL and typ(self.g) != t_SER:
 *             raise TypeError("change_variable_name() only works "             # <<<<<<<<<<<<<<
 *                             "for polynomials or power series")
 *         # Copy self and then change the variable in place
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8410; __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 = 8410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":8413
 *                             "for polynomials or power series")
 *         # Copy self and then change the variable in place
 *         sig_on()             # <<<<<<<<<<<<<<
 * #        cdef gen newg = P.new_gen(self.g)
 * #        sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8419
 * #        return newg
 * 
 *         cdef GEN z = gcopy(self.g)             # <<<<<<<<<<<<<<
 *         setvarn(z, n)
 *         return P.new_gen(z)
 */
    __pyx_v_z = gcopy(__pyx_v_self->g);

    /* "cypari_src/gen.pyx":8420
 * 
 *         cdef GEN z = gcopy(self.g)
 *         setvarn(z, n)             # <<<<<<<<<<<<<<
 *         return P.new_gen(z)
 * 
 */
    setvarn(__pyx_v_z, __pyx_v_n);

    /* "cypari_src/gen.pyx":8421
 *         cdef GEN z = gcopy(self.g)
 *         setvarn(z, n)
 *         return P.new_gen(z)             # <<<<<<<<<<<<<<
 * 
 *     def subst(self, var, z):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_v_z)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8368
 *         return P.new_gen(gnextprime(self.g))
 * 
 *     def change_variable_name(self, var):             # <<<<<<<<<<<<<<
 *         """
 *         In ``self``, which must be a ``t_POL`` or ``t_SER``, set the
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.change_variable_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8423
 *         return P.new_gen(z)
 * 
 *     def subst(self, var, z):             # <<<<<<<<<<<<<<
 *         """
 *         In ``self``, replace the variable ``var`` by the expression `z`.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_703subst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_702subst[] = "\n        In ``self``, replace the variable ``var`` by the expression `z`.\n\n        EXAMPLES::\n        \n            >>> x = pari(\"x\"); y = pari(\"y\")\n            >>> f = pari('x^3 + 17*x + 3')\n            >>> f.subst(x, y)\n            y^3 + 17*y + 3\n            >>> f.subst(x, \"z\")\n            z^3 + 17*z + 3\n            >>> f.subst(x, \"z\")**2\n            z^6 + 34*z^4 + 6*z^3 + 289*z^2 + 102*z + 9\n            >>> f.subst(x, \"x+1\")\n            x^3 + 3*x^2 + 20*x + 21\n            >>> f.subst(x, \"xyz\")\n            xyz^3 + 17*xyz + 3\n            >>> f.subst(x, \"xyz\")**2\n            xyz^6 + 34*xyz^4 + 6*xyz^3 + 289*xyz^2 + 102*xyz + 9\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_703subst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_var = 0;
    PyObject *__pyx_v_z = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("subst (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_var,&__pyx_n_s_z,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_var)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("subst", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8423; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "subst") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8423; __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_var = values[0];
      __pyx_v_z = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("subst", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8423; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.subst", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_702subst(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_var, __pyx_v_z);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_702subst(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_var, PyObject *__pyx_v_z) {
    long __pyx_v_n;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("subst", 0);

    /* "cypari_src/gen.pyx":8445
 *         """
 *         cdef long n
 *         t0GEN(z)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         n = P.get_var(var)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8446
 *         cdef long n
 *         t0GEN(z)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         n = P.get_var(var)
 *         return P.new_gen(gsubst(self.g, n, t0))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8447
 *         t0GEN(z)
 *         sig_on()
 *         n = P.get_var(var)             # <<<<<<<<<<<<<<
 *         return P.new_gen(gsubst(self.g, n, t0))
 * 
 */
    __pyx_v_n = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_var);

    /* "cypari_src/gen.pyx":8448
 *         sig_on()
 *         n = P.get_var(var)
 *         return P.new_gen(gsubst(self.g, n, t0))             # <<<<<<<<<<<<<<
 * 
 *     def substpol(self, y, z):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gsubst(__pyx_v_self->g, __pyx_v_n, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8423
 *         return P.new_gen(z)
 * 
 *     def subst(self, var, z):             # <<<<<<<<<<<<<<
 *         """
 *         In ``self``, replace the variable ``var`` by the expression `z`.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.subst", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8450
 *         return P.new_gen(gsubst(self.g, n, t0))
 * 
 *     def substpol(self, y, z):             # <<<<<<<<<<<<<<
 *         t0GEN(y)
 *         t1GEN(z)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_705substpol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_705substpol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_y = 0;
    PyObject *__pyx_v_z = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("substpol (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_z,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_y)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("substpol", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "substpol") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8450; __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_y = values[0];
      __pyx_v_z = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("substpol", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.substpol", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_704substpol(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_y, __pyx_v_z);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_704substpol(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y, PyObject *__pyx_v_z) {
    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("substpol", 0);

    /* "cypari_src/gen.pyx":8451
 * 
 *     def substpol(self, y, z):
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         t1GEN(z)
 *         sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8452
 *     def substpol(self, y, z):
 *         t0GEN(y)
 *         t1GEN(z)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(gsubstpol(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8453
 *         t0GEN(y)
 *         t1GEN(z)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(gsubstpol(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8454
 *         t1GEN(z)
 *         sig_on()
 *         return self.new_gen(gsubstpol(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def nf_subst(self, z):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, gsubstpol(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8450
 *         return P.new_gen(gsubst(self.g, n, t0))
 * 
 *     def substpol(self, y, z):             # <<<<<<<<<<<<<<
 *         t0GEN(y)
 *         t1GEN(z)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.substpol", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8456
 *         return self.new_gen(gsubstpol(self.g, t0, t1))
 * 
 *     def nf_subst(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         Given a PARI number field ``self``, return the same PARI
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_707nf_subst(PyObject *__pyx_v_self, PyObject *__pyx_v_z); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_706nf_subst[] = "\n        Given a PARI number field ``self``, return the same PARI\n        number field but in the variable ``z``.\n\n        INPUT:\n\n        - ``self`` -- A PARI number field being the output of ``nfinit()``,\n                      ``bnfinit()`` or ``bnrinit()``.\n\n        EXAMPLES::\n\n            >>> K = pari('x^2 + 5').nfinit()\n\n        We can substitute in a PARI ``nf`` structure::\n\n            >>> K.nf_get_pol()\n            x^2 + 5\n            >>> L = K.nf_subst('a')\n            >>> L.nf_get_pol()\n            a^2 + 5\n\n        We can also substitute in a PARI ``bnf`` structure::\n\n            >>> K = K.bnfinit()\n            >>> K.nf_get_pol()\n            x^2 + 5\n            >>> K.bnf_get_cyc()  # Structure of class group\n            [2]\n            >>> L = K.nf_subst('a')\n            >>> L.nf_get_pol()\n            a^2 + 5\n            >>> L.bnf_get_cyc()  # We still have a bnf after substituting\n            [2]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_707nf_subst(PyObject *__pyx_v_self, PyObject *__pyx_v_z) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nf_subst (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_706nf_subst(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_z));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_706nf_subst(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z) {
    GEN __pyx_v_nf;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    GEN __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nf_subst", 0);

    /* "cypari_src/gen.pyx":8491
 *             [2]
 *         """
 *         cdef GEN nf = self.get_nf()             # <<<<<<<<<<<<<<
 *         t0GEN(z)
 *         sig_on()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_nf(__pyx_v_self); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_nf = __pyx_t_1;

    /* "cypari_src/gen.pyx":8492
 *         """
 *         cdef GEN nf = self.get_nf()
 *         t0GEN(z)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gsubst(self.g, nf_get_varn(nf), t0))
 */
    __pyx_t_2 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":8493
 *         cdef GEN nf = self.get_nf()
 *         t0GEN(z)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gsubst(self.g, nf_get_varn(nf), t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8494
 *         t0GEN(z)
 *         sig_on()
 *         return P.new_gen(gsubst(self.g, nf_get_varn(nf), t0))             # <<<<<<<<<<<<<<
 * 
 *     def taylor(self, v=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gsubst(__pyx_v_self->g, nf_get_varn(__pyx_v_nf), __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8456
 *         return self.new_gen(gsubstpol(self.g, t0, t1))
 * 
 *     def nf_subst(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         Given a PARI number field ``self``, return the same PARI
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.nf_subst", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8496
 *         return P.new_gen(gsubst(self.g, nf_get_varn(nf), t0))
 * 
 *     def taylor(self, v=-1):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(tayl(self.g, self.get_var(v), precdl))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_709taylor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_709taylor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("taylor (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_v);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "taylor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8496; __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_v = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("taylor", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8496; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.taylor", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_708taylor(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_708taylor(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v) {
    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("taylor", 0);

    /* "cypari_src/gen.pyx":8497
 * 
 *     def taylor(self, v=-1):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(tayl(self.g, self.get_var(v), precdl))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8498
 *     def taylor(self, v=-1):
 *         sig_on()
 *         return self.new_gen(tayl(self.g, self.get_var(v), precdl))             # <<<<<<<<<<<<<<
 * 
 *     def thue(self, rhs, ne):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, tayl(__pyx_v_self->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_v), precdl))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8496
 *         return P.new_gen(gsubst(self.g, nf_get_varn(nf), t0))
 * 
 *     def taylor(self, v=-1):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(tayl(self.g, self.get_var(v), precdl))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.taylor", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8500
 *         return self.new_gen(tayl(self.g, self.get_var(v), precdl))
 * 
 *     def thue(self, rhs, ne):             # <<<<<<<<<<<<<<
 *         t0GEN(rhs)
 *         t1GEN(ne)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_711thue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_711thue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_rhs = 0;
    PyObject *__pyx_v_ne = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("thue (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rhs,&__pyx_n_s_ne,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_rhs)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ne)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("thue", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "thue") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8500; __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_rhs = values[0];
      __pyx_v_ne = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("thue", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.thue", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_710thue(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_rhs, __pyx_v_ne);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_710thue(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_rhs, PyObject *__pyx_v_ne) {
    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("thue", 0);

    /* "cypari_src/gen.pyx":8501
 * 
 *     def thue(self, rhs, ne):
 *         t0GEN(rhs)             # <<<<<<<<<<<<<<
 *         t1GEN(ne)
 *         sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_rhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8502
 *     def thue(self, rhs, ne):
 *         t0GEN(rhs)
 *         t1GEN(ne)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(thue(self.g, t0, t1))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_ne); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8503
 *         t0GEN(rhs)
 *         t1GEN(ne)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(thue(self.g, t0, t1))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8504
 *         t1GEN(ne)
 *         sig_on()
 *         return self.new_gen(thue(self.g, t0, t1))             # <<<<<<<<<<<<<<
 * 
 *     def charpoly(self, var=-1, flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, thue(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8500
 *         return self.new_gen(tayl(self.g, self.get_var(v), precdl))
 * 
 *     def thue(self, rhs, ne):             # <<<<<<<<<<<<<<
 *         t0GEN(rhs)
 *         t1GEN(ne)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.thue", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8506
 *         return self.new_gen(thue(self.g, t0, t1))
 * 
 *     def charpoly(self, var=-1, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         charpoly(A,v=x,flag=0): det(v\*Id-A) = characteristic polynomial of
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_713charpoly(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_712charpoly[] = "\n        charpoly(A,v=x,flag=0): det(v\\*Id-A) = characteristic polynomial of\n        A using the comatrix. flag is optional and may be set to 1 (use\n        Lagrange interpolation) or 2 (use Hessenberg form), 0 being the\n        default.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_713charpoly(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_var = 0;
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("charpoly (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_var,&__pyx_n_s_flag,0};
      PyObject* values[2] = {0,0};
      values[0] = ((PyObject *)__pyx_int_neg_1);
      values[1] = ((PyObject *)__pyx_int_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 (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_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "charpoly") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8506; __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_var = values[0];
      __pyx_v_flag = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("charpoly", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8506; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.charpoly", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_712charpoly(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_var, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_712charpoly(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_var, PyObject *__pyx_v_flag) {
    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("charpoly", 0);

    /* "cypari_src/gen.pyx":8513
 *         default.
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(charpoly0(self.g, P.get_var(var), flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8514
 *         """
 *         sig_on()
 *         return P.new_gen(charpoly0(self.g, P.get_var(var), flag))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, charpoly0(__pyx_v_self->g, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_var), __pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8506
 *         return self.new_gen(thue(self.g, t0, t1))
 * 
 *     def charpoly(self, var=-1, flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         charpoly(A,v=x,flag=0): det(v\*Id-A) = characteristic polynomial of
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.charpoly", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8517
 * 
 * 
 *     def kronecker(gen self, y):             # <<<<<<<<<<<<<<
 *         t0GEN(y)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_715kronecker(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_715kronecker(PyObject *__pyx_v_self, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("kronecker (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_714kronecker(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_714kronecker(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y) {
    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("kronecker", 0);

    /* "cypari_src/gen.pyx":8518
 * 
 *     def kronecker(gen self, y):
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return P.new_gen(gkronecker(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8519
 *     def kronecker(gen self, y):
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return P.new_gen(gkronecker(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8520
 *         t0GEN(y)
 *         sig_on()
 *         return P.new_gen(gkronecker(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, gkronecker(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8517
 * 
 * 
 *     def kronecker(gen self, y):             # <<<<<<<<<<<<<<
 *         t0GEN(y)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.kronecker", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8523
 * 
 * 
 *     def type(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the PARI type of self as a string.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_717type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_716type[] = "\n        Return the PARI type of self as a string.\n        \n        .. note::\n\n           In Cython, it is much faster to simply use typ(self.g) for\n           checking PARI types.\n        \n        EXAMPLES::\n        \n            >>> pari(7).type()\n            't_INT'\n            >>> pari('x').type()\n            't_POL'\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_717type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("type (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_716type(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_716type(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self) {
    long __pyx_v_t;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("type", 0);

    /* "cypari_src/gen.pyx":8554
 *         # need to be updated accordingly.
 *         #
 *         cdef long t = typ(self.g)             # <<<<<<<<<<<<<<
 * 
 *         if   t == t_INT:      return 't_INT'
 */
    __pyx_v_t = typ(__pyx_v_self->g);

    /* "cypari_src/gen.pyx":8556
 *         cdef long t = typ(self.g)
 * 
 *         if   t == t_INT:      return 't_INT'             # <<<<<<<<<<<<<<
 *         elif t == t_REAL:     return 't_REAL'
 *         elif t == t_INTMOD:   return 't_INTMOD'
 */
    __pyx_t_1 = ((__pyx_v_t == t_INT) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_INT);
      __pyx_r = __pyx_n_s_t_INT;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8557
 * 
 *         if   t == t_INT:      return 't_INT'
 *         elif t == t_REAL:     return 't_REAL'             # <<<<<<<<<<<<<<
 *         elif t == t_INTMOD:   return 't_INTMOD'
 *         elif t == t_FRAC:     return 't_FRAC'
 */
    __pyx_t_1 = ((__pyx_v_t == t_REAL) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_REAL);
      __pyx_r = __pyx_n_s_t_REAL;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8558
 *         if   t == t_INT:      return 't_INT'
 *         elif t == t_REAL:     return 't_REAL'
 *         elif t == t_INTMOD:   return 't_INTMOD'             # <<<<<<<<<<<<<<
 *         elif t == t_FRAC:     return 't_FRAC'
 *         elif t == t_FFELT:    return 't_FFELT'
 */
    __pyx_t_1 = ((__pyx_v_t == t_INTMOD) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_INTMOD);
      __pyx_r = __pyx_n_s_t_INTMOD;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8559
 *         elif t == t_REAL:     return 't_REAL'
 *         elif t == t_INTMOD:   return 't_INTMOD'
 *         elif t == t_FRAC:     return 't_FRAC'             # <<<<<<<<<<<<<<
 *         elif t == t_FFELT:    return 't_FFELT'
 *         elif t == t_COMPLEX:  return 't_COMPLEX'
 */
    __pyx_t_1 = ((__pyx_v_t == t_FRAC) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_FRAC);
      __pyx_r = __pyx_n_s_t_FRAC;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8560
 *         elif t == t_INTMOD:   return 't_INTMOD'
 *         elif t == t_FRAC:     return 't_FRAC'
 *         elif t == t_FFELT:    return 't_FFELT'             # <<<<<<<<<<<<<<
 *         elif t == t_COMPLEX:  return 't_COMPLEX'
 *         elif t == t_PADIC:    return 't_PADIC'
 */
    __pyx_t_1 = ((__pyx_v_t == t_FFELT) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_FFELT);
      __pyx_r = __pyx_n_s_t_FFELT;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8561
 *         elif t == t_FRAC:     return 't_FRAC'
 *         elif t == t_FFELT:    return 't_FFELT'
 *         elif t == t_COMPLEX:  return 't_COMPLEX'             # <<<<<<<<<<<<<<
 *         elif t == t_PADIC:    return 't_PADIC'
 *         elif t == t_QUAD:     return 't_QUAD'
 */
    __pyx_t_1 = ((__pyx_v_t == t_COMPLEX) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_COMPLEX);
      __pyx_r = __pyx_n_s_t_COMPLEX;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8562
 *         elif t == t_FFELT:    return 't_FFELT'
 *         elif t == t_COMPLEX:  return 't_COMPLEX'
 *         elif t == t_PADIC:    return 't_PADIC'             # <<<<<<<<<<<<<<
 *         elif t == t_QUAD:     return 't_QUAD'
 *         elif t == t_POLMOD:   return 't_POLMOD'
 */
    __pyx_t_1 = ((__pyx_v_t == t_PADIC) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_PADIC);
      __pyx_r = __pyx_n_s_t_PADIC;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8563
 *         elif t == t_COMPLEX:  return 't_COMPLEX'
 *         elif t == t_PADIC:    return 't_PADIC'
 *         elif t == t_QUAD:     return 't_QUAD'             # <<<<<<<<<<<<<<
 *         elif t == t_POLMOD:   return 't_POLMOD'
 *         elif t == t_POL:      return 't_POL'
 */
    __pyx_t_1 = ((__pyx_v_t == t_QUAD) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_QUAD);
      __pyx_r = __pyx_n_s_t_QUAD;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8564
 *         elif t == t_PADIC:    return 't_PADIC'
 *         elif t == t_QUAD:     return 't_QUAD'
 *         elif t == t_POLMOD:   return 't_POLMOD'             # <<<<<<<<<<<<<<
 *         elif t == t_POL:      return 't_POL'
 *         elif t == t_SER:      return 't_SER'
 */
    __pyx_t_1 = ((__pyx_v_t == t_POLMOD) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_POLMOD);
      __pyx_r = __pyx_n_s_t_POLMOD;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8565
 *         elif t == t_QUAD:     return 't_QUAD'
 *         elif t == t_POLMOD:   return 't_POLMOD'
 *         elif t == t_POL:      return 't_POL'             # <<<<<<<<<<<<<<
 *         elif t == t_SER:      return 't_SER'
 *         elif t == t_RFRAC:    return 't_RFRAC'
 */
    __pyx_t_1 = ((__pyx_v_t == t_POL) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_POL);
      __pyx_r = __pyx_n_s_t_POL;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8566
 *         elif t == t_POLMOD:   return 't_POLMOD'
 *         elif t == t_POL:      return 't_POL'
 *         elif t == t_SER:      return 't_SER'             # <<<<<<<<<<<<<<
 *         elif t == t_RFRAC:    return 't_RFRAC'
 *         elif t == t_QFR:      return 't_QFR'
 */
    __pyx_t_1 = ((__pyx_v_t == t_SER) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_SER);
      __pyx_r = __pyx_n_s_t_SER;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8567
 *         elif t == t_POL:      return 't_POL'
 *         elif t == t_SER:      return 't_SER'
 *         elif t == t_RFRAC:    return 't_RFRAC'             # <<<<<<<<<<<<<<
 *         elif t == t_QFR:      return 't_QFR'
 *         elif t == t_QFI:      return 't_QFI'
 */
    __pyx_t_1 = ((__pyx_v_t == t_RFRAC) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_RFRAC);
      __pyx_r = __pyx_n_s_t_RFRAC;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8568
 *         elif t == t_SER:      return 't_SER'
 *         elif t == t_RFRAC:    return 't_RFRAC'
 *         elif t == t_QFR:      return 't_QFR'             # <<<<<<<<<<<<<<
 *         elif t == t_QFI:      return 't_QFI'
 *         elif t == t_VEC:      return 't_VEC'
 */
    __pyx_t_1 = ((__pyx_v_t == t_QFR) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_QFR);
      __pyx_r = __pyx_n_s_t_QFR;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8569
 *         elif t == t_RFRAC:    return 't_RFRAC'
 *         elif t == t_QFR:      return 't_QFR'
 *         elif t == t_QFI:      return 't_QFI'             # <<<<<<<<<<<<<<
 *         elif t == t_VEC:      return 't_VEC'
 *         elif t == t_COL:      return 't_COL'
 */
    __pyx_t_1 = ((__pyx_v_t == t_QFI) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_QFI);
      __pyx_r = __pyx_n_s_t_QFI;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8570
 *         elif t == t_QFR:      return 't_QFR'
 *         elif t == t_QFI:      return 't_QFI'
 *         elif t == t_VEC:      return 't_VEC'             # <<<<<<<<<<<<<<
 *         elif t == t_COL:      return 't_COL'
 *         elif t == t_MAT:      return 't_MAT'
 */
    __pyx_t_1 = ((__pyx_v_t == t_VEC) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_VEC);
      __pyx_r = __pyx_n_s_t_VEC;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8571
 *         elif t == t_QFI:      return 't_QFI'
 *         elif t == t_VEC:      return 't_VEC'
 *         elif t == t_COL:      return 't_COL'             # <<<<<<<<<<<<<<
 *         elif t == t_MAT:      return 't_MAT'
 *         elif t == t_LIST:     return 't_LIST'
 */
    __pyx_t_1 = ((__pyx_v_t == t_COL) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_COL);
      __pyx_r = __pyx_n_s_t_COL;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8572
 *         elif t == t_VEC:      return 't_VEC'
 *         elif t == t_COL:      return 't_COL'
 *         elif t == t_MAT:      return 't_MAT'             # <<<<<<<<<<<<<<
 *         elif t == t_LIST:     return 't_LIST'
 *         elif t == t_STR:      return 't_STR'
 */
    __pyx_t_1 = ((__pyx_v_t == t_MAT) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_MAT);
      __pyx_r = __pyx_n_s_t_MAT;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8573
 *         elif t == t_COL:      return 't_COL'
 *         elif t == t_MAT:      return 't_MAT'
 *         elif t == t_LIST:     return 't_LIST'             # <<<<<<<<<<<<<<
 *         elif t == t_STR:      return 't_STR'
 *         elif t == t_VECSMALL: return 't_VECSMALL'
 */
    __pyx_t_1 = ((__pyx_v_t == t_LIST) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_LIST);
      __pyx_r = __pyx_n_s_t_LIST;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8574
 *         elif t == t_MAT:      return 't_MAT'
 *         elif t == t_LIST:     return 't_LIST'
 *         elif t == t_STR:      return 't_STR'             # <<<<<<<<<<<<<<
 *         elif t == t_VECSMALL: return 't_VECSMALL'
 *         elif t == t_CLOSURE:  return 't_CLOSURE'
 */
    __pyx_t_1 = ((__pyx_v_t == t_STR) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_STR);
      __pyx_r = __pyx_n_s_t_STR;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8575
 *         elif t == t_LIST:     return 't_LIST'
 *         elif t == t_STR:      return 't_STR'
 *         elif t == t_VECSMALL: return 't_VECSMALL'             # <<<<<<<<<<<<<<
 *         elif t == t_CLOSURE:  return 't_CLOSURE'
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_t == t_VECSMALL) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_VECSMALL);
      __pyx_r = __pyx_n_s_t_VECSMALL;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8576
 *         elif t == t_STR:      return 't_STR'
 *         elif t == t_VECSMALL: return 't_VECSMALL'
 *         elif t == t_CLOSURE:  return 't_CLOSURE'             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError, "Unknown PARI type: %s"%t
 */
    __pyx_t_1 = ((__pyx_v_t == t_CLOSURE) != 0);
    if (__pyx_t_1) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_t_CLOSURE);
      __pyx_r = __pyx_n_s_t_CLOSURE;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":8578
 *         elif t == t_CLOSURE:  return 't_CLOSURE'
 *         else:
 *             raise TypeError, "Unknown PARI type: %s"%t             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_PARI_type_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_3, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":8523
 * 
 * 
 *     def type(gen self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the PARI type of self as a string.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.gen.type", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8581
 * 
 * 
 *     def polinterpolate(self, ya, x):             # <<<<<<<<<<<<<<
 *         """
 *         self.polinterpolate(ya,x,e): polynomial interpolation at x
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_719polinterpolate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_718polinterpolate[] = "\n        self.polinterpolate(ya,x,e): polynomial interpolation at x\n        according to data vectors self, ya (i.e. return P such that\n        P(self[i]) = ya[i] for all i). Also return an error estimate on the\n        returned value.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_719polinterpolate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_ya = 0;
    PyObject *__pyx_v_x = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polinterpolate (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ya,&__pyx_n_s_x,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_ya)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("polinterpolate", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polinterpolate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8581; __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_ya = values[0];
      __pyx_v_x = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polinterpolate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.polinterpolate", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_718polinterpolate(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_ya, __pyx_v_x);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_718polinterpolate(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_ya, PyObject *__pyx_v_x) {
    GEN __pyx_v_dy;
    GEN __pyx_v_g;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_dif = NULL;
    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("polinterpolate", 0);

    /* "cypari_src/gen.pyx":8588
 *         returned value.
 *         """
 *         t0GEN(ya)             # <<<<<<<<<<<<<<
 *         t1GEN(x)
 *         cdef GEN dy, g
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_ya); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8589
 *         """
 *         t0GEN(ya)
 *         t1GEN(x)             # <<<<<<<<<<<<<<
 *         cdef GEN dy, g
 *         sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8591
 *         t1GEN(x)
 *         cdef GEN dy, g
 *         sig_on()             # <<<<<<<<<<<<<<
 *         g = polint(self.g, t0, t1, &dy)
 *         dif = self.new_gen_noclear(dy)
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8592
 *         cdef GEN dy, g
 *         sig_on()
 *         g = polint(self.g, t0, t1, &dy)             # <<<<<<<<<<<<<<
 *         dif = self.new_gen_noclear(dy)
 *         return self.new_gen(g), dif
 */
    __pyx_v_g = polint(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_10cypari_src_3gen_t1, (&__pyx_v_dy));

    /* "cypari_src/gen.pyx":8593
 *         sig_on()
 *         g = polint(self.g, t0, t1, &dy)
 *         dif = self.new_gen_noclear(dy)             # <<<<<<<<<<<<<<
 *         return self.new_gen(g), dif
 * 
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen_noclear(__pyx_v_self, __pyx_v_dy)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dif = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8594
 *         g = polint(self.g, t0, t1, &dy)
 *         dif = self.new_gen_noclear(dy)
 *         return self.new_gen(g), dif             # <<<<<<<<<<<<<<
 * 
 *     def algdep(self, long n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, __pyx_v_g)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8594; __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_INCREF(((PyObject *)__pyx_v_dif));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_dif));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_dif));
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8581
 * 
 * 
 *     def polinterpolate(self, ya, x):             # <<<<<<<<<<<<<<
 *         """
 *         self.polinterpolate(ya,x,e): polynomial interpolation at x
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.polinterpolate", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_dif);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8596
 *         return self.new_gen(g), dif
 * 
 *     def algdep(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         EXAMPLES::
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_721algdep(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_720algdep[] = "\n        EXAMPLES::\n        \n            >>> n = pari.set_real_precision(210)\n            >>> w1 = pari('z1=2-sqrt(26); (z1+I)/(z1-I)')\n            >>> f = w1.algdep(12); f\n            545*x^11 - 297*x^10 - 281*x^9 + 48*x^8 - 168*x^7 + 690*x^6 - 168*x^5 + 48*x^4 - 281*x^3 - 297*x^2 + 545*x\n            >>> f(w1).abs() < 1.0e-200\n            True\n            >>> f.factor()\n            [x, 1; x + 1, 2; x^2 + 1, 1; x^2 + x + 1, 1; 545*x^4 - 1932*x^3 + 2790*x^2 - 1932*x + 545, 1]\n            >>> pari.set_real_precision(n)\n            210\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_721algdep(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("algdep (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.algdep", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_720algdep(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_720algdep(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("algdep", 0);

    /* "cypari_src/gen.pyx":8611
 *             210
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(algdep(self.g, n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8612
 *         """
 *         sig_on()
 *         return self.new_gen(algdep(self.g, n))             # <<<<<<<<<<<<<<
 * 
 *     def concat(self, y):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, algdep(__pyx_v_self->g, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8596
 *         return self.new_gen(g), dif
 * 
 *     def algdep(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         EXAMPLES::
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.algdep", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8614
 *         return self.new_gen(algdep(self.g, n))
 * 
 *     def concat(self, y):             # <<<<<<<<<<<<<<
 *         t0GEN(y)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_723concat(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_723concat(PyObject *__pyx_v_self, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("concat (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_722concat(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_722concat(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("concat", 0);

    /* "cypari_src/gen.pyx":8615
 * 
 *     def concat(self, y):
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(concat(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8616
 *     def concat(self, y):
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(concat(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8617
 *         t0GEN(y)
 *         sig_on()
 *         return self.new_gen(concat(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def lindep(self, flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, concat(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8614
 *         return self.new_gen(algdep(self.g, n))
 * 
 *     def concat(self, y):             # <<<<<<<<<<<<<<
 *         t0GEN(y)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8619
 *         return self.new_gen(concat(self.g, t0))
 * 
 *     def lindep(self, flag=0):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(lindep0(self.g, flag))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_725lindep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_725lindep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_flag = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("lindep (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_flag);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lindep") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8619; __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_flag = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("lindep", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.lindep", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_724lindep(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_724lindep(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_flag) {
    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("lindep", 0);

    /* "cypari_src/gen.pyx":8620
 * 
 *     def lindep(self, flag=0):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(lindep0(self.g, flag))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8621
 *     def lindep(self, flag=0):
 *         sig_on()
 *         return self.new_gen(lindep0(self.g, flag))             # <<<<<<<<<<<<<<
 * 
 *     def listinsert(self, obj, long n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_flag); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, lindep0(__pyx_v_self->g, __pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8619
 *         return self.new_gen(concat(self.g, t0))
 * 
 *     def lindep(self, flag=0):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(lindep0(self.g, flag))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.gen.lindep", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8623
 *         return self.new_gen(lindep0(self.g, flag))
 * 
 *     def listinsert(self, obj, long n):             # <<<<<<<<<<<<<<
 *         t0GEN(obj)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_727listinsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_727listinsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_obj = 0;
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("listinsert (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_n,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_obj)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("listinsert", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "listinsert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8623; __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_obj = values[0];
      __pyx_v_n = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("listinsert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.listinsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_726listinsert(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_obj, __pyx_v_n);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_726listinsert(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_obj, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("listinsert", 0);

    /* "cypari_src/gen.pyx":8624
 * 
 *     def listinsert(self, obj, long n):
 *         t0GEN(obj)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(listinsert(self.g, t0, n))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8625
 *     def listinsert(self, obj, long n):
 *         t0GEN(obj)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(listinsert(self.g, t0, n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8626
 *         t0GEN(obj)
 *         sig_on()
 *         return self.new_gen(listinsert(self.g, t0, n))             # <<<<<<<<<<<<<<
 * 
 *     def listput(self, obj, long n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, listinsert(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8623
 *         return self.new_gen(lindep0(self.g, flag))
 * 
 *     def listinsert(self, obj, long n):             # <<<<<<<<<<<<<<
 *         t0GEN(obj)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.listinsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8628
 *         return self.new_gen(listinsert(self.g, t0, n))
 * 
 *     def listput(self, obj, long n):             # <<<<<<<<<<<<<<
 *         t0GEN(obj)
 *         sig_on()
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_729listput(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_729listput(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_obj = 0;
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("listput (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_n,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_obj)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("listput", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8628; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "listput") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8628; __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_obj = values[0];
      __pyx_v_n = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8628; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("listput", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8628; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.listput", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_728listput(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_obj, __pyx_v_n);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_728listput(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_obj, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("listput", 0);

    /* "cypari_src/gen.pyx":8629
 * 
 *     def listput(self, obj, long n):
 *         t0GEN(obj)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(listput(self.g, t0, n))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8630
 *     def listput(self, obj, long n):
 *         t0GEN(obj)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(listput(self.g, t0, n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8631
 *         t0GEN(obj)
 *         sig_on()
 *         return self.new_gen(listput(self.g, t0, n))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, listput(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8628
 *         return self.new_gen(listinsert(self.g, t0, n))
 * 
 *     def listput(self, obj, long n):             # <<<<<<<<<<<<<<
 *         t0GEN(obj)
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.listput", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8635
 * 
 * 
 *     def elleisnum(self, long k, int flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         om.elleisnum(k, flag=0): om=[om1,om2] being a 2-component vector
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_731elleisnum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_730elleisnum[] = "\n        om.elleisnum(k, flag=0): om=[om1,om2] being a 2-component vector\n        giving a basis of a lattice L and k an even positive integer,\n        computes the numerical value of the Eisenstein series of weight k.\n        When flag is non-zero and k=4 or 6, this gives g2 or g3 with the\n        correct normalization.\n        \n        INPUT:\n        \n        \n        -  ``om`` - gen, 2-component vector giving a basis of a\n           lattice L\n        \n        -  ``k`` - int (even positive)\n        \n        -  ``flag`` - int (default 0)\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - numerical value of E_k\n        \n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit()\n            >>> om = e.omega()\n            >>> om\n            [2.49021256085506, -1.97173770155165*I]\n            >>> om.elleisnum(2) # was:  -5.28864933965426\n            10.0672605281120\n            >>> om.elleisnum(4)\n            112.000000000000\n            >>> om.elleisnum(100)\n            2.15314248576078 E50\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_731elleisnum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_k;
    int __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("elleisnum (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_flag,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_k)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "elleisnum") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8635; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_k = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_k == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8635; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      if (values[1]) {
        __pyx_v_flag = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8635; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((int)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("elleisnum", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8635; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.elleisnum", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_730elleisnum(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_k, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_730elleisnum(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_k, int __pyx_v_flag) {
    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("elleisnum", 0);

    /* "cypari_src/gen.pyx":8673
 *             2.15314248576078 E50
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         # the argument prec has no effect
 *         return self.new_gen(elleisnum(self.g, k, flag, prec))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8675
 *         sig_on()
 *         # the argument prec has no effect
 *         return self.new_gen(elleisnum(self.g, k, flag, prec))             # <<<<<<<<<<<<<<
 * 
 *     def ellwp(gen self, z='z', long n=20, long flag=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, elleisnum(__pyx_v_self->g, __pyx_v_k, __pyx_v_flag, __pyx_v_10cypari_src_3gen_prec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8635
 * 
 * 
 *     def elleisnum(self, long k, int flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         om.elleisnum(k, flag=0): om=[om1,om2] being a 2-component vector
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.elleisnum", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8677
 *         return self.new_gen(elleisnum(self.g, k, flag, prec))
 * 
 *     def ellwp(gen self, z='z', long n=20, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value or the series expansion of the Weierstrass
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_733ellwp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_732ellwp[] = "\n        Return the value or the series expansion of the Weierstrass\n        `P`-function at `z` on the lattice `self` (or the lattice\n        defined by the elliptic curve `self`).\n        \n        INPUT:\n        \n        -  ``self`` -- an elliptic curve created using ``ellinit`` or a\n           list ``[om1, om2]`` representing generators for a lattice.\n        \n        -  ``z`` -- (default: 'z') a complex number or a variable name\n           (as string or PARI variable).\n        \n        -  ``n`` -- (default: 20) if 'z' is a variable, compute the\n           series expansion up to at least `O(z^n)`.\n        \n        -  ``flag`` -- (default = 0): If ``flag`` is 0, compute only\n           `P(z)`.  If ``flag`` is 1, compute `[P(z), P'(z)]`.\n        \n        OUTPUT:\n        \n        - `P(z)` (if ``flag`` is 0) or `[P(z), P'(z)]` (if ``flag`` is 1).\n           numbers\n        \n        EXAMPLES:\n        \n        We first define the elliptic curve X_0(11)::\n        \n            >>> E = pari([0,-1,1,-10,-20]).ellinit()\n        \n        Compute P(1)::\n        \n            >>> E.ellwp(1)\n            13.9658695257485 + 0.E-18*I\n        \n        Compute P(1+i), where i = sqrt(-1)::\n        \n            >>> E.ellwp(pari('1+I'))\n            -1.11510682565555 + 2.33419052307470*I\n            >>> E.ellwp(1+1j)\n            -1.11510682565555 + 2.33419052307470*I\n        \n        The series expansion, to the default `O(z^20)` precision::\n        \n            >>> E.ellwp()\n            z^-2 + 31/15*z^2 + 2501/756*z^4 + 961/675*z^6 + 77531/41580*z^8 + 1202285717/928746000*z^10 + 2403461/2806650*z^12 + 30211462703/43418875500*z^14 + 3539374016033/7723451736000*z^16 + 413306031683977/1289540602350000*z^18 + O(z^20)\n        \n        Compute the series for wp to lower precision::\n        \n            >>> E.ellwp(n=4)\n            z^-2 + 31/15*z^2 + O(z^4)\n        \n        Next we use the version where the input is generators for a\n        ""lattice::\n        \n            >>> pari('[1.2692, 0.63 + 1.45*I]').ellwp(1)\n            13.9656146936689 + 0.000644829272810...*I\n        \n        With flag=1, compute the pair P(z) and P'(z)::\n        \n            >>> E.ellwp(1, flag=1)\n            [13.9658695257485 + 0.E-18*I, 50.5619300880073 ... E-18*I]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_733ellwp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_z = 0;
    long __pyx_v_n;
    long __pyx_v_flag;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellwp (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_z,&__pyx_n_s_n,&__pyx_n_s_flag,0};
      PyObject* values[3] = {0,0,0};
      values[0] = ((PyObject *)__pyx_n_s_z);
      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_z);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n);
            if (value) { values[1] = value; kw_args--; }
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellwp") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8677; __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_z = values[0];
      if (values[1]) {
        __pyx_v_n = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8677; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_n = ((long)20);
      }
      if (values[2]) {
        __pyx_v_flag = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_flag == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8677; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_flag = ((long)0);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("ellwp", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8677; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.ellwp", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_732ellwp(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_z, __pyx_v_n, __pyx_v_flag);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_732ellwp(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_z, long __pyx_v_n, long __pyx_v_flag) {
    long __pyx_v_dprec;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    long __pyx_t_3;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("ellwp", 0);

    /* "cypari_src/gen.pyx":8741
 *             [13.9658695257485 + 0.E-18*I, 50.5619300880073 ... E-18*I]
 *         """
 *         t0GEN(z)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         cdef long dprec
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8742
 *         """
 *         t0GEN(z)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         cdef long dprec
 *         dprec = gprecision(t0)
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8744
 *         sig_on()
 *         cdef long dprec
 *         dprec = gprecision(t0)             # <<<<<<<<<<<<<<
 *         if dprec:
 *             dprec = prec_words_to_dec(dprec)
 */
    __pyx_v_dprec = gprecision(__pyx_v_10cypari_src_3gen_t0);

    /* "cypari_src/gen.pyx":8745
 *         cdef long dprec
 *         dprec = gprecision(t0)
 *         if dprec:             # <<<<<<<<<<<<<<
 *             dprec = prec_words_to_dec(dprec)
 *         else:
 */
    __pyx_t_2 = (__pyx_v_dprec != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":8746
 *         dprec = gprecision(t0)
 *         if dprec:
 *             dprec = prec_words_to_dec(dprec)             # <<<<<<<<<<<<<<
 *         else:
 *             dprec = prec
 */
      __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_words_to_dec(__pyx_v_dprec, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_dprec = __pyx_t_3;
      goto __pyx_L3;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":8748
 *             dprec = prec_words_to_dec(dprec)
 *         else:
 *             dprec = prec             # <<<<<<<<<<<<<<
 *         return self.new_gen(ellwp0(self.g, t0, flag, n+2, dprec))
 * 
 */
      __pyx_v_dprec = __pyx_v_10cypari_src_3gen_prec;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":8749
 *         else:
 *             dprec = prec
 *         return self.new_gen(ellwp0(self.g, t0, flag, n+2, dprec))             # <<<<<<<<<<<<<<
 * 
 *     def ellchangepoint(self, y):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ellwp0(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0, __pyx_v_flag, (__pyx_v_n + 2), __pyx_v_dprec))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8677
 *         return self.new_gen(elleisnum(self.g, k, flag, prec))
 * 
 *     def ellwp(gen self, z='z', long n=20, long flag=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value or the series expansion of the Weierstrass
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellwp", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8751
 *         return self.new_gen(ellwp0(self.g, t0, flag, n+2, dprec))
 * 
 *     def ellchangepoint(self, y):             # <<<<<<<<<<<<<<
 *         """
 *         self.ellchangepoint(y): change data on point or vector of points
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_735ellchangepoint(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_734ellchangepoint[] = "\n        self.ellchangepoint(y): change data on point or vector of points\n        self on an elliptic curve according to y=[u,r,s,t]\n        \n        EXAMPLES::\n        \n            >>> e = pari([0,1,1,-2,0]).ellinit()\n            >>> x = pari([1,0])\n            >>> e.ellisoncurve([1,4])\n            False\n            >>> e.ellisoncurve(x)\n            True\n            >>> f = e.ellchangecurve([1,2,3,-1])\n            >>> f[:5]   # show only first five entries\n            [6, -2, -1, 17, 8]\n            >>> x.ellchangepoint([1,2,3,-1])\n            [-1, 4]\n            >>> f.ellisoncurve([-1,4])\n            True\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_735ellchangepoint(PyObject *__pyx_v_self, PyObject *__pyx_v_y) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("ellchangepoint (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_734ellchangepoint(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), ((PyObject *)__pyx_v_y));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_734ellchangepoint(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_y) {
    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("ellchangepoint", 0);

    /* "cypari_src/gen.pyx":8772
 *             True
 *         """
 *         t0GEN(y)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(ellchangepoint(self.g, t0))
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8773
 *         """
 *         t0GEN(y)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(ellchangepoint(self.g, t0))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8774
 *         t0GEN(y)
 *         sig_on()
 *         return self.new_gen(ellchangepoint(self.g, t0))             # <<<<<<<<<<<<<<
 * 
 *     def debug(gen self, long depth = -1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, ellchangepoint(__pyx_v_self->g, __pyx_v_10cypari_src_3gen_t0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8751
 *         return self.new_gen(ellwp0(self.g, t0, flag, n+2, dprec))
 * 
 *     def ellchangepoint(self, y):             # <<<<<<<<<<<<<<
 *         """
 *         self.ellchangepoint(y): change data on point or vector of points
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.ellchangepoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8776
 *         return self.new_gen(ellchangepoint(self.g, t0))
 * 
 *     def debug(gen self, long depth = -1):             # <<<<<<<<<<<<<<
 *         r"""
 *         Show the internal structure of self (like the ``\x`` command in gp).
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_737debug(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_3gen_736debug[] = "\n        Show the internal structure of self (like the ``\\x`` command in gp).\n\n        EXAMPLE::\n\n            >>> pari('[1/2, 1.0*I]').debug()  # doctest: +SKIP\n            [&=0000000004c5f010] VEC(lg=3):2200000000000003 0000000004c5eff8 0000000004c5efb0\n              1st component = [&=0000000004c5eff8] FRAC(lg=3):0800000000000003 0000000004c5efe0 0000000004c5efc8\n                num = [&=0000000004c5efe0] INT(lg=3):0200000000000003 (+,lgefint=3):4000000000000003 0000000000000001\n                den = [&=0000000004c5efc8] INT(lg=3):0200000000000003 (+,lgefint=3):4000000000000003 0000000000000002\n              2nd component = [&=0000000004c5efb0] COMPLEX(lg=3):0c00000000000003 00007fae8a2eb840 0000000004c5ef90\n                real = gen_0\n                imag = [&=0000000004c5ef90] REAL(lg=4):0400000000000004 (+,expo=0):6000000000000000 8000000000000000 0000000000000000\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_3gen_737debug(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_depth;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("debug (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depth,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_depth);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "debug") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8776; __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;
        }
      }
      if (values[0]) {
        __pyx_v_depth = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_depth == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8776; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_depth = ((long)-1);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("debug", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8776; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.gen.debug", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_3gen_736debug(((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_self), __pyx_v_depth);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_3gen_736debug(struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, long __pyx_v_depth) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("debug", 0);

    /* "cypari_src/gen.pyx":8791
 *                 imag = [&=0000000004c5ef90] REAL(lg=4):0400000000000004 (+,expo=0):6000000000000000 8000000000000000 0000000000000000
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         dbgGEN(self.g, depth)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":8792
 *         """
 *         sig_on()
 *         dbgGEN(self.g, depth)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return
 */
    dbgGEN(__pyx_v_self->g, __pyx_v_depth);

    /* "cypari_src/gen.pyx":8793
 *         sig_on()
 *         dbgGEN(self.g, depth)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":8794
 *         dbgGEN(self.g, depth)
 *         sig_off()
 *         return             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8776
 *         return self.new_gen(ellchangepoint(self.g, t0))
 * 
 *     def debug(gen self, long depth = -1):             # <<<<<<<<<<<<<<
 *         r"""
 *         Show the internal structure of self (like the ``\x`` command in gp).
 */

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

  /* "cypari_src/gen.pyx":8801
 *     # classes that derive from gen.
 *     ##################################################
 *     cdef gen pari(self, object x):             # <<<<<<<<<<<<<<
 *         return pari(x)
 * 
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_3gen_pari(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_x) {
    struct __pyx_obj_10cypari_src_3gen_gen *__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("pari", 0);

    /* "cypari_src/gen.pyx":8802
 *     ##################################################
 *     cdef gen pari(self, object x):
 *         return pari(x)             # <<<<<<<<<<<<<<
 * 
 *     cdef gen new_gen(self, GEN x):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8801
 *     # classes that derive from gen.
 *     ##################################################
 *     cdef gen pari(self, object x):             # <<<<<<<<<<<<<<
 *         return pari(x)
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.gen.pari", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8804
 *         return pari(x)
 * 
 *     cdef gen new_gen(self, GEN x):             # <<<<<<<<<<<<<<
 *         return P.new_gen(x)
 * 
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_3gen_new_gen(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, GEN __pyx_v_x) {
    struct __pyx_obj_10cypari_src_3gen_gen *__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("new_gen", 0);

    /* "cypari_src/gen.pyx":8805
 * 
 *     cdef gen new_gen(self, GEN x):
 *         return P.new_gen(x)             # <<<<<<<<<<<<<<
 * 
 *     cdef gen new_leaf_gen(self, GEN x):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen(__pyx_v_10cypari_src_3gen_P, __pyx_v_x)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8804
 *         return pari(x)
 * 
 *     cdef gen new_gen(self, GEN x):             # <<<<<<<<<<<<<<
 *         return P.new_gen(x)
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.new_gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8807
 *         return P.new_gen(x)
 * 
 *     cdef gen new_leaf_gen(self, GEN x):             # <<<<<<<<<<<<<<
 *         return P.new_leaf_gen(x)
 * 
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_3gen_new_leaf_gen(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, GEN __pyx_v_x) {
    struct __pyx_obj_10cypari_src_3gen_gen *__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("new_leaf_gen", 0);

    /* "cypari_src/gen.pyx":8808
 * 
 *     cdef gen new_leaf_gen(self, GEN x):
 *         return P.new_leaf_gen(x)             # <<<<<<<<<<<<<<
 * 
 *     cdef gen new_gen_noclear(self, GEN x):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_leaf_gen(__pyx_v_10cypari_src_3gen_P, __pyx_v_x)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8807
 *         return P.new_gen(x)
 * 
 *     cdef gen new_leaf_gen(self, GEN x):             # <<<<<<<<<<<<<<
 *         return P.new_leaf_gen(x)
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.new_leaf_gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8810
 *         return P.new_leaf_gen(x)
 * 
 *     cdef gen new_gen_noclear(self, GEN x):             # <<<<<<<<<<<<<<
 *         return P.new_gen_noclear(x)
 * 
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_3gen_new_gen_noclear(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, GEN __pyx_v_x) {
    struct __pyx_obj_10cypari_src_3gen_gen *__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("new_gen_noclear", 0);

    /* "cypari_src/gen.pyx":8811
 * 
 *     cdef gen new_gen_noclear(self, GEN x):
 *         return P.new_gen_noclear(x)             # <<<<<<<<<<<<<<
 * 
 *     cdef GEN _deepcopy_to_python_heap(self, GEN x, pari_sp* address, pari_sp prior_sp):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->new_gen_noclear(__pyx_v_10cypari_src_3gen_P, __pyx_v_x)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8810
 *         return P.new_leaf_gen(x)
 * 
 *     cdef gen new_gen_noclear(self, GEN x):             # <<<<<<<<<<<<<<
 *         return P.new_gen_noclear(x)
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.gen.new_gen_noclear", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8813
 *         return P.new_gen_noclear(x)
 * 
 *     cdef GEN _deepcopy_to_python_heap(self, GEN x, pari_sp* address, pari_sp prior_sp):             # <<<<<<<<<<<<<<
 *         return P.deepcopy_to_python_heap(x, address, prior_sp)
 * 
 */

  static GEN __pyx_f_10cypari_src_3gen_3gen__deepcopy_to_python_heap(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, GEN __pyx_v_x, pari_sp *__pyx_v_address, pari_sp __pyx_v_prior_sp) {
    GEN __pyx_r;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("_deepcopy_to_python_heap", 0);

    /* "cypari_src/gen.pyx":8814
 * 
 *     cdef GEN _deepcopy_to_python_heap(self, GEN x, pari_sp* address, pari_sp prior_sp):
 *         return P.deepcopy_to_python_heap(x, address, prior_sp)             # <<<<<<<<<<<<<<
 * 
 *     cdef long get_var(self, v) except -2:
 */
    __pyx_r = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->deepcopy_to_python_heap(__pyx_v_10cypari_src_3gen_P, __pyx_v_x, __pyx_v_address, __pyx_v_prior_sp);
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8813
 *         return P.new_gen_noclear(x)
 * 
 *     cdef GEN _deepcopy_to_python_heap(self, GEN x, pari_sp* address, pari_sp prior_sp):             # <<<<<<<<<<<<<<
 *         return P.deepcopy_to_python_heap(x, address, prior_sp)
 * 
 */

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

  /* "cypari_src/gen.pyx":8816
 *         return P.deepcopy_to_python_heap(x, address, prior_sp)
 * 
 *     cdef long get_var(self, v) except -2:             # <<<<<<<<<<<<<<
 *         return P.get_var(v)
 * 
 */

  static long __pyx_f_10cypari_src_3gen_3gen_get_var(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_self, PyObject *__pyx_v_v) {
    long __pyx_r;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("get_var", 0);

    /* "cypari_src/gen.pyx":8817
 * 
 *     cdef long get_var(self, v) except -2:
 *         return P.get_var(v)             # <<<<<<<<<<<<<<
 * 
 * cdef unsigned long num_primes
 */
    __pyx_r = ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_P->__pyx_vtab)->get_var(__pyx_v_10cypari_src_3gen_P, __pyx_v_v);
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8816
 *         return P.deepcopy_to_python_heap(x, address, prior_sp)
 * 
 *     cdef long get_var(self, v) except -2:             # <<<<<<<<<<<<<<
 *         return P.get_var(v)
 * 
 */

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

  /* "cypari_src/gen.pyx":8828
 *     ctypedef char* const_char_star "const char*"
 * 
 * cdef void py_putchar(char c):             # <<<<<<<<<<<<<<
 *     cdef char s[2]
 *     s[0] = c
 */

  static void __pyx_f_10cypari_src_3gen_py_putchar(char __pyx_v_c) {
    char __pyx_v_s[2];
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *__pyx_t_7 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("py_putchar", 0);

    /* "cypari_src/gen.pyx":8830
 * cdef void py_putchar(char c):
 *     cdef char s[2]
 *     s[0] = c             # <<<<<<<<<<<<<<
 *     s[1] = 0
 *     sys.stdout.write(chars_to_str(s))
 */
    (__pyx_v_s[0]) = __pyx_v_c;

    /* "cypari_src/gen.pyx":8831
 *     cdef char s[2]
 *     s[0] = c
 *     s[1] = 0             # <<<<<<<<<<<<<<
 *     sys.stdout.write(chars_to_str(s))
 * 
 */
    (__pyx_v_s[1]) = 0;

    /* "cypari_src/gen.pyx":8832
 *     s[0] = c
 *     s[1] = 0
 *     sys.stdout.write(chars_to_str(s))             # <<<<<<<<<<<<<<
 * 
 * # allow exceptions by having it return a python object.
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_chars_to_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8828
 *     ctypedef char* const_char_star "const char*"
 * 
 * cdef void py_putchar(char c):             # <<<<<<<<<<<<<<
 *     cdef char s[2]
 *     s[0] = c
 */

    /* function exit code */
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_WriteUnraisable("cypari_src.gen.py_putchar", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
    __pyx_L0:;
    __Pyx_RefNannyFinishContext();
  }

  /* "cypari_src/gen.pyx":8835
 * 
 * # allow exceptions by having it return a python object.
 * cdef py_puts(const_char_star s):             # <<<<<<<<<<<<<<
 *     sys.stdout.write(chars_to_str(s))
 * 
 */

  static PyObject *__pyx_f_10cypari_src_3gen_py_puts(const char* __pyx_v_s) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *__pyx_t_7 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("py_puts", 0);

    /* "cypari_src/gen.pyx":8836
 * # allow exceptions by having it return a python object.
 * cdef py_puts(const_char_star s):
 *     sys.stdout.write(chars_to_str(s))             # <<<<<<<<<<<<<<
 * 
 * cdef void py_flush():
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_chars_to_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8835
 * 
 * # allow exceptions by having it return a python object.
 * cdef py_puts(const_char_star s):             # <<<<<<<<<<<<<<
 *     sys.stdout.write(chars_to_str(s))
 * 
 */

    /* function exit code */
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_AddTraceback("cypari_src.gen.py_puts", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8838
 *     sys.stdout.write(chars_to_str(s))
 * 
 * cdef void py_flush():             # <<<<<<<<<<<<<<
 *     sys.stdout.flush()
 * 
 */

  static void __pyx_f_10cypari_src_3gen_py_flush(void) {
    __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("py_flush", 0);

    /* "cypari_src/gen.pyx":8839
 * 
 * cdef void py_flush():
 *     sys.stdout.flush()             # <<<<<<<<<<<<<<
 * 
 * cdef void py_swallow():
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8838
 *     sys.stdout.write(chars_to_str(s))
 * 
 * cdef void py_flush():             # <<<<<<<<<<<<<<
 *     sys.stdout.flush()
 * 
 */

    /* function exit code */
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_WriteUnraisable("cypari_src.gen.py_flush", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
    __pyx_L0:;
    __Pyx_RefNannyFinishContext();
  }

  /* "cypari_src/gen.pyx":8841
 *     sys.stdout.flush()
 * 
 * cdef void py_swallow():             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

  static void __pyx_f_10cypari_src_3gen_py_swallow(void) {
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("py_swallow", 0);

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

  /* "cypari_src/gen.pyx":8846
 * cdef class PariInstance:
 * 
 *     def __init__(self, long size=16000000, unsigned long maxprime=500000):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize the PARI system.
 */

  /* Python wrapper */
  static int __pyx_pw_10cypari_src_3gen_12PariInstance_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance___init__[] = "\n        Initialize the PARI system.\n        \n        INPUT:\n        \n        \n        -  ``size`` - long, the number of bytes for the initial\n           PARI stack (see note below)\n        \n        -  ``maxprime`` - unsigned long, upper limit on a\n           precomputed prime number table (default: 500000)\n        \n        \n        .. note::\n        \n           In py_pari, the PARI stack is different than in gp or the\n           PARI C library. In Python, instead of the PARI stack\n           holding the results of all computations, it *only* holds\n           the results of an individual computation. Each time a new\n           Python/PARI object is computed, it it copied to its own\n           space in the Python heap, and the memory it occupied on the\n           PARI stack is freed. Thus it is not necessary to make the\n           stack very large. Also, unlike in PARI, if the stack does\n           overflow, in most cases the PARI stack is automatically\n           increased and the relevant step of the computation rerun.\n        \n           This design obviously involves some performance penalties\n           over the way PARI works, but it scales much better and is\n           far more robust for large projects.\n        \n        .. note::\n        \n           If you do not want prime numbers, put ``maxprime=2``, but be\n           careful because many PARI functions require this table. If\n           you get the error message \"not enough precomputed primes\",\n           increase this parameter.\n        ";
  #if CYTHON_COMPILING_IN_CPYTHON
  struct wrapperbase __pyx_wrapperbase_10cypari_src_3gen_12PariInstance___init__;
  #endif
  static int __pyx_pw_10cypari_src_3gen_12PariInstance_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_size;
    unsigned long __pyx_v_maxprime;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    int __pyx_r;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_maxprime,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 (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxprime);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8846; __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;
        }
      }
      if (values[0]) {
        __pyx_v_size = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_size == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8846; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_size = ((long)16000000);
      }
      if (values[1]) {
        __pyx_v_maxprime = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_maxprime == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8846; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      } else {
        __pyx_v_maxprime = ((unsigned long)500000);
      }
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8846; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return -1;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance___init__(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_size, __pyx_v_maxprime);

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

  static int __pyx_pf_10cypari_src_3gen_12PariInstance___init__(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_size, unsigned long __pyx_v_maxprime) {
    int __pyx_r;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    struct __pyx_opt_args_10cypari_src_3gen_prec_bits_to_words __pyx_t_4;
    unsigned long __pyx_t_5;
    long __pyx_t_6;
    PyObject *__pyx_t_7 = NULL;
    PyObject *__pyx_t_8 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("__init__", 0);

    /* "cypari_src/gen.pyx":8884
 *            increase this parameter.
 *         """
 *         if bot:             # <<<<<<<<<<<<<<
 *             return  # pari already initialized.
 *         global num_primes, avma, top, bot, prec, global_err_data
 */
    __pyx_t_1 = (bot != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":8885
 *         """
 *         if bot:
 *             return  # pari already initialized.             # <<<<<<<<<<<<<<
 *         global num_primes, avma, top, bot, prec, global_err_data
 *         # If this is not None, it will be called whenever we receive
 */
      __pyx_r = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8891
 *         # GUI to make updates and check for user interrupts during
 *         # a long PARI computation.
 *         self.UI_callback = None             # <<<<<<<<<<<<<<
 * 
 *         # The size here doesn't really matter, because we will allocate
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->UI_callback);
    __Pyx_DECREF(__pyx_v_self->UI_callback);
    __pyx_v_self->UI_callback = Py_None;

    /* "cypari_src/gen.pyx":8895
 *         # The size here doesn't really matter, because we will allocate
 *         # our own stack anyway. We ask PARI not to set up signal handlers.
 *         pari_init_opts(10000, maxprime, INIT_DFTm)             # <<<<<<<<<<<<<<
 *         num_primes = maxprime
 *         # MC - Set the PARI callbacks for error handling
 */
    pari_init_opts(10000, __pyx_v_maxprime, INIT_DFTm);

    /* "cypari_src/gen.pyx":8896
 *         # our own stack anyway. We ask PARI not to set up signal handlers.
 *         pari_init_opts(10000, maxprime, INIT_DFTm)
 *         num_primes = maxprime             # <<<<<<<<<<<<<<
 *         # MC - Set the PARI callbacks for error handling
 *         set_error_handler(&pari_error_handler)
 */
    __pyx_v_10cypari_src_3gen_num_primes = __pyx_v_maxprime;

    /* "cypari_src/gen.pyx":8898
 *         num_primes = maxprime
 *         # MC - Set the PARI callbacks for error handling
 *         set_error_handler(&pari_error_handler)             # <<<<<<<<<<<<<<
 *         set_error_recoverer(&pari_error_recoverer)
 *         # MC - if we were using PARI's signal handler, this would
 */
    set_error_handler((&__pyx_f_10cypari_src_3gen_pari_error_handler));

    /* "cypari_src/gen.pyx":8899
 *         # MC - Set the PARI callbacks for error handling
 *         set_error_handler(&pari_error_handler)
 *         set_error_recoverer(&pari_error_recoverer)             # <<<<<<<<<<<<<<
 *         # MC - if we were using PARI's signal handler, this would
 *         # install our sigint callback.
 */
    set_error_recoverer((&__pyx_f_10cypari_src_3gen_pari_error_recoverer));

    /* "cypari_src/gen.pyx":8910
 * 
 *         # Free the PARI stack and allocate our own (using Cython)
 *         pari_free(<void*>bot); bot = 0             # <<<<<<<<<<<<<<
 *         init_stack(size)
 * 
 */
    pari_free(((void *)bot));
    bot = 0;

    /* "cypari_src/gen.pyx":8911
 *         # Free the PARI stack and allocate our own (using Cython)
 *         pari_free(<void*>bot); bot = 0
 *         init_stack(size)             # <<<<<<<<<<<<<<
 * 
 *         GP_DATA.fmt.prettyp = 0
 */
    __pyx_t_2 = __pyx_f_10cypari_src_3gen_init_stack(__pyx_v_size); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cypari_src/gen.pyx":8913
 *         init_stack(size)
 * 
 *         GP_DATA.fmt.prettyp = 0             # <<<<<<<<<<<<<<
 *         prec = prec_bits_to_words(53)
 *         GP_DATA.fmt.sigd = prec_bits_to_dec(53)
 */
    GP_DATA->fmt->prettyp = 0;

    /* "cypari_src/gen.pyx":8914
 * 
 *         GP_DATA.fmt.prettyp = 0
 *         prec = prec_bits_to_words(53)             # <<<<<<<<<<<<<<
 *         GP_DATA.fmt.sigd = prec_bits_to_dec(53)
 * 
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.prec_in_bits = 53;
    __pyx_t_3 = __pyx_f_10cypari_src_3gen_prec_bits_to_words(0, &__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyInt_As_unsigned_long(__pyx_t_3); if (unlikely((__pyx_t_5 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_10cypari_src_3gen_prec = __pyx_t_5;

    /* "cypari_src/gen.pyx":8915
 *         GP_DATA.fmt.prettyp = 0
 *         prec = prec_bits_to_words(53)
 *         GP_DATA.fmt.sigd = prec_bits_to_dec(53)             # <<<<<<<<<<<<<<
 * 
 *         # Set printing functions
 */
    __pyx_t_3 = __pyx_f_10cypari_src_3gen_prec_bits_to_dec(53, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    GP_DATA->fmt->sigd = __pyx_t_6;

    /* "cypari_src/gen.pyx":8919
 *         # Set printing functions
 *         global pariOut
 *         pariOut = &pari_output             # <<<<<<<<<<<<<<
 *         pariOut.putch = py_putchar
 *         pariOut.puts =  <void(*)(const_char_star)>py_puts
 */
    pariOut = (&__pyx_v_10cypari_src_3gen_pari_output);

    /* "cypari_src/gen.pyx":8920
 *         global pariOut
 *         pariOut = &pari_output
 *         pariOut.putch = py_putchar             # <<<<<<<<<<<<<<
 *         pariOut.puts =  <void(*)(const_char_star)>py_puts
 *         pariOut.flush = py_flush
 */
    pariOut->putch = __pyx_f_10cypari_src_3gen_py_putchar;

    /* "cypari_src/gen.pyx":8921
 *         pariOut = &pari_output
 *         pariOut.putch = py_putchar
 *         pariOut.puts =  <void(*)(const_char_star)>py_puts             # <<<<<<<<<<<<<<
 *         pariOut.flush = py_flush
 *         #sig_off()
 */
    pariOut->puts = ((void (*)(const char*))__pyx_f_10cypari_src_3gen_py_puts);

    /* "cypari_src/gen.pyx":8922
 *         pariOut.putch = py_putchar
 *         pariOut.puts =  <void(*)(const_char_star)>py_puts
 *         pariOut.flush = py_flush             # <<<<<<<<<<<<<<
 *         #sig_off()
 *         self.speak_up()
 */
    pariOut->flush = __pyx_f_10cypari_src_3gen_py_flush;

    /* "cypari_src/gen.pyx":8924
 *         pariOut.flush = py_flush
 *         #sig_off()
 *         self.speak_up()             # <<<<<<<<<<<<<<
 * 
 *     def _unsafe_deallocate_pari_stack(self):
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_speak_up); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cypari_src/gen.pyx":8846
 * cdef class PariInstance:
 * 
 *     def __init__(self, long size=16000000, unsigned long maxprime=500000):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize the PARI system.
 */

    /* function exit code */
    __pyx_r = 0;
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = -1;
    __pyx_L0:;
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8926
 *         self.speak_up()
 * 
 *     def _unsafe_deallocate_pari_stack(self):             # <<<<<<<<<<<<<<
 *         if bot:
 *             PyMem_Free(<void*>bot)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_3_unsafe_deallocate_pari_stack(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_3_unsafe_deallocate_pari_stack(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("_unsafe_deallocate_pari_stack (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_2_unsafe_deallocate_pari_stack(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_2_unsafe_deallocate_pari_stack(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    __Pyx_RefNannySetupContext("_unsafe_deallocate_pari_stack", 0);

    /* "cypari_src/gen.pyx":8927
 * 
 *     def _unsafe_deallocate_pari_stack(self):
 *         if bot:             # <<<<<<<<<<<<<<
 *             PyMem_Free(<void*>bot)
 *         global top, bot
 */
    __pyx_t_1 = (bot != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":8928
 *     def _unsafe_deallocate_pari_stack(self):
 *         if bot:
 *             PyMem_Free(<void*>bot)             # <<<<<<<<<<<<<<
 *         global top, bot
 *         top = 0
 */
      PyMem_Free(((void *)bot));
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":8930
 *             PyMem_Free(<void*>bot)
 *         global top, bot
 *         top = 0             # <<<<<<<<<<<<<<
 *         bot = 0
 *         pari_close()
 */
    top = 0;

    /* "cypari_src/gen.pyx":8931
 *         global top, bot
 *         top = 0
 *         bot = 0             # <<<<<<<<<<<<<<
 *         pari_close()
 * 
 */
    bot = 0;

    /* "cypari_src/gen.pyx":8932
 *         top = 0
 *         bot = 0
 *         pari_close()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    pari_close();

    /* "cypari_src/gen.pyx":8926
 *         self.speak_up()
 * 
 *     def _unsafe_deallocate_pari_stack(self):             # <<<<<<<<<<<<<<
 *         if bot:
 *             PyMem_Free(<void*>bot)
 */

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

  /* "cypari_src/gen.pyx":8934
 *         pari_close()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "Interface to the PARI C library"
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_5__repr__(PyObject *__pyx_v_self); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_5__repr__(PyObject *__pyx_v_self) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_4__repr__(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_4__repr__(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__repr__", 0);

    /* "cypari_src/gen.pyx":8935
 * 
 *     def __repr__(self):
 *         return "Interface to the PARI C library"             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_s_Interface_to_the_PARI_C_library);
    __pyx_r = __pyx_kp_s_Interface_to_the_PARI_C_library;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8934
 *         pari_close()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "Interface to the PARI C library"
 * 
 */

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

  /* "cypari_src/gen.pyx":8937
 *         return "Interface to the PARI C library"
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return 907629390   # hash('pari')
 * 
 */

  /* Python wrapper */
  static Py_hash_t __pyx_pw_10cypari_src_3gen_12PariInstance_7__hash__(PyObject *__pyx_v_self); /*proto*/
  static Py_hash_t __pyx_pw_10cypari_src_3gen_12PariInstance_7__hash__(PyObject *__pyx_v_self) {
    Py_hash_t __pyx_r;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_6__hash__(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static Py_hash_t __pyx_pf_10cypari_src_3gen_12PariInstance_6__hash__(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self) {
    Py_hash_t __pyx_r;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__hash__", 0);

    /* "cypari_src/gen.pyx":8938
 * 
 *     def __hash__(self):
 *         return 907629390   # hash('pari')             # <<<<<<<<<<<<<<
 * 
 *     def abort(self):
 */
    __pyx_r = 907629390;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8937
 *         return "Interface to the PARI C library"
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return 907629390   # hash('pari')
 * 
 */

    /* function exit code */
    __pyx_L0:;
    if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8940
 *         return 907629390   # hash('pari')
 * 
 *     def abort(self):             # <<<<<<<<<<<<<<
 *         """
 *         Abort a long-running pari computation by calling pari_err.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_9abort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_8abort[] = "\n        Abort a long-running pari computation by calling pari_err.\n        This only has effect if the computation is inside of a\n        sig_on - sig_off pair.  It causes a longjmp back to the\n        sig_on, which returns NULL to raise a Python exception.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_9abort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("abort (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_8abort(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_8abort(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("abort", 0);

    /* "cypari_src/gen.pyx":8949
 *         # Actually, we just call our sigint handler
 *         global pari_sigint_handler
 *         pari_sigint_handler()             # <<<<<<<<<<<<<<
 * 
 *     def _set_alarm_handler(self, handler):
 */
    __pyx_f_10cypari_src_3gen_pari_sigint_handler();

    /* "cypari_src/gen.pyx":8940
 *         return 907629390   # hash('pari')
 * 
 *     def abort(self):             # <<<<<<<<<<<<<<
 *         """
 *         Abort a long-running pari computation by calling pari_err.
 */

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

  /* "cypari_src/gen.pyx":8951
 *         pari_sigint_handler()
 * 
 *     def _set_alarm_handler(self, handler):             # <<<<<<<<<<<<<<
 *         """
 *         Set a callback to be called when PARI receives a SIGALRM.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_11_set_alarm_handler(PyObject *__pyx_v_self, PyObject *__pyx_v_handler); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_10_set_alarm_handler[] = "\n        Set a callback to be called when PARI receives a SIGALRM.\n        The handler should be a python function or lambda which\n        requires no arguments.  The handler can call pari.abort()\n        for example.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_11_set_alarm_handler(PyObject *__pyx_v_self, PyObject *__pyx_v_handler) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("_set_alarm_handler (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_10_set_alarm_handler(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((PyObject *)__pyx_v_handler));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_10_set_alarm_handler(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_handler) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("_set_alarm_handler", 0);

    /* "cypari_src/gen.pyx":8959
 *         """
 *         global alarm_handler
 *         alarm_handler = handler             # <<<<<<<<<<<<<<
 * 
 *     def shut_up(self):
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_alarm_handler, __pyx_v_handler) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cypari_src/gen.pyx":8951
 *         pari_sigint_handler()
 * 
 *     def _set_alarm_handler(self, handler):             # <<<<<<<<<<<<<<
 *         """
 *         Set a callback to be called when PARI receives a SIGALRM.
 */

    /* function exit code */
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance._set_alarm_handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8961
 *         alarm_handler = handler
 * 
 *     def shut_up(self):             # <<<<<<<<<<<<<<
 *         global pariErr
 *         pariErr = &pari_error
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_13shut_up(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_13shut_up(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("shut_up (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_12shut_up(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_12shut_up(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("shut_up", 0);

    /* "cypari_src/gen.pyx":8963
 *     def shut_up(self):
 *         global pariErr
 *         pariErr = &pari_error             # <<<<<<<<<<<<<<
 *         pariErr.putch = <void (*)(char)>py_swallow
 *         pariErr.puts = <void (*)(const_char_star)>py_swallow
 */
    pariErr = (&__pyx_v_10cypari_src_3gen_pari_error);

    /* "cypari_src/gen.pyx":8964
 *         global pariErr
 *         pariErr = &pari_error
 *         pariErr.putch = <void (*)(char)>py_swallow             # <<<<<<<<<<<<<<
 *         pariErr.puts = <void (*)(const_char_star)>py_swallow
 *         pariErr.flush = <void (*)()>py_swallow
 */
    pariErr->putch = ((void (*)(char))__pyx_f_10cypari_src_3gen_py_swallow);

    /* "cypari_src/gen.pyx":8965
 *         pariErr = &pari_error
 *         pariErr.putch = <void (*)(char)>py_swallow
 *         pariErr.puts = <void (*)(const_char_star)>py_swallow             # <<<<<<<<<<<<<<
 *         pariErr.flush = <void (*)()>py_swallow
 * 
 */
    pariErr->puts = ((void (*)(const char*))__pyx_f_10cypari_src_3gen_py_swallow);

    /* "cypari_src/gen.pyx":8966
 *         pariErr.putch = <void (*)(char)>py_swallow
 *         pariErr.puts = <void (*)(const_char_star)>py_swallow
 *         pariErr.flush = <void (*)()>py_swallow             # <<<<<<<<<<<<<<
 * 
 *     def speak_up(self):
 */
    pariErr->flush = ((void (*)(void))__pyx_f_10cypari_src_3gen_py_swallow);

    /* "cypari_src/gen.pyx":8961
 *         alarm_handler = handler
 * 
 *     def shut_up(self):             # <<<<<<<<<<<<<<
 *         global pariErr
 *         pariErr = &pari_error
 */

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

  /* "cypari_src/gen.pyx":8968
 *         pariErr.flush = <void (*)()>py_swallow
 * 
 *     def speak_up(self):             # <<<<<<<<<<<<<<
 *         global pariErr
 *         pariErr = &pari_error
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_15speak_up(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_15speak_up(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("speak_up (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_14speak_up(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_14speak_up(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("speak_up", 0);

    /* "cypari_src/gen.pyx":8970
 *     def speak_up(self):
 *         global pariErr
 *         pariErr = &pari_error             # <<<<<<<<<<<<<<
 *         pariErr.putch = py_putchar
 *         pariErr.puts = <void(*)(const_char_star)>py_puts
 */
    pariErr = (&__pyx_v_10cypari_src_3gen_pari_error);

    /* "cypari_src/gen.pyx":8971
 *         global pariErr
 *         pariErr = &pari_error
 *         pariErr.putch = py_putchar             # <<<<<<<<<<<<<<
 *         pariErr.puts = <void(*)(const_char_star)>py_puts
 *         pariErr.flush = py_flush
 */
    pariErr->putch = __pyx_f_10cypari_src_3gen_py_putchar;

    /* "cypari_src/gen.pyx":8972
 *         pariErr = &pari_error
 *         pariErr.putch = py_putchar
 *         pariErr.puts = <void(*)(const_char_star)>py_puts             # <<<<<<<<<<<<<<
 *         pariErr.flush = py_flush
 * 
 */
    pariErr->puts = ((void (*)(const char*))__pyx_f_10cypari_src_3gen_py_puts);

    /* "cypari_src/gen.pyx":8973
 *         pariErr.putch = py_putchar
 *         pariErr.puts = <void(*)(const_char_star)>py_puts
 *         pariErr.flush = py_flush             # <<<<<<<<<<<<<<
 * 
 *     def stack_info(self):
 */
    pariErr->flush = __pyx_f_10cypari_src_3gen_py_flush;

    /* "cypari_src/gen.pyx":8968
 *         pariErr.flush = <void (*)()>py_swallow
 * 
 *     def speak_up(self):             # <<<<<<<<<<<<<<
 *         global pariErr
 *         pariErr = &pari_error
 */

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

  /* "cypari_src/gen.pyx":8975
 *         pariErr.flush = py_flush
 * 
 *     def stack_info(self):             # <<<<<<<<<<<<<<
 *         global avma, top, bot, mytop
 *         print( 'PARI stack size: %d'%(top - bot) )
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_17stack_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_17stack_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("stack_info (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_16stack_info(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_16stack_info(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__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("stack_info", 0);

    /* "cypari_src/gen.pyx":8977
 *     def stack_info(self):
 *         global avma, top, bot, mytop
 *         print( 'PARI stack size: %d'%(top - bot) )             # <<<<<<<<<<<<<<
 *         print( 'used: %d'%(top - avma) )
 *         print( 'available: %d'%(avma - bot) )
 */
    __pyx_t_1 = __Pyx_PyInt_From_pari_sp((top - bot)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_PARI_stack_size_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":8978
 *         global avma, top, bot, mytop
 *         print( 'PARI stack size: %d'%(top - bot) )
 *         print( 'used: %d'%(top - avma) )             # <<<<<<<<<<<<<<
 *         print( 'available: %d'%(avma - bot) )
 *         print( '%d %% full'%int(float(top - avma)/float(top-bot)) )
 */
    __pyx_t_2 = __Pyx_PyInt_From_pari_sp((top - avma)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_used_d, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8978; __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(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8978; __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 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8979
 *         print( 'PARI stack size: %d'%(top - bot) )
 *         print( 'used: %d'%(top - avma) )
 *         print( 'available: %d'%(avma - bot) )             # <<<<<<<<<<<<<<
 *         print( '%d %% full'%int(float(top - avma)/float(top-bot)) )
 *         print( 'used by cypari.gen: %d'%(top - mytop) )
 */
    __pyx_t_1 = __Pyx_PyInt_From_pari_sp((avma - bot)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_available_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":8980
 *         print( 'used: %d'%(top - avma) )
 *         print( 'available: %d'%(avma - bot) )
 *         print( '%d %% full'%int(float(top - avma)/float(top-bot)) )             # <<<<<<<<<<<<<<
 *         print( 'used by cypari.gen: %d'%(top - mytop) )
 * 
 */
    if (unlikely(((double)(top - bot)) == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyFloat_FromDouble((((double)(top - avma)) / ((double)(top - bot)))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_d_full, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8980; __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(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8980; __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 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8981
 *         print( 'available: %d'%(avma - bot) )
 *         print( '%d %% full'%int(float(top - avma)/float(top-bot)) )
 *         print( 'used by cypari.gen: %d'%(top - mytop) )             # <<<<<<<<<<<<<<
 * 
 *     def exception_info(self):
 */
    __pyx_t_1 = __Pyx_PyInt_From_pari_sp((top - __pyx_v_10cypari_src_3gen_mytop)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_used_by_cypari_gen_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":8975
 *         pariErr.flush = py_flush
 * 
 *     def stack_info(self):             # <<<<<<<<<<<<<<
 *         global avma, top, bot, mytop
 *         print( 'PARI stack size: %d'%(top - bot) )
 */

    /* function exit code */
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.stack_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8983
 *         print( 'used by cypari.gen: %d'%(top - mytop) )
 * 
 *     def exception_info(self):             # <<<<<<<<<<<<<<
 *         global pari_error_number, setjmp_active, sig_on_sig_off
 *         print( 'Current error number: %d'%pari_error_number )
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_19exception_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_19exception_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("exception_info (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_18exception_info(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_18exception_info(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__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("exception_info", 0);

    /* "cypari_src/gen.pyx":8985
 *     def exception_info(self):
 *         global pari_error_number, setjmp_active, sig_on_sig_off
 *         print( 'Current error number: %d'%pari_error_number )             # <<<<<<<<<<<<<<
 *         print( 'Setjmp enabled ? %d'%setjmp_active )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(pari_error_number); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Current_error_number_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":8986
 *         global pari_error_number, setjmp_active, sig_on_sig_off
 *         print( 'Current error number: %d'%pari_error_number )
 *         print( 'Setjmp enabled ? %d'%setjmp_active )             # <<<<<<<<<<<<<<
 * 
 *     def default(self, variable, value=None):
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(setjmp_active); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Setjmp_enabled_d, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8986; __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(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8986; __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 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8983
 *         print( 'used by cypari.gen: %d'%(top - mytop) )
 * 
 *     def exception_info(self):             # <<<<<<<<<<<<<<
 *         global pari_error_number, setjmp_active, sig_on_sig_off
 *         print( 'Current error number: %d'%pari_error_number )
 */

    /* function exit code */
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.exception_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8988
 *         print( 'Setjmp enabled ? %d'%setjmp_active )
 * 
 *     def default(self, variable, value=None):             # <<<<<<<<<<<<<<
 *         if not value is None:
 *             return self('default(%s, %s)'%(variable, value))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_21default(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_21default(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_variable = 0;
    PyObject *__pyx_v_value = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("default (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variable,&__pyx_n_s_value,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)Py_None);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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_variable)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "default") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8988; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_variable = values[0];
      __pyx_v_value = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("default", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8988; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.default", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_20default(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_variable, __pyx_v_value);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_20default(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_variable, PyObject *__pyx_v_value) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *__pyx_t_7 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("default", 0);

    /* "cypari_src/gen.pyx":8989
 * 
 *     def default(self, variable, value=None):
 *         if not value is None:             # <<<<<<<<<<<<<<
 *             return self('default(%s, %s)'%(variable, value))
 *         return self('default(%s)'%variable)
 */
    __pyx_t_1 = (__pyx_v_value != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":8990
 *     def default(self, variable, value=None):
 *         if not value is None:
 *             return self('default(%s, %s)'%(variable, value))             # <<<<<<<<<<<<<<
 *         return self('default(%s)'%variable)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_variable);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_variable);
      __Pyx_GIVEREF(__pyx_v_variable);
      __Pyx_INCREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_default_s_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __pyx_t_4 = ((PyObject *)__pyx_v_self); __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":8991
 *         if not value is None:
 *             return self('default(%s, %s)'%(variable, value))
 *         return self('default(%s)'%variable)             # <<<<<<<<<<<<<<
 * 
 *     def set_debug_level(self, level):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_default_s, __pyx_v_variable); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_t_7 = ((PyObject *)__pyx_v_self); __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8991; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8988
 *         print( 'Setjmp enabled ? %d'%setjmp_active )
 * 
 *     def default(self, variable, value=None):             # <<<<<<<<<<<<<<
 *         if not value is None:
 *             return self('default(%s, %s)'%(variable, value))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.default", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8993
 *         return self('default(%s)'%variable)
 * 
 *     def set_debug_level(self, level):             # <<<<<<<<<<<<<<
 *         """
 *         Set the debug PARI C library variable.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_23set_debug_level(PyObject *__pyx_v_self, PyObject *__pyx_v_level); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_22set_debug_level[] = "\n        Set the debug PARI C library variable.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_23set_debug_level(PyObject *__pyx_v_self, PyObject *__pyx_v_level) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("set_debug_level (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_22set_debug_level(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((PyObject *)__pyx_v_level));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_22set_debug_level(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_level) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    Py_ssize_t __pyx_t_5;
    PyObject *__pyx_t_6 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("set_debug_level", 0);

    /* "cypari_src/gen.pyx":8997
 *         Set the debug PARI C library variable.
 *         """
 *         self.default('debug', int(level))             # <<<<<<<<<<<<<<
 * 
 *     def get_debug_level(self):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Int(__pyx_v_level); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_n_s_debug);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_debug);
    __Pyx_GIVEREF(__pyx_n_s_debug);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8997; __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_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":8993
 *         return self('default(%s)'%variable)
 * 
 *     def set_debug_level(self, level):             # <<<<<<<<<<<<<<
 *         """
 *         Set the debug PARI C library variable.
 */

    /* function exit code */
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.set_debug_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":8999
 *         self.default('debug', int(level))
 * 
 *     def get_debug_level(self):             # <<<<<<<<<<<<<<
 *         """
 *         Set the debug PARI C library variable.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_25get_debug_level(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_24get_debug_level[] = "\n        Set the debug PARI C library variable.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_25get_debug_level(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("get_debug_level (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_24get_debug_level(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_24get_debug_level(struct __pyx_obj_10cypari_src_3gen_PariInstance *__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_debug_level", 0);

    /* "cypari_src/gen.pyx":9003
 *         Set the debug PARI C library variable.
 *         """
 *         return int(self.default('debug'))             # <<<<<<<<<<<<<<
 * 
 *     cdef GEN toGEN(self, x, int i) except NULL:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":8999
 *         self.default('debug', int(level))
 * 
 *     def get_debug_level(self):             # <<<<<<<<<<<<<<
 *         """
 *         Set the debug PARI C library variable.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.get_debug_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9005
 *         return int(self.default('debug'))
 * 
 *     cdef GEN toGEN(self, x, int i) except NULL:             # <<<<<<<<<<<<<<
 *         cdef gen _x
 *         if isinstance(x, gen):
 */

  static GEN __pyx_f_10cypari_src_3gen_12PariInstance_toGEN(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_x, int __pyx_v_i) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v__x = 0;
    GEN __pyx_r;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("toGEN", 0);

    /* "cypari_src/gen.pyx":9007
 *     cdef GEN toGEN(self, x, int i) except NULL:
 *         cdef gen _x
 *         if isinstance(x, gen):             # <<<<<<<<<<<<<<
 *             _x = x
 *             return _x.g
 */
    __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_x, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":9008
 *         cdef gen _x
 *         if isinstance(x, gen):
 *             _x = x             # <<<<<<<<<<<<<<
 *             return _x.g
 * 
 */
      if (!(likely(((__pyx_v_x) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = __pyx_v_x;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_v__x = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "cypari_src/gen.pyx":9009
 *         if isinstance(x, gen):
 *             _x = x
 *             return _x.g             # <<<<<<<<<<<<<<
 * 
 *         t0heap[i] = self(x)
 */
      __pyx_r = __pyx_v__x->g;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9011
 *             return _x.g
 * 
 *         t0heap[i] = self(x)             # <<<<<<<<<<<<<<
 *         _x = t0heap[i]
 *         return _x.g
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_t_4 = ((PyObject *)__pyx_v_self); __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9011; __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 = NULL;
      __Pyx_INCREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_t0heap); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_SetItemInt(__pyx_t_4, __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cypari_src/gen.pyx":9012
 * 
 *         t0heap[i] = self(x)
 *         _x = t0heap[i]             # <<<<<<<<<<<<<<
 *         return _x.g
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_t0heap); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9012; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v__x = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cypari_src/gen.pyx":9013
 *         t0heap[i] = self(x)
 *         _x = t0heap[i]
 *         return _x.g             # <<<<<<<<<<<<<<
 * 
 *     def set_real_precision(self, long n):
 */
    __pyx_r = __pyx_v__x->g;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9005
 *         return int(self.default('debug'))
 * 
 *     cdef GEN toGEN(self, x, int i) except NULL:             # <<<<<<<<<<<<<<
 *         cdef gen _x
 *         if isinstance(x, gen):
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.toGEN", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v__x);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9015
 *         return _x.g
 * 
 *     def set_real_precision(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the PARI default real precision.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_27set_real_precision(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_26set_real_precision[] = "\n        Sets the PARI default real precision.\n        \n        This is used both for creation of new objects from strings and for\n        printing. It is the number of digits *IN DECIMAL* in which real\n        numbers are printed. It also determines the precision of objects\n        created by parsing strings (e.g. pari('1.2')), which is *not* the\n        normal way of creating new pari objects in Sage. It has *no*\n        effect on the precision of computations within the pari library.\n        \n        Returns the previous PARI real precision.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_27set_real_precision(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("set_real_precision (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9015; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.set_real_precision", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_26set_real_precision(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_26set_real_precision(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n) {
    unsigned long __pyx_v_k;
    PyObject *__pyx_v_s = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    long __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    char *__pyx_t_7;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("set_real_precision", 0);

    /* "cypari_src/gen.pyx":9030
 *         cdef unsigned long k
 * 
 *         k = GP_DATA.fmt.sigd             # <<<<<<<<<<<<<<
 *         s = str_to_chars(str(n))
 *         sig_on()
 */
    __pyx_t_1 = GP_DATA->fmt->sigd;
    __pyx_v_k = __pyx_t_1;

    /* "cypari_src/gen.pyx":9031
 * 
 *         k = GP_DATA.fmt.sigd
 *         s = str_to_chars(str(n))             # <<<<<<<<<<<<<<
 *         sig_on()
 *         sd_realprecision(s, 2)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_to_chars); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9031; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_s = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":9032
 *         k = GP_DATA.fmt.sigd
 *         s = str_to_chars(str(n))
 *         sig_on()             # <<<<<<<<<<<<<<
 *         sd_realprecision(s, 2)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9033
 *         s = str_to_chars(str(n))
 *         sig_on()
 *         sd_realprecision(s, 2)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return int(k)  # Python int
 */
    __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_s); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    sd_realprecision(__pyx_t_7, 2);

    /* "cypari_src/gen.pyx":9034
 *         sig_on()
 *         sd_realprecision(s, 2)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return int(k)  # Python int
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":9035
 *         sd_realprecision(s, 2)
 *         sig_off()
 *         return int(k)  # Python int             # <<<<<<<<<<<<<<
 * 
 *     def get_real_precision(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_long(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9035; __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 = 9035; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9015
 *         return _x.g
 * 
 *     def set_real_precision(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the PARI default real precision.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.set_real_precision", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_s);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9037
 *         return int(k)  # Python int
 * 
 *     def get_real_precision(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current PARI default real precision.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_29get_real_precision(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_28get_real_precision[] = "\n        Returns the current PARI default real precision.\n        \n        This is used both for creation of new objects from strings and for\n        printing. It is the number of digits *IN DECIMAL* in which real\n        numbers are printed. It also determines the precision of objects\n        created by parsing strings (e.g. pari('1.2')), which is *not* the\n        normal way of creating new pari objects in Sage. It has *no*\n        effect on the precision of computations within the pari library.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_29get_real_precision(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("get_real_precision (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_28get_real_precision(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_28get_real_precision(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__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_real_precision", 0);

    /* "cypari_src/gen.pyx":9048
 *         effect on the precision of computations within the pari library.
 *         """
 *         return GP_DATA.fmt.sigd             # <<<<<<<<<<<<<<
 * 
 *     def set_series_precision(self, long n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_long(GP_DATA->fmt->sigd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9037
 *         return int(k)  # Python int
 * 
 *     def get_real_precision(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current PARI default real precision.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.get_real_precision", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9050
 *         return GP_DATA.fmt.sigd
 * 
 *     def set_series_precision(self, long n):             # <<<<<<<<<<<<<<
 *         global precdl
 *         precdl = n
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_31set_series_precision(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_31set_series_precision(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("set_series_precision (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9050; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.set_series_precision", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_30set_series_precision(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_30set_series_precision(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("set_series_precision", 0);

    /* "cypari_src/gen.pyx":9052
 *     def set_series_precision(self, long n):
 *         global precdl
 *         precdl = n             # <<<<<<<<<<<<<<
 * 
 *     def get_series_precision(self):
 */
    precdl = __pyx_v_n;

    /* "cypari_src/gen.pyx":9050
 *         return GP_DATA.fmt.sigd
 * 
 *     def set_series_precision(self, long n):             # <<<<<<<<<<<<<<
 *         global precdl
 *         precdl = n
 */

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

  /* "cypari_src/gen.pyx":9054
 *         precdl = n
 * 
 *     def get_series_precision(self):             # <<<<<<<<<<<<<<
 *         return precdl
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_33get_series_precision(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_33get_series_precision(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("get_series_precision (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_32get_series_precision(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_32get_series_precision(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__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_series_precision", 0);

    /* "cypari_src/gen.pyx":9055
 * 
 *     def get_series_precision(self):
 *         return precdl             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_int(precdl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9054
 *         precdl = n
 * 
 *     def get_series_precision(self):             # <<<<<<<<<<<<<<
 *         return precdl
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.get_series_precision", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9064
 *     ###########################################
 * 
 *     cdef gen new_gen(self, GEN x):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new gen, then free the \*entire\* stack and call
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_gen(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_g = 0;
    struct __pyx_obj_10cypari_src_3gen_gen *__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("new_gen", 0);

    /* "cypari_src/gen.pyx":9070
 *         """
 *         cdef gen g
 *         g = _new_gen(x, 0)             # <<<<<<<<<<<<<<
 *         global mytop, avma
 *         avma = mytop
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_10cypari_src_3gen__new_gen(__pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_g = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9072
 *         g = _new_gen(x, 0)
 *         global mytop, avma
 *         avma = mytop             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return g
 */
    avma = __pyx_v_10cypari_src_3gen_mytop;

    /* "cypari_src/gen.pyx":9073
 *         global mytop, avma
 *         avma = mytop
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return g
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":9074
 *         avma = mytop
 *         sig_off()
 *         return g             # <<<<<<<<<<<<<<
 * 
 *     cdef gen new_gen_with_sp(self, GEN x):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_g));
    __pyx_r = __pyx_v_g;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9064
 *     ###########################################
 * 
 *     cdef gen new_gen(self, GEN x):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new gen, then free the \*entire\* stack and call
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.new_gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_g);
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9076
 *         return g
 * 
 *     cdef gen new_gen_with_sp(self, GEN x):             # <<<<<<<<<<<<<<
 *         """
 *         If a new gen is created this way then its size is computed as
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_with_sp(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_g = 0;
    struct __pyx_obj_10cypari_src_3gen_gen *__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("new_gen_with_sp", 0);

    /* "cypari_src/gen.pyx":9093
 *         """
 *         cdef gen g
 *         g = _new_gen(x, stack_mark)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         global mytop, avma
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_10cypari_src_3gen__new_gen(__pyx_v_x, __pyx_v_10cypari_src_3gen_stack_mark)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_g = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9094
 *         cdef gen g
 *         g = _new_gen(x, stack_mark)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         global mytop, avma
 *         avma = mytop
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":9096
 *         sig_off()
 *         global mytop, avma
 *         avma = mytop             # <<<<<<<<<<<<<<
 *         return g
 * 
 */
    avma = __pyx_v_10cypari_src_3gen_mytop;

    /* "cypari_src/gen.pyx":9097
 *         global mytop, avma
 *         avma = mytop
 *         return g             # <<<<<<<<<<<<<<
 * 
 *     cdef gen new_leaf_gen(self, GEN x):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_g));
    __pyx_r = __pyx_v_g;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9076
 *         return g
 * 
 *     cdef gen new_gen_with_sp(self, GEN x):             # <<<<<<<<<<<<<<
 *         """
 *         If a new gen is created this way then its size is computed as
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.new_gen_with_sp", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_g);
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9099
 *         return g
 * 
 *     cdef gen new_leaf_gen(self, GEN x):             # <<<<<<<<<<<<<<
 *         """
 *         Avoids one copy when the gen is known to be a leaf.
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_leaf_gen(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x) {
    GEN __pyx_v_z;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_g = 0;
    struct __pyx_obj_10cypari_src_3gen_gen *__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("new_leaf_gen", 0);

    /* "cypari_src/gen.pyx":9105
 *         cdef GEN z
 *         cdef gen g
 *         z = <GEN>PyMem_Malloc(lg(x)*sizeof_pari_word)             # <<<<<<<<<<<<<<
 *         settyp(z, typ(x))
 *         setlg(z, lg(x))
 */
    __pyx_v_z = ((GEN)PyMem_Malloc((lg(__pyx_v_x) * __pyx_v_10cypari_src_3gen_sizeof_pari_word)));

    /* "cypari_src/gen.pyx":9106
 *         cdef gen g
 *         z = <GEN>PyMem_Malloc(lg(x)*sizeof_pari_word)
 *         settyp(z, typ(x))             # <<<<<<<<<<<<<<
 *         setlg(z, lg(x))
 *         unsetisclone(z)
 */
    settyp(__pyx_v_z, typ(__pyx_v_x));

    /* "cypari_src/gen.pyx":9107
 *         z = <GEN>PyMem_Malloc(lg(x)*sizeof_pari_word)
 *         settyp(z, typ(x))
 *         setlg(z, lg(x))             # <<<<<<<<<<<<<<
 *         unsetisclone(z)
 *         gaffect(x, z)
 */
    setlg(__pyx_v_z, lg(__pyx_v_x));

    /* "cypari_src/gen.pyx":9108
 *         settyp(z, typ(x))
 *         setlg(z, lg(x))
 *         unsetisclone(z)             # <<<<<<<<<<<<<<
 *         gaffect(x, z)
 *         g = gen.__new__(gen)
 */
    unsetisclone(__pyx_v_z);

    /* "cypari_src/gen.pyx":9109
 *         setlg(z, lg(x))
 *         unsetisclone(z)
 *         gaffect(x, z)             # <<<<<<<<<<<<<<
 *         g = gen.__new__(gen)
 *         g.init(z, <pari_sp>z)
 */
    gaffect(__pyx_v_x, __pyx_v_z);

    /* "cypari_src/gen.pyx":9110
 *         unsetisclone(z)
 *         gaffect(x, z)
 *         g = gen.__new__(gen)             # <<<<<<<<<<<<<<
 *         g.init(z, <pari_sp>z)
 *         sig_off()
 */
    __pyx_t_1 = __pyx_tp_new_10cypari_src_3gen_gen(((PyTypeObject *)((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_10cypari_src_3gen_gen)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_g = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9111
 *         gaffect(x, z)
 *         g = gen.__new__(gen)
 *         g.init(z, <pari_sp>z)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return g
 */
    ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_g->__pyx_vtab)->init(__pyx_v_g, __pyx_v_z, ((pari_sp)__pyx_v_z));

    /* "cypari_src/gen.pyx":9112
 *         g = gen.__new__(gen)
 *         g.init(z, <pari_sp>z)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return g
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":9113
 *         g.init(z, <pari_sp>z)
 *         sig_off()
 *         return g             # <<<<<<<<<<<<<<
 * 
 *     cdef object new_gen_to_bytes(self, GEN x):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_g));
    __pyx_r = __pyx_v_g;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9099
 *         return g
 * 
 *     cdef gen new_leaf_gen(self, GEN x):             # <<<<<<<<<<<<<<
 *         """
 *         Avoids one copy when the gen is known to be a leaf.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.new_leaf_gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_g);
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9115
 *         return g
 * 
 *     cdef object new_gen_to_bytes(self, GEN x):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a gen to a Python byte array, free the \*entire\* stack and call
 */

  static PyObject *__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_to_bytes(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x) {
    char *__pyx_v_c;
    PyObject *__pyx_v_s = NULL;
    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("new_gen_to_bytes", 0);

    /* "cypari_src/gen.pyx":9122
 *         #mc# But it is only used by gen.__repr__ as far as I can tell. (???)
 *         cdef char* c
 *         c = GENtostr(x)             # <<<<<<<<<<<<<<
 *         s = bytes(c)
 *         pari_free(c)
 */
    __pyx_v_c = GENtostr(__pyx_v_x);

    /* "cypari_src/gen.pyx":9123
 *         cdef char* c
 *         c = GENtostr(x)
 *         s = bytes(c)             # <<<<<<<<<<<<<<
 *         pari_free(c)
 *         global avma, mytop
 */
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_c); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9123; __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 = 9123; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyBytes_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_s = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9124
 *         c = GENtostr(x)
 *         s = bytes(c)
 *         pari_free(c)             # <<<<<<<<<<<<<<
 *         global avma, mytop
 *         avma = mytop
 */
    pari_free(__pyx_v_c);

    /* "cypari_src/gen.pyx":9126
 *         pari_free(c)
 *         global avma, mytop
 *         avma = mytop             # <<<<<<<<<<<<<<
 *         sig_off()
 *         return s
 */
    avma = __pyx_v_10cypari_src_3gen_mytop;

    /* "cypari_src/gen.pyx":9127
 *         global avma, mytop
 *         avma = mytop
 *         sig_off()             # <<<<<<<<<<<<<<
 *         return s
 * 
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":9128
 *         avma = mytop
 *         sig_off()
 *         return s             # <<<<<<<<<<<<<<
 * 
 *     cdef void clear_stack(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_s);
    __pyx_r = __pyx_v_s;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9115
 *         return g
 * 
 *     cdef object new_gen_to_bytes(self, GEN x):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a gen to a Python byte array, free the \*entire\* stack and call
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.new_gen_to_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_s);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9130
 *         return s
 * 
 *     cdef void clear_stack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Clear the entire PARI stack and call sig_off().
 */

  static void __pyx_f_10cypari_src_3gen_12PariInstance_clear_stack(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self) {
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("clear_stack", 0);

    /* "cypari_src/gen.pyx":9135
 *         """
 *         global mytop, avma
 *         avma = mytop             # <<<<<<<<<<<<<<
 *         sig_off()
 * 
 */
    avma = __pyx_v_10cypari_src_3gen_mytop;

    /* "cypari_src/gen.pyx":9136
 *         global mytop, avma
 *         avma = mytop
 *         sig_off()             # <<<<<<<<<<<<<<
 * 
 *     cdef void set_mytop_to_avma(self):
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":9130
 *         return s
 * 
 *     cdef void clear_stack(self):             # <<<<<<<<<<<<<<
 *         """
 *         Clear the entire PARI stack and call sig_off().
 */

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

  /* "cypari_src/gen.pyx":9138
 *         sig_off()
 * 
 *     cdef void set_mytop_to_avma(self):             # <<<<<<<<<<<<<<
 *         global mytop, avma
 *         mytop = avma
 */

  static void __pyx_f_10cypari_src_3gen_12PariInstance_set_mytop_to_avma(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self) {
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("set_mytop_to_avma", 0);

    /* "cypari_src/gen.pyx":9140
 *     cdef void set_mytop_to_avma(self):
 *         global mytop, avma
 *         mytop = avma             # <<<<<<<<<<<<<<
 * 
 *     cdef gen new_gen_noclear(self, GEN x):
 */
    __pyx_v_10cypari_src_3gen_mytop = avma;

    /* "cypari_src/gen.pyx":9138
 *         sig_off()
 * 
 *     cdef void set_mytop_to_avma(self):             # <<<<<<<<<<<<<<
 *         global mytop, avma
 *         mytop = avma
 */

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

  /* "cypari_src/gen.pyx":9142
 *         mytop = avma
 * 
 *     cdef gen new_gen_noclear(self, GEN x):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new gen, but don't free any memory on the stack and
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_noclear(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_z = NULL;
    struct __pyx_obj_10cypari_src_3gen_gen *__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("new_gen_noclear", 0);

    /* "cypari_src/gen.pyx":9149
 *         clobbered before they can be used.
 *         """
 *         z = _new_gen(x, 0)             # <<<<<<<<<<<<<<
 *         return z
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_10cypari_src_3gen__new_gen(__pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_z = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9150
 *         """
 *         z = _new_gen(x, 0)
 *         return z             # <<<<<<<<<<<<<<
 * 
 *     cdef gen new_gen_from_int(self, int value):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_z));
    __pyx_r = __pyx_v_z;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9142
 *         mytop = avma
 * 
 *     cdef gen new_gen_noclear(self, GEN x):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new gen, but don't free any memory on the stack and
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.new_gen_noclear", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_z);
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9152
 *         return z
 * 
 *     cdef gen new_gen_from_int(self, int value):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_leaf_gen(stoi(value)) #mc# - saves one copy.
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_from_int(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, int __pyx_v_value) {
    struct __pyx_obj_10cypari_src_3gen_gen *__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("new_gen_from_int", 0);

    /* "cypari_src/gen.pyx":9153
 * 
 *     cdef gen new_gen_from_int(self, int value):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_leaf_gen(stoi(value)) #mc# - saves one copy.
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9154
 *     cdef gen new_gen_from_int(self, int value):
 *         sig_on()
 *         return self.new_leaf_gen(stoi(value)) #mc# - saves one copy.             # <<<<<<<<<<<<<<
 * 
 *     cdef gen new_t_POL_from_int_star(self, int *vals, int length, long varnum):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_leaf_gen(__pyx_v_self, stoi(__pyx_v_value))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9152
 *         return z
 * 
 *     cdef gen new_gen_from_int(self, int value):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_leaf_gen(stoi(value)) #mc# - saves one copy.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.new_gen_from_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9156
 *         return self.new_leaf_gen(stoi(value)) #mc# - saves one copy.
 * 
 *     cdef gen new_t_POL_from_int_star(self, int *vals, int length, long varnum):             # <<<<<<<<<<<<<<
 *         """
 *         Note that degree + 1 = length, so that recognizing 0 is easier.
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_t_POL_from_int_star(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, int *__pyx_v_vals, int __pyx_v_length, long __pyx_v_varnum) {
    GEN __pyx_v_z;
    int __pyx_v_i;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("new_t_POL_from_int_star", 0);

    /* "cypari_src/gen.pyx":9165
 *         cdef int i
 * 
 *         sig_on()             # <<<<<<<<<<<<<<
 *         z = cgetg(length + 2, t_POL)
 *         z[1] = evalvarn(varnum)
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9166
 * 
 *         sig_on()
 *         z = cgetg(length + 2, t_POL)             # <<<<<<<<<<<<<<
 *         z[1] = evalvarn(varnum)
 *         if length != 0:
 */
    __pyx_v_z = cgetg((__pyx_v_length + 2), t_POL);

    /* "cypari_src/gen.pyx":9167
 *         sig_on()
 *         z = cgetg(length + 2, t_POL)
 *         z[1] = evalvarn(varnum)             # <<<<<<<<<<<<<<
 *         if length != 0:
 *             setsigne(z,1)
 */
    (__pyx_v_z[1]) = evalvarn(__pyx_v_varnum);

    /* "cypari_src/gen.pyx":9168
 *         z = cgetg(length + 2, t_POL)
 *         z[1] = evalvarn(varnum)
 *         if length != 0:             # <<<<<<<<<<<<<<
 *             setsigne(z,1)
 *             for i from 0 <= i < length:
 */
    __pyx_t_1 = ((__pyx_v_length != 0) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9169
 *         z[1] = evalvarn(varnum)
 *         if length != 0:
 *             setsigne(z,1)             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < length:
 *                 set_gel(z,i+2, stoi(vals[i]))
 */
      setsigne(__pyx_v_z, 1);

      /* "cypari_src/gen.pyx":9170
 *         if length != 0:
 *             setsigne(z,1)
 *             for i from 0 <= i < length:             # <<<<<<<<<<<<<<
 *                 set_gel(z,i+2, stoi(vals[i]))
 *         else:
 */
      __pyx_t_2 = __pyx_v_length;
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

        /* "cypari_src/gen.pyx":9171
 *             setsigne(z,1)
 *             for i from 0 <= i < length:
 *                 set_gel(z,i+2, stoi(vals[i]))             # <<<<<<<<<<<<<<
 *         else:
 *             ## polynomial is zero
 */
        set_gel(__pyx_v_z, (__pyx_v_i + 2), stoi((__pyx_v_vals[__pyx_v_i])));
      }
      goto __pyx_L3;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":9174
 *         else:
 *             ## polynomial is zero
 *             setsigne(z,0)             # <<<<<<<<<<<<<<
 * 
 *         return self.new_gen(z)
 */
      setsigne(__pyx_v_z, 0);
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":9176
 *             setsigne(z,0)
 * 
 *         return self.new_gen(z)             # <<<<<<<<<<<<<<
 * 
 *     def double_to_gen(self, x):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, __pyx_v_z)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9156
 *         return self.new_leaf_gen(stoi(value)) #mc# - saves one copy.
 * 
 *     cdef gen new_t_POL_from_int_star(self, int *vals, int length, long varnum):             # <<<<<<<<<<<<<<
 *         """
 *         Note that degree + 1 = length, so that recognizing 0 is easier.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.new_t_POL_from_int_star", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9178
 *         return self.new_gen(z)
 * 
 *     def double_to_gen(self, x):             # <<<<<<<<<<<<<<
 *         cdef double dx
 *         dx = float(x)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_35double_to_gen(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_35double_to_gen(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("double_to_gen (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_34double_to_gen(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((PyObject *)__pyx_v_x));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_34double_to_gen(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_x) {
    double __pyx_v_dx;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    double __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("double_to_gen", 0);

    /* "cypari_src/gen.pyx":9180
 *     def double_to_gen(self, x):
 *         cdef double dx
 *         dx = float(x)             # <<<<<<<<<<<<<<
 *         return self.double_to_gen_c(dx)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_AsDouble(__pyx_v_x); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_dx = __pyx_t_1;

    /* "cypari_src/gen.pyx":9181
 *         cdef double dx
 *         dx = float(x)
 *         return self.double_to_gen_c(dx)             # <<<<<<<<<<<<<<
 * 
 *     cdef gen double_to_gen_c(self, double x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->double_to_gen_c(__pyx_v_self, __pyx_v_dx)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9178
 *         return self.new_gen(z)
 * 
 *     def double_to_gen(self, x):             # <<<<<<<<<<<<<<
 *         cdef double dx
 *         dx = float(x)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.double_to_gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9183
 *         return self.double_to_gen_c(dx)
 * 
 *     cdef gen double_to_gen_c(self, double x):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new gen with the value of the double x, using PARI's
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_double_to_gen_c(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, double __pyx_v_x) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("double_to_gen_c", 0);

    /* "cypari_src/gen.pyx":9211
 *         # double).
 * 
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if x == 0:
 *             return self.new_gen(real_0_bit(-53))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9212
 * 
 *         sig_on()
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             return self.new_gen(real_0_bit(-53))
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_x == 0.0) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9213
 *         sig_on()
 *         if x == 0:
 *             return self.new_gen(real_0_bit(-53))             # <<<<<<<<<<<<<<
 *         else:
 *             return self.new_gen(dbltor(x))
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, real_0_bit(-53))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_2);
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":9215
 *             return self.new_gen(real_0_bit(-53))
 *         else:
 *             return self.new_gen(dbltor(x))             # <<<<<<<<<<<<<<
 * 
 *     cdef GEN double_to_GEN(self, double x):
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, dbltor(__pyx_v_x))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_2);
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9183
 *         return self.double_to_gen_c(dx)
 * 
 *     cdef gen double_to_gen_c(self, double x):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new gen with the value of the double x, using PARI's
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.double_to_gen_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9217
 *             return self.new_gen(dbltor(x))
 * 
 *     cdef GEN double_to_GEN(self, double x):             # <<<<<<<<<<<<<<
 *         if x == 0:
 *             return real_0_bit(-53)
 */

  static GEN __pyx_f_10cypari_src_3gen_12PariInstance_double_to_GEN(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, double __pyx_v_x) {
    GEN __pyx_r;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    __Pyx_RefNannySetupContext("double_to_GEN", 0);

    /* "cypari_src/gen.pyx":9218
 * 
 *     cdef GEN double_to_GEN(self, double x):
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             return real_0_bit(-53)
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_x == 0.0) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9219
 *     cdef GEN double_to_GEN(self, double x):
 *         if x == 0:
 *             return real_0_bit(-53)             # <<<<<<<<<<<<<<
 *         else:
 *             return dbltor(x)
 */
      __pyx_r = real_0_bit(-53);
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":9221
 *             return real_0_bit(-53)
 *         else:
 *             return dbltor(x)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _real_coerced_to_bits_prec(self, double x, long bits):
 */
      __pyx_r = dbltor(__pyx_v_x);
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9217
 *             return self.new_gen(dbltor(x))
 * 
 *     cdef GEN double_to_GEN(self, double x):             # <<<<<<<<<<<<<<
 *         if x == 0:
 *             return real_0_bit(-53)
 */

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

  /* "cypari_src/gen.pyx":9223
 *             return dbltor(x)
 * 
 *     cpdef _real_coerced_to_bits_prec(self, double x, long bits):             # <<<<<<<<<<<<<<
 *         r"""
 *         Creates a PARI t_REAL with value given by the float x, coerced
 */

  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_37_real_coerced_to_bits_prec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_f_10cypari_src_3gen_12PariInstance__real_coerced_to_bits_prec(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, double __pyx_v_x, long __pyx_v_bits, int __pyx_skip_dispatch) {
    long __pyx_v_words;
    GEN __pyx_v_g;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    Py_ssize_t __pyx_t_7;
    PyObject *__pyx_t_8 = NULL;
    struct __pyx_opt_args_10cypari_src_3gen_prec_bits_to_words __pyx_t_9;
    long __pyx_t_10;
    int __pyx_t_11;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("_real_coerced_to_bits_prec", 0);
    /* Check if called by wrapper */
    if (unlikely(__pyx_skip_dispatch)) ;
    /* Check if overridden in Python */
    else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_real_coerced_to_bits_prec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_37_real_coerced_to_bits_prec)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_bits); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_6) {
          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
        }
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_3 = 0;
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }

    /* "cypari_src/gen.pyx":9242
 *         quad-double numbers to pari numbers.
 *         """
 *         cdef long words = prec_bits_to_words(bits)             # <<<<<<<<<<<<<<
 *         cdef GEN g
 *         sig_on()
 */
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.prec_in_bits = __pyx_v_bits;
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_prec_bits_to_words(0, &__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_words = __pyx_t_10;

    /* "cypari_src/gen.pyx":9244
 *         cdef long words = prec_bits_to_words(bits)
 *         cdef GEN g
 *         sig_on()             # <<<<<<<<<<<<<<
 *         if x == 0:
 *             return self.new_gen(real_0_bit(-bits))
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9245
 *         cdef GEN g
 *         sig_on()
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             return self.new_gen(real_0_bit(-bits))
 *         else:
 */
    __pyx_t_11 = ((__pyx_v_x == 0.0) != 0);
    if (__pyx_t_11) {

      /* "cypari_src/gen.pyx":9246
 *         sig_on()
 *         if x == 0:
 *             return self.new_gen(real_0_bit(-bits))             # <<<<<<<<<<<<<<
 *         else:
 *             g = dbltor(x)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, real_0_bit((-__pyx_v_bits)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":9248
 *             return self.new_gen(real_0_bit(-bits))
 *         else:
 *             g = dbltor(x)             # <<<<<<<<<<<<<<
 *             return self.new_gen(gtofp(g, words))
 * 
 */
      __pyx_v_g = dbltor(__pyx_v_x);

      /* "cypari_src/gen.pyx":9249
 *         else:
 *             g = dbltor(x)
 *             return self.new_gen(gtofp(g, words))             # <<<<<<<<<<<<<<
 * 
 *     def complex(self, re, im):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, gtofp(__pyx_v_g, __pyx_v_words))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9223
 *             return dbltor(x)
 * 
 *     cpdef _real_coerced_to_bits_prec(self, double x, long bits):             # <<<<<<<<<<<<<<
 *         r"""
 *         Creates a PARI t_REAL with value given by the float x, coerced
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance._real_coerced_to_bits_prec", __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_10cypari_src_3gen_12PariInstance_37_real_coerced_to_bits_prec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_36_real_coerced_to_bits_prec[] = " \n        Creates a PARI t_REAL with value given by the float x, coerced\n        to at least the given precision.  The resulting gen object\n        will have word length (not including codewords) which is large\n        enough to provide the requested number of bits, but no larger.\n        >>> old_precision = pari.set_real_precision(64)\n        >>> x = pari._real_coerced_to_bits_prec(1.23456789012345678, 100)\n        >>> x\n        1.23456789012345669043213547411141917110\n        >>> x.length()\n        2\n        >>> pari.set_real_precision(old_precision)\n\t64\n\n        Here the pari gen uses two 64 bit words to provide at least\n        100 bits of precision.  This can be used, for example, to convert\n        quad-double numbers to pari numbers.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_37_real_coerced_to_bits_prec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    double __pyx_v_x;
    long __pyx_v_bits;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("_real_coerced_to_bits_prec (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_bits,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_x)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bits)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("_real_coerced_to_bits_prec", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_real_coerced_to_bits_prec") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __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_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_bits = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_bits == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("_real_coerced_to_bits_prec", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance._real_coerced_to_bits_prec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_36_real_coerced_to_bits_prec(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_x, __pyx_v_bits);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_36_real_coerced_to_bits_prec(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, double __pyx_v_x, long __pyx_v_bits) {
    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("_real_coerced_to_bits_prec", 0);
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_12PariInstance__real_coerced_to_bits_prec(__pyx_v_self, __pyx_v_x, __pyx_v_bits, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance._real_coerced_to_bits_prec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9251
 *             return self.new_gen(gtofp(g, words))
 * 
 *     def complex(self, re, im):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new complex number, initialized from re and im.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_39complex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_38complex[] = "\n        Create a new complex number, initialized from re and im.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_39complex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_re = 0;
    PyObject *__pyx_v_im = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("complex (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_re,&__pyx_n_s_im,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_re)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_im)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("complex", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "complex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9251; __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_re = values[0];
      __pyx_v_im = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("complex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_38complex(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_re, __pyx_v_im);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_38complex(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_re, PyObject *__pyx_v_im) {
    GEN __pyx_v_cp;
    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("complex", 0);

    /* "cypari_src/gen.pyx":9255
 *         Create a new complex number, initialized from re and im.
 *         """
 *         t0GEN(re)             # <<<<<<<<<<<<<<
 *         t1GEN(im)
 *         cdef GEN cp
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9256
 *         """
 *         t0GEN(re)
 *         t1GEN(im)             # <<<<<<<<<<<<<<
 *         cdef GEN cp
 *         sig_on()
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t1GEN(__pyx_v_im); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9258
 *         t1GEN(im)
 *         cdef GEN cp
 *         sig_on()             # <<<<<<<<<<<<<<
 *         cp = cgetg(3, t_COMPLEX)
 *         set_gel(cp, 1, t0)
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9259
 *         cdef GEN cp
 *         sig_on()
 *         cp = cgetg(3, t_COMPLEX)             # <<<<<<<<<<<<<<
 *         set_gel(cp, 1, t0)
 *         set_gel(cp, 2, t1)
 */
    __pyx_v_cp = cgetg(3, t_COMPLEX);

    /* "cypari_src/gen.pyx":9260
 *         sig_on()
 *         cp = cgetg(3, t_COMPLEX)
 *         set_gel(cp, 1, t0)             # <<<<<<<<<<<<<<
 *         set_gel(cp, 2, t1)
 *         return self.new_gen(cp)
 */
    set_gel(__pyx_v_cp, 1, __pyx_v_10cypari_src_3gen_t0);

    /* "cypari_src/gen.pyx":9261
 *         cp = cgetg(3, t_COMPLEX)
 *         set_gel(cp, 1, t0)
 *         set_gel(cp, 2, t1)             # <<<<<<<<<<<<<<
 *         return self.new_gen(cp)
 * 
 */
    set_gel(__pyx_v_cp, 2, __pyx_v_10cypari_src_3gen_t1);

    /* "cypari_src/gen.pyx":9262
 *         set_gel(cp, 1, t0)
 *         set_gel(cp, 2, t1)
 *         return self.new_gen(cp)             # <<<<<<<<<<<<<<
 * 
 *     cdef GEN deepcopy_to_python_heap(self, GEN x, pari_sp* address, pari_sp prior_sp):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, __pyx_v_cp)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9251
 *             return self.new_gen(gtofp(g, words))
 * 
 *     def complex(self, re, im):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new complex number, initialized from re and im.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9264
 *         return self.new_gen(cp)
 * 
 *     cdef GEN deepcopy_to_python_heap(self, GEN x, pari_sp* address, pari_sp prior_sp):             # <<<<<<<<<<<<<<
 *         return deepcopy_to_python_heap(x, address, prior_sp)
 * 
 */

  static GEN __pyx_f_10cypari_src_3gen_12PariInstance_deepcopy_to_python_heap(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_x, pari_sp *__pyx_v_address, pari_sp __pyx_v_prior_sp) {
    GEN __pyx_r;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("deepcopy_to_python_heap", 0);

    /* "cypari_src/gen.pyx":9265
 * 
 *     cdef GEN deepcopy_to_python_heap(self, GEN x, pari_sp* address, pari_sp prior_sp):
 *         return deepcopy_to_python_heap(x, address, prior_sp)             # <<<<<<<<<<<<<<
 * 
 *     cdef gen new_ref(self, GEN g, gen parent):
 */
    __pyx_r = __pyx_f_10cypari_src_3gen_deepcopy_to_python_heap(__pyx_v_x, __pyx_v_address, __pyx_v_prior_sp);
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9264
 *         return self.new_gen(cp)
 * 
 *     cdef GEN deepcopy_to_python_heap(self, GEN x, pari_sp* address, pari_sp prior_sp):             # <<<<<<<<<<<<<<
 *         return deepcopy_to_python_heap(x, address, prior_sp)
 * 
 */

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

  /* "cypari_src/gen.pyx":9267
 *         return deepcopy_to_python_heap(x, address, prior_sp)
 * 
 *     cdef gen new_ref(self, GEN g, gen parent):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new gen pointing to the given GEN, which is allocated as a
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance_new_ref(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, GEN __pyx_v_g, struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_parent) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_p = 0;
    struct __pyx_obj_10cypari_src_3gen_gen *__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("new_ref", 0);

    /* "cypari_src/gen.pyx":9291
 *             2
 *         """
 *         cdef gen p = gen.__new__(gen)             # <<<<<<<<<<<<<<
 * 
 *         p.b = 0
 */
    __pyx_t_1 = __pyx_tp_new_10cypari_src_3gen_gen(((PyTypeObject *)((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_10cypari_src_3gen_gen)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_p = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9293
 *         cdef gen p = gen.__new__(gen)
 * 
 *         p.b = 0             # <<<<<<<<<<<<<<
 *         p._parent = self
 *         p._refers_to = {-1:parent}
 */
    __pyx_v_p->b = 0;

    /* "cypari_src/gen.pyx":9294
 * 
 *         p.b = 0
 *         p._parent = self             # <<<<<<<<<<<<<<
 *         p._refers_to = {-1:parent}
 *         p.g = g
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_p->_parent);
    __Pyx_DECREF(__pyx_v_p->_parent);
    __pyx_v_p->_parent = ((PyObject *)__pyx_v_self);

    /* "cypari_src/gen.pyx":9295
 *         p.b = 0
 *         p._parent = self
 *         p._refers_to = {-1:parent}             # <<<<<<<<<<<<<<
 *         p.g = g
 * 
 */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_int_neg_1, ((PyObject *)__pyx_v_parent)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_p->_refers_to);
    __Pyx_DECREF(__pyx_v_p->_refers_to);
    __pyx_v_p->_refers_to = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9296
 *         p._parent = self
 *         p._refers_to = {-1:parent}
 *         p.g = g             # <<<<<<<<<<<<<<
 * 
 *         return p
 */
    __pyx_v_p->g = __pyx_v_g;

    /* "cypari_src/gen.pyx":9298
 *         p.g = g
 * 
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, s):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_p));
    __pyx_r = __pyx_v_p;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9267
 *         return deepcopy_to_python_heap(x, address, prior_sp)
 * 
 *     cdef gen new_ref(self, GEN g, gen parent):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new gen pointing to the given GEN, which is allocated as a
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.new_ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_p);
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9300
 *         return p
 * 
 *     def __call__(self, s):             # <<<<<<<<<<<<<<
 *         """
 *         Create the PARI object obtained by evaluating s using PARI.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_41__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_40__call__[] = "\n        Create the PARI object obtained by evaluating s using PARI.\n        \n        EXAMPLES::\n        \n            >>> pari([2,3,5])\n            [2, 3, 5]\n            >>> pari('[0,1;2,3]')\n            [0, 1; 2, 3]\n            >>> pari('x^2-3')\n            x^2 - 3\n        \n        ::\n        \n            >>> a = pari(1); a, a.type()\n            (1, 't_INT')\n            >>> a = pari('1/2'); a, a.type()\n            (1/2, 't_FRAC')\n\n        See :func:`pari` for more examples.\n        ";
  #if CYTHON_COMPILING_IN_CPYTHON
  struct wrapperbase __pyx_wrapperbase_10cypari_src_3gen_12PariInstance_40__call__;
  #endif
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_41__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_s = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,0};
      PyObject* values[1] = {0};
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_s)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
        goto __pyx_L5_argtuple_error;
      } else {
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      }
      __pyx_v_s = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_40__call__(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_s);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_40__call__(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_s) {
    int __pyx_v_length;
    int __pyx_v_i;
    GEN __pyx_v_z;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_v = 0;
    PyObject *__pyx_v_t = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *__pyx_t_7 = NULL;
    PyObject *__pyx_t_8 = NULL;
    int __pyx_t_9;
    double __pyx_t_10;
    int __pyx_t_11;
    Py_ssize_t __pyx_t_12;
    PyObject *__pyx_t_13 = NULL;
    PyObject *__pyx_t_14 = NULL;
    char *__pyx_t_15;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("__call__", 0);

    /* "cypari_src/gen.pyx":9326
 *         cdef gen v
 * 
 *         if isinstance(s, gen):             # <<<<<<<<<<<<<<
 *             return s
 *         if hasattr(s, "_pari_"):
 */
    __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_s, ((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)); 
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":9327
 * 
 *         if isinstance(s, gen):
 *             return s             # <<<<<<<<<<<<<<
 *         if hasattr(s, "_pari_"):
 *             return s._pari_()
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_s);
      __pyx_r = __pyx_v_s;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9328
 *         if isinstance(s, gen):
 *             return s
 *         if hasattr(s, "_pari_"):             # <<<<<<<<<<<<<<
 *             return s._pari_()
 *         # Check for basic Python types
 */
    __pyx_t_2 = PyObject_HasAttr(__pyx_v_s, __pyx_n_s_pari_2); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9329
 *             return s
 *         if hasattr(s, "_pari_"):
 *             return s._pari_()             # <<<<<<<<<<<<<<
 *         # Check for basic Python types
 *         if isinstance(s, int):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_pari_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9331
 *             return s._pari_()
 *         # Check for basic Python types
 *         if isinstance(s, int):             # <<<<<<<<<<<<<<
 *             try:
 *                 i = s
 */
    __pyx_t_1 = PyInt_Check(__pyx_v_s); 
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":9332
 *         # Check for basic Python types
 *         if isinstance(s, int):
 *             try:             # <<<<<<<<<<<<<<
 *                 i = s
 *                 sig_on()
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "cypari_src/gen.pyx":9333
 *         if isinstance(s, int):
 *             try:
 *                 i = s             # <<<<<<<<<<<<<<
 *                 sig_on()
 *                 return self.new_leaf_gen(stoi(i))
 */
          __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_s); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9333; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __pyx_v_i = __pyx_t_9;

          /* "cypari_src/gen.pyx":9334
 *             try:
 *                 i = s
 *                 sig_on()             # <<<<<<<<<<<<<<
 *                 return self.new_leaf_gen(stoi(i))
 *             except OverflowError:
 */
          SIG_ON_MACRO();

          /* "cypari_src/gen.pyx":9335
 *                 i = s
 *                 sig_on()
 *                 return self.new_leaf_gen(stoi(i))             # <<<<<<<<<<<<<<
 *             except OverflowError:
 *                 pass
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_leaf_gen(__pyx_v_self, stoi(__pyx_v_i))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9335; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_r = __pyx_t_3;
          __pyx_t_3 = 0;
          goto __pyx_L10_try_return;
        }
        __pyx_L6_error:;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "cypari_src/gen.pyx":9336
 *                 sig_on()
 *                 return self.new_leaf_gen(stoi(i))
 *             except OverflowError:             # <<<<<<<<<<<<<<
 *                 pass
 *         if isinstance(s, bool):
 */
        __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError);
        if (__pyx_t_9) {
          PyErr_Restore(0,0,0);
          goto __pyx_L7_exception_handled;
        }
        goto __pyx_L8_except_error;
        __pyx_L8_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L10_try_return:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L0;
        __pyx_L7_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "cypari_src/gen.pyx":9338
 *             except OverflowError:
 *                 pass
 *         if isinstance(s, bool):             # <<<<<<<<<<<<<<
 *             if s:
 *                 return self.PARI_ONE
 */
    __pyx_t_3 = ((PyObject*)&PyBool_Type);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_s, __pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9339
 *                 pass
 *         if isinstance(s, bool):
 *             if s:             # <<<<<<<<<<<<<<
 *                 return self.PARI_ONE
 *             else:
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_s); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_1) {

        /* "cypari_src/gen.pyx":9340
 *         if isinstance(s, bool):
 *             if s:
 *                 return self.PARI_ONE             # <<<<<<<<<<<<<<
 *             else:
 *                 return self.PARI_ZERO
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(((PyObject *)__pyx_v_self->PARI_ONE));
        __pyx_r = ((PyObject *)__pyx_v_self->PARI_ONE);
        goto __pyx_L0;
      }
      /*else*/ {

        /* "cypari_src/gen.pyx":9342
 *                 return self.PARI_ONE
 *             else:
 *                 return self.PARI_ZERO             # <<<<<<<<<<<<<<
 *         if isinstance(s, float):
 *             sig_on()
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(((PyObject *)__pyx_v_self->PARI_ZERO));
        __pyx_r = ((PyObject *)__pyx_v_self->PARI_ZERO);
        goto __pyx_L0;
      }
    }

    /* "cypari_src/gen.pyx":9343
 *             else:
 *                 return self.PARI_ZERO
 *         if isinstance(s, float):             # <<<<<<<<<<<<<<
 *             sig_on()
 *             return self.new_leaf_gen(dbltor(s))
 */
    __pyx_t_1 = PyFloat_Check(__pyx_v_s); 
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":9344
 *                 return self.PARI_ZERO
 *         if isinstance(s, float):
 *             sig_on()             # <<<<<<<<<<<<<<
 *             return self.new_leaf_gen(dbltor(s))
 *         if isinstance(s, complex):
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":9345
 *         if isinstance(s, float):
 *             sig_on()
 *             return self.new_leaf_gen(dbltor(s))             # <<<<<<<<<<<<<<
 *         if isinstance(s, complex):
 *             sig_on()
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_s); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_leaf_gen(__pyx_v_self, dbltor(__pyx_t_10))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9346
 *             sig_on()
 *             return self.new_leaf_gen(dbltor(s))
 *         if isinstance(s, complex):             # <<<<<<<<<<<<<<
 *             sig_on()
 *             set_mark()
 */
    __pyx_t_2 = PyComplex_Check(__pyx_v_s); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9347
 *             return self.new_leaf_gen(dbltor(s))
 *         if isinstance(s, complex):
 *             sig_on()             # <<<<<<<<<<<<<<
 *             set_mark()
 *             z = cgetg(3, t_COMPLEX)
 */
      SIG_ON_MACRO();

      /* "cypari_src/gen.pyx":9348
 *         if isinstance(s, complex):
 *             sig_on()
 *             set_mark()             # <<<<<<<<<<<<<<
 *             z = cgetg(3, t_COMPLEX)
 *             set_gel(z, 1, dbltor(s.real))
 */
      __pyx_f_10cypari_src_3gen_set_mark();

      /* "cypari_src/gen.pyx":9349
 *             sig_on()
 *             set_mark()
 *             z = cgetg(3, t_COMPLEX)             # <<<<<<<<<<<<<<
 *             set_gel(z, 1, dbltor(s.real))
 *             set_gel(z, 2, dbltor(s.imag))
 */
      __pyx_v_z = cgetg(3, t_COMPLEX);

      /* "cypari_src/gen.pyx":9350
 *             set_mark()
 *             z = cgetg(3, t_COMPLEX)
 *             set_gel(z, 1, dbltor(s.real))             # <<<<<<<<<<<<<<
 *             set_gel(z, 2, dbltor(s.imag))
 *             return self.new_gen(z)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9350; __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 = 9350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      set_gel(__pyx_v_z, 1, dbltor(__pyx_t_10));

      /* "cypari_src/gen.pyx":9351
 *             z = cgetg(3, t_COMPLEX)
 *             set_gel(z, 1, dbltor(s.real))
 *             set_gel(z, 2, dbltor(s.imag))             # <<<<<<<<<<<<<<
 *             return self.new_gen(z)
 *         if isinstance(s, (list, xrange, tuple, types.GeneratorType)):
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_imag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9351; __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 = 9351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      set_gel(__pyx_v_z, 2, dbltor(__pyx_t_10));

      /* "cypari_src/gen.pyx":9352
 *             set_gel(z, 1, dbltor(s.real))
 *             set_gel(z, 2, dbltor(s.imag))
 *             return self.new_gen(z)             # <<<<<<<<<<<<<<
 *         if isinstance(s, (list, xrange, tuple, types.GeneratorType)):
 *             length = len(s)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, __pyx_v_z)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9353
 *             set_gel(z, 2, dbltor(s.imag))
 *             return self.new_gen(z)
 *         if isinstance(s, (list, xrange, tuple, types.GeneratorType)):             # <<<<<<<<<<<<<<
 *             length = len(s)
 *             v = self._empty_vector(length)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_xrange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_GeneratorType); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = PyList_Check(__pyx_v_s); 
    __pyx_t_11 = (__pyx_t_2 != 0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_11 = PyObject_IsInstance(__pyx_v_s, __pyx_t_3); 
    __pyx_t_2 = (__pyx_t_11 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_2 = PyTuple_Check(__pyx_v_s); 
    __pyx_t_11 = (__pyx_t_2 != 0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_11 = PyObject_IsInstance(__pyx_v_s, __pyx_t_5); 
    __pyx_t_2 = (__pyx_t_11 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L19_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":9354
 *             return self.new_gen(z)
 *         if isinstance(s, (list, xrange, tuple, types.GeneratorType)):
 *             length = len(s)             # <<<<<<<<<<<<<<
 *             v = self._empty_vector(length)
 *             for i from 0 <= i < length:
 */
      __pyx_t_12 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_length = __pyx_t_12;

      /* "cypari_src/gen.pyx":9355
 *         if isinstance(s, (list, xrange, tuple, types.GeneratorType)):
 *             length = len(s)
 *             v = self._empty_vector(length)             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < length:
 *                 v[i] = self(s[i])
 */
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->_empty_vector(__pyx_v_self, __pyx_v_length)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_v = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "cypari_src/gen.pyx":9356
 *             length = len(s)
 *             v = self._empty_vector(length)
 *             for i from 0 <= i < length:             # <<<<<<<<<<<<<<
 *                 v[i] = self(s[i])
 *             return v
 */
      __pyx_t_9 = __pyx_v_length;
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {

        /* "cypari_src/gen.pyx":9357
 *             v = self._empty_vector(length)
 *             for i from 0 <= i < length:
 *                 v[i] = self(s[i])             # <<<<<<<<<<<<<<
 *             return v
 *         # In the generic case, convert the object to a byte array and
 */
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_s, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9357; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(((PyObject *)__pyx_v_self));
        __pyx_t_4 = ((PyObject *)__pyx_v_self); __pyx_t_13 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_13) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
          PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }

      /* "cypari_src/gen.pyx":9358
 *             for i from 0 <= i < length:
 *                 v[i] = self(s[i])
 *             return v             # <<<<<<<<<<<<<<
 *         # In the generic case, convert the object to a byte array and
 *         # hope that PARI can parse it.
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_v));
      __pyx_r = ((PyObject *)__pyx_v_v);
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9362
 *         # hope that PARI can parse it.
 *         global gnil
 *         t = str_to_chars(str(s))             # <<<<<<<<<<<<<<
 *         set_mark()
 *         sig_on()
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_to_chars); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_INCREF(__pyx_v_s);
    PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_s);
    __Pyx_GIVEREF(__pyx_v_s);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_14) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
      PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_t = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cypari_src/gen.pyx":9363
 *         global gnil
 *         t = str_to_chars(str(s))
 *         set_mark()             # <<<<<<<<<<<<<<
 *         sig_on()
 *         z = gp_read_str(t)
 */
    __pyx_f_10cypari_src_3gen_set_mark();

    /* "cypari_src/gen.pyx":9364
 *         t = str_to_chars(str(s))
 *         set_mark()
 *         sig_on()             # <<<<<<<<<<<<<<
 *         z = gp_read_str(t)
 *         if z == gnil:
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9365
 *         set_mark()
 *         sig_on()
 *         z = gp_read_str(t)             # <<<<<<<<<<<<<<
 *         if z == gnil:
 *             sig_off()
 */
    __pyx_t_15 = __Pyx_PyObject_AsString(__pyx_v_t); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_z = gp_read_str(__pyx_t_15);

    /* "cypari_src/gen.pyx":9366
 *         sig_on()
 *         z = gp_read_str(t)
 *         if z == gnil:             # <<<<<<<<<<<<<<
 *             sig_off()
 *             return None
 */
    __pyx_t_2 = ((__pyx_v_z == gnil) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":9367
 *         z = gp_read_str(t)
 *         if z == gnil:
 *             sig_off()             # <<<<<<<<<<<<<<
 *             return None
 *         return self.new_gen(z)
 */
      __pyx_f_10cypari_src_3gen_sig_off();

      /* "cypari_src/gen.pyx":9368
 *         if z == gnil:
 *             sig_off()
 *             return None             # <<<<<<<<<<<<<<
 *         return self.new_gen(z)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9369
 *             sig_off()
 *             return None
 *         return self.new_gen(z)             # <<<<<<<<<<<<<<
 * 
 *     def new_with_bits_prec(self, s, long precision):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, __pyx_v_z)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9300
 *         return p
 * 
 *     def __call__(self, s):             # <<<<<<<<<<<<<<
 *         """
 *         Create the PARI object obtained by evaluating s using PARI.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_13);
    __Pyx_XDECREF(__pyx_t_14);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_v);
    __Pyx_XDECREF(__pyx_v_t);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9371
 *         return self.new_gen(z)
 * 
 *     def new_with_bits_prec(self, s, long precision):             # <<<<<<<<<<<<<<
 *         r"""
 *         pari.new_with_bits_prec(self, s, precision) creates s as a PARI
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_43new_with_bits_prec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_42new_with_bits_prec[] = "\n        pari.new_with_bits_prec(self, s, precision) creates s as a PARI\n        gen with (at most) precision *bits* of precision.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_43new_with_bits_prec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_s = 0;
    long __pyx_v_precision;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("new_with_bits_prec (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_precision,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_s)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_precision)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("new_with_bits_prec", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new_with_bits_prec") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9371; __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_s = values[0];
      __pyx_v_precision = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_precision == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("new_with_bits_prec", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.new_with_bits_prec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_42new_with_bits_prec(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_s, __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_42new_with_bits_prec(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_s, long __pyx_v_precision) {
    unsigned long __pyx_v_old_prec;
    PyObject *__pyx_v_x = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    long __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    int __pyx_t_3;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *__pyx_t_7 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("new_with_bits_prec", 0);

    /* "cypari_src/gen.pyx":9377
 *         """
 *         cdef unsigned long old_prec
 *         old_prec = GP_DATA.fmt.sigd             # <<<<<<<<<<<<<<
 *         precision = prec_bits_to_dec(precision)
 *         if not precision:
 */
    __pyx_t_1 = GP_DATA->fmt->sigd;
    __pyx_v_old_prec = __pyx_t_1;

    /* "cypari_src/gen.pyx":9378
 *         cdef unsigned long old_prec
 *         old_prec = GP_DATA.fmt.sigd
 *         precision = prec_bits_to_dec(precision)             # <<<<<<<<<<<<<<
 *         if not precision:
 *             precision = old_prec
 */
    __pyx_t_2 = __pyx_f_10cypari_src_3gen_prec_bits_to_dec(__pyx_v_precision, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_precision = __pyx_t_1;

    /* "cypari_src/gen.pyx":9379
 *         old_prec = GP_DATA.fmt.sigd
 *         precision = prec_bits_to_dec(precision)
 *         if not precision:             # <<<<<<<<<<<<<<
 *             precision = old_prec
 *         self.set_real_precision(precision)
 */
    __pyx_t_3 = ((!(__pyx_v_precision != 0)) != 0);
    if (__pyx_t_3) {

      /* "cypari_src/gen.pyx":9380
 *         precision = prec_bits_to_dec(precision)
 *         if not precision:
 *             precision = old_prec             # <<<<<<<<<<<<<<
 *         self.set_real_precision(precision)
 *         x = self(s)
 */
      __pyx_v_precision = __pyx_v_old_prec;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":9381
 *         if not precision:
 *             precision = old_prec
 *         self.set_real_precision(precision)             # <<<<<<<<<<<<<<
 *         x = self(s)
 *         self.set_real_precision(old_prec)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_real_precision); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_precision); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":9382
 *             precision = old_prec
 *         self.set_real_precision(precision)
 *         x = self(s)             # <<<<<<<<<<<<<<
 *         self.set_real_precision(old_prec)
 *         return x
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_t_4 = ((PyObject *)__pyx_v_self); __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_s);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_s);
      __Pyx_GIVEREF(__pyx_v_s);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_x = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":9383
 *         self.set_real_precision(precision)
 *         x = self(s)
 *         self.set_real_precision(old_prec)             # <<<<<<<<<<<<<<
 *         return x
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_real_precision); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_unsigned_long(__pyx_v_old_prec); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":9384
 *         x = self(s)
 *         self.set_real_precision(old_prec)
 *         return x             # <<<<<<<<<<<<<<
 * 
 *     cdef long get_var(self, v) except -2:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_x);
    __pyx_r = __pyx_v_x;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9371
 *         return self.new_gen(z)
 * 
 *     def new_with_bits_prec(self, s, long precision):             # <<<<<<<<<<<<<<
 *         r"""
 *         pari.new_with_bits_prec(self, s, precision) creates s as a PARI
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.new_with_bits_prec", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_x);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9386
 *         return x
 * 
 *     cdef long get_var(self, v) except -2:             # <<<<<<<<<<<<<<
 *         """
 *         Converts a Python string into a PARI variable reference number. Or
 */

  static long __pyx_f_10cypari_src_3gen_12PariInstance_get_var(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_v) {
    PyObject *__pyx_v_s = NULL;
    long __pyx_r;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    char *__pyx_t_7;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("get_var", 0);

    /* "cypari_src/gen.pyx":9393
 *         global jmp_env
 *         cdef int save
 *         if v != -1:             # <<<<<<<<<<<<<<
 *             s = str_to_chars(str(v))
 *             # sig_on not allowed here - does not return an object.
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_v, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9393; __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 = 9393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":9394
 *         cdef int save
 *         if v != -1:
 *             s = str_to_chars(str(v))             # <<<<<<<<<<<<<<
 *             # sig_on not allowed here - does not return an object.
 *             return fetch_user_var(s)
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_to_chars); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9394; __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 = 9394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_s = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":9396
 *             s = str_to_chars(str(v))
 *             # sig_on not allowed here - does not return an object.
 *             return fetch_user_var(s)             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */
      __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_s); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = fetch_user_var(__pyx_t_7);
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9397
 *             # sig_on not allowed here - does not return an object.
 *             return fetch_user_var(s)
 *         return -1             # <<<<<<<<<<<<<<
 * 
 *     ############################################################
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9386
 *         return x
 * 
 *     cdef long get_var(self, v) except -2:             # <<<<<<<<<<<<<<
 *         """
 *         Converts a Python string into a PARI variable reference number. Or
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_WriteUnraisable("cypari_src.gen.PariInstance.get_var", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_s);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9403
 *     ############################################################
 * 
 *     def allocatemem(self, s=0, silent=False):             # <<<<<<<<<<<<<<
 *         r"""
 *         Double the *PARI* stack.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_45allocatemem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_44allocatemem[] = "\n        Double the *PARI* stack.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_45allocatemem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_s = 0;
    PyObject *__pyx_v_silent = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("allocatemem (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_silent,0};
      PyObject* values[2] = {0,0};
      values[0] = ((PyObject *)__pyx_int_0);
      values[1] = ((PyObject *)Py_False);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_s);
            if (value) { values[0] = value; kw_args--; }
          }
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_silent);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allocatemem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9403; __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_s = values[0];
      __pyx_v_silent = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("allocatemem", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9403; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.allocatemem", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_44allocatemem(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_s, __pyx_v_silent);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_44allocatemem(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_s, PyObject *__pyx_v_silent) {
    size_t __pyx_v_a;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    int __pyx_t_3;
    int __pyx_t_4;
    size_t __pyx_t_5;
    PyObject *__pyx_t_6 = NULL;
    int __pyx_t_7;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("allocatemem", 0);
    __Pyx_INCREF(__pyx_v_s);

    /* "cypari_src/gen.pyx":9407
 *         Double the *PARI* stack.
 *         """
 *         if s == 0 and not silent:             # <<<<<<<<<<<<<<
 *             print( "Doubling the PARI stack." )
 *         s = int(s)
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_silent); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = ((!__pyx_t_3) != 0);
    __pyx_t_1 = __pyx_t_4;
    __pyx_L4_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9408
 *         """
 *         if s == 0 and not silent:
 *             print( "Doubling the PARI stack." )             # <<<<<<<<<<<<<<
 *         s = int(s)
 *         cdef size_t a = s
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":9409
 *         if s == 0 and not silent:
 *             print( "Doubling the PARI stack." )
 *         s = int(s)             # <<<<<<<<<<<<<<
 *         cdef size_t a = s
 *         if int(a) != s:
 */
    __pyx_t_2 = PyNumber_Int(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":9410
 *             print( "Doubling the PARI stack." )
 *         s = int(s)
 *         cdef size_t a = s             # <<<<<<<<<<<<<<
 *         if int(a) != s:
 *             raise ValueError, "s must be nonnegative and not too big."
 */
    __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_s); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_a = __pyx_t_5;

    /* "cypari_src/gen.pyx":9411
 *         s = int(s)
 *         cdef size_t a = s
 *         if int(a) != s:             # <<<<<<<<<<<<<<
 *             raise ValueError, "s must be nonnegative and not too big."
 *         init_stack(s)
 */
    __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9411; __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_RichCompare(__pyx_t_2, __pyx_v_s, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9412
 *         cdef size_t a = s
 *         if int(a) != s:
 *             raise ValueError, "s must be nonnegative and not too big."             # <<<<<<<<<<<<<<
 *         init_stack(s)
 * 
 */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_s_must_be_nonnegative_and_not_to, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":9413
 *         if int(a) != s:
 *             raise ValueError, "s must be nonnegative and not too big."
 *         init_stack(s)             # <<<<<<<<<<<<<<
 * 
 *     def pari_version(self):
 */
    __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_s); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = __pyx_f_10cypari_src_3gen_init_stack(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cypari_src/gen.pyx":9403
 *     ############################################################
 * 
 *     def allocatemem(self, s=0, silent=False):             # <<<<<<<<<<<<<<
 *         r"""
 *         Double the *PARI* stack.
 */

    /* function exit code */
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.allocatemem", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_s);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9415
 *         init_stack(s)
 * 
 *     def pari_version(self):             # <<<<<<<<<<<<<<
 *         return str(PARIVERSION)
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_47pari_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_47pari_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("pari_version (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_46pari_version(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_46pari_version(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__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("pari_version", 0);

    /* "cypari_src/gen.pyx":9416
 * 
 *     def pari_version(self):
 *         return str(PARIVERSION)             # <<<<<<<<<<<<<<
 * 
 *     def init_primes(self, _M):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBytes_FromString(PARIVERSION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9416; __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 = 9416; __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9415
 *         init_stack(s)
 * 
 *     def pari_version(self):             # <<<<<<<<<<<<<<
 *         return str(PARIVERSION)
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.pari_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9418
 *         return str(PARIVERSION)
 * 
 *     def init_primes(self, _M):             # <<<<<<<<<<<<<<
 *         """
 *         Recompute the primes table including at least all primes up to M
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_49init_primes(PyObject *__pyx_v_self, PyObject *__pyx_v__M); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_48init_primes[] = "\n        Recompute the primes table including at least all primes up to M\n        (but possibly more).\n        \n        EXAMPLES::\n        \n            >>> pari.init_primes(200000)\n\n        We make sure that ticket #11741 has been fixed, and double check to\n        make sure that diffptr has not been freed::\n\n            >>> pari.init_primes(2**62)\n            Traceback (most recent call last):\n            ...\n            PariError: not enough memory (28)            # 64-bit\n            OverflowError: long int too large to convert # 32-bit\n            >>> pari.init_primes(200000)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_49init_primes(PyObject *__pyx_v_self, PyObject *__pyx_v__M) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("init_primes (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_48init_primes(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((PyObject *)__pyx_v__M));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_48init_primes(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v__M) {
    unsigned long __pyx_v_M;
    unsigned char *__pyx_v_tmpptr;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    unsigned long __pyx_t_1;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("init_primes", 0);

    /* "cypari_src/gen.pyx":9439
 *         cdef unsigned long M
 *         cdef unsigned char *tmpptr
 *         M = _M             # <<<<<<<<<<<<<<
 *         global diffptr, num_primes
 *         if M <= num_primes:
 */
    __pyx_t_1 = __Pyx_PyInt_As_unsigned_long(__pyx_v__M); if (unlikely((__pyx_t_1 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_M = __pyx_t_1;

    /* "cypari_src/gen.pyx":9441
 *         M = _M
 *         global diffptr, num_primes
 *         if M <= num_primes:             # <<<<<<<<<<<<<<
 *             return
 *         sig_on()
 */
    __pyx_t_2 = ((__pyx_v_M <= __pyx_v_10cypari_src_3gen_num_primes) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":9442
 *         global diffptr, num_primes
 *         if M <= num_primes:
 *             return             # <<<<<<<<<<<<<<
 *         sig_on()
 *         tmpptr = initprimes(M)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9443
 *         if M <= num_primes:
 *             return
 *         sig_on()             # <<<<<<<<<<<<<<
 *         tmpptr = initprimes(M)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9444
 *             return
 *         sig_on()
 *         tmpptr = initprimes(M)             # <<<<<<<<<<<<<<
 *         sig_off()
 *         pari_free(<void*> diffptr)
 */
    __pyx_v_tmpptr = initprimes(__pyx_v_M);

    /* "cypari_src/gen.pyx":9445
 *         sig_on()
 *         tmpptr = initprimes(M)
 *         sig_off()             # <<<<<<<<<<<<<<
 *         pari_free(<void*> diffptr)
 *         num_primes = M
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":9446
 *         tmpptr = initprimes(M)
 *         sig_off()
 *         pari_free(<void*> diffptr)             # <<<<<<<<<<<<<<
 *         num_primes = M
 *         diffptr = tmpptr
 */
    pari_free(((void *)diffptr));

    /* "cypari_src/gen.pyx":9447
 *         sig_off()
 *         pari_free(<void*> diffptr)
 *         num_primes = M             # <<<<<<<<<<<<<<
 *         diffptr = tmpptr
 * 
 */
    __pyx_v_10cypari_src_3gen_num_primes = __pyx_v_M;

    /* "cypari_src/gen.pyx":9448
 *         pari_free(<void*> diffptr)
 *         num_primes = M
 *         diffptr = tmpptr             # <<<<<<<<<<<<<<
 * 
 * 
 */
    diffptr = __pyx_v_tmpptr;

    /* "cypari_src/gen.pyx":9418
 *         return str(PARIVERSION)
 * 
 *     def init_primes(self, _M):             # <<<<<<<<<<<<<<
 *         """
 *         Recompute the primes table including at least all primes up to M
 */

    /* function exit code */
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.init_primes", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9455
 *     ##############################################
 * 
 *     def read(self, filename):             # <<<<<<<<<<<<<<
 *         r"""
 *         Read a script from the named filename into the interpreter.  The
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_51read(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_50read[] = "\n        Read a script from the named filename into the interpreter.  The\n        functions defined in the script are then available for use from\n        Sage/PARI.  The result of the last command in ``filename`` is\n        returned.\n        \n        EXAMPLES:\n        \n        Create a gp file::\n        \n            >>> import tempfile\n            >>> gpfile = tempfile.NamedTemporaryFile(mode=\"w\")\n            >>> n = gpfile.file.write(\"mysquare(n) = {\\n\")\n            >>> n = gpfile.file.write(\"    n^2;\\n\")\n            >>> n = gpfile.file.write(\"}\\n\")\n            >>> n = gpfile.file.write(\"polcyclo(5)\\n\")\n            >>> gpfile.file.flush()\n        \n        Reading it in, we get the result of the last line::\n\n            >>> pari.read(gpfile.name)\n            x^4 + x^3 + x^2 + x + 1\n\n        Call the function defined in the gp file::\n\n            >>> pari('mysquare(12)')\n            144\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_51read(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("read (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_50read(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((PyObject *)__pyx_v_filename));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_50read(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_filename) {
    PyObject *__pyx_v_fname = 0;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    char *__pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("read", 0);

    /* "cypari_src/gen.pyx":9484
 *             144
 *         """
 *         cdef fname = str_to_chars(filename)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(gp_read_file(fname))
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_to_chars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_fname = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9485
 *         """
 *         cdef fname = str_to_chars(filename)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(gp_read_file(fname))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9486
 *         cdef fname = str_to_chars(filename)
 *         sig_on()
 *         return self.new_gen(gp_read_file(fname))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, gp_read_file(__pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9455
 *     ##############################################
 * 
 *     def read(self, filename):             # <<<<<<<<<<<<<<
 *         r"""
 *         Read a script from the named filename into the interpreter.  The
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_fname);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9491
 *     ##############################################
 * 
 *     def _primelimit(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of primes already computed
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_53_primelimit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_52_primelimit[] = "\n        Return the number of primes already computed\n        in this PARI instance.\n\n        EXAMPLES:\n            >>> print( pari._primelimit() )\n            500000\n            >>> pari.init_primes(600000)\n            >>> print( pari._primelimit() )\n            600000\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_53_primelimit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("_primelimit (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_52_primelimit(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_52_primelimit(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__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("_primelimit", 0);

    /* "cypari_src/gen.pyx":9504
 *         """
 *         global num_primes
 *         return num_primes             # <<<<<<<<<<<<<<
 * 
 *     def prime_list(self, long n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_10cypari_src_3gen_num_primes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9491
 *     ##############################################
 * 
 *     def _primelimit(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of primes already computed
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance._primelimit", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9506
 *         return num_primes
 * 
 *     def prime_list(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         prime_list(n): returns list of the first n primes
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_55prime_list(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_54prime_list[] = "\n        prime_list(n): returns list of the first n primes\n        \n        To extend the table of primes use pari.init_primes(M).\n        \n        INPUT:\n        \n        \n        -  ``n`` - C long\n        \n        \n        OUTPUT:\n        \n        \n        -  ``gen`` - PARI list of first n primes\n        \n        \n        EXAMPLES::\n        \n            >>> pari.prime_list(0)\n            []\n            >>> pari.prime_list(-1)\n            []\n            >>> pari.prime_list(3)\n            [2, 3, 5]\n            >>> pari.prime_list(10)\n            [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\n            >>> pari.prime_list(20)\n            [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]\n            >>> len(pari.prime_list(1000))\n            1000\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_55prime_list(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("prime_list (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9506; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.prime_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_54prime_list(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_54prime_list(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("prime_list", 0);

    /* "cypari_src/gen.pyx":9539
 *             1000
 *         """
 *         if n >= 2:             # <<<<<<<<<<<<<<
 *             self.nth_prime(n)
 *         sig_on()
 */
    __pyx_t_1 = ((__pyx_v_n >= 2) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9540
 *         """
 *         if n >= 2:
 *             self.nth_prime(n)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(primes(n))
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nth_prime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9540; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":9541
 *         if n >= 2:
 *             self.nth_prime(n)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(primes(n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9542
 *             self.nth_prime(n)
 *         sig_on()
 *         return self.new_gen(primes(n))             # <<<<<<<<<<<<<<
 * 
 *     def primes_up_to_n(self, long n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, primes(__pyx_v_n))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9506
 *         return num_primes
 * 
 *     def prime_list(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         prime_list(n): returns list of the first n primes
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.prime_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9544
 *         return self.new_gen(primes(n))
 * 
 *     def primes_up_to_n(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the primes <= n as a pari list.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_57primes_up_to_n(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_56primes_up_to_n[] = "\n        Return the primes <= n as a pari list.\n        \n        EXAMPLES::\n        \n            >>> pari.primes_up_to_n(1)\n            []\n            >>> pari.primes_up_to_n(20)\n            [2, 3, 5, 7, 11, 13, 17, 19]\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_57primes_up_to_n(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("primes_up_to_n (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9544; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.primes_up_to_n", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_56primes_up_to_n(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_56primes_up_to_n(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *__pyx_t_7 = NULL;
    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("primes_up_to_n", 0);

    /* "cypari_src/gen.pyx":9555
 *             [2, 3, 5, 7, 11, 13, 17, 19]
 *         """
 *         if n <= 1:             # <<<<<<<<<<<<<<
 *             return pari([])
 *         self.init_primes(n+1)
 */
    __pyx_t_1 = ((__pyx_v_n <= 1) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9556
 *         """
 *         if n <= 1:
 *             return pari([])             # <<<<<<<<<<<<<<
 *         self.init_primes(n+1)
 *         return self.prime_list(pari(n).primepi())
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9556; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9557
 *         if n <= 1:
 *             return pari([])
 *         self.init_primes(n+1)             # <<<<<<<<<<<<<<
 *         return self.prime_list(pari(n).primepi())
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_primes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_v_n + 1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":9558
 *             return pari([])
 *         self.init_primes(n+1)
 *         return self.prime_list(pari(n).primepi())             # <<<<<<<<<<<<<<
 * 
 * ##         cdef long k
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prime_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_primepi); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9544
 *         return self.new_gen(primes(n))
 * 
 *     def primes_up_to_n(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the primes <= n as a pari list.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_9);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.primes_up_to_n", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9569
 * ##         return v[:pari(n).primepi()]
 * 
 *     def __nth_prime(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         nth_prime(n): returns the n-th prime, where n is a C-int
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_59__nth_prime(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_58__nth_prime[] = "\n        nth_prime(n): returns the n-th prime, where n is a C-int\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_59__nth_prime(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__nth_prime (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9569; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.__nth_prime", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_58__nth_prime(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_58__nth_prime(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n) {
    GEN __pyx_v_g;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("__nth_prime", 0);

    /* "cypari_src/gen.pyx":9575
 *         global num_primes
 * 
 *         if n <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "nth prime meaningless for non-positive n (=%s)"%n
 *         cdef GEN g
 */
    __pyx_t_1 = ((__pyx_v_n <= 0) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9576
 * 
 *         if n <= 0:
 *             raise ValueError, "nth prime meaningless for non-positive n (=%s)"%n             # <<<<<<<<<<<<<<
 *         cdef GEN g
 *         sig_on()
 */
      __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_nth_prime_meaningless_for_non_po, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":9578
 *             raise ValueError, "nth prime meaningless for non-positive n (=%s)"%n
 *         cdef GEN g
 *         sig_on()             # <<<<<<<<<<<<<<
 *         g = prime(n)
 *         return self.new_gen(g)
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9579
 *         cdef GEN g
 *         sig_on()
 *         g = prime(n)             # <<<<<<<<<<<<<<
 *         return self.new_gen(g)
 * 
 */
    __pyx_v_g = prime(__pyx_v_n);

    /* "cypari_src/gen.pyx":9580
 *         sig_on()
 *         g = prime(n)
 *         return self.new_gen(g)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, __pyx_v_g)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9569
 * ##         return v[:pari(n).primepi()]
 * 
 *     def __nth_prime(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         nth_prime(n): returns the n-th prime, where n is a C-int
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.__nth_prime", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9583
 * 
 * 
 *     def nth_prime(self, long n):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.__nth_prime(n)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_61nth_prime(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_61nth_prime(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("nth_prime (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9583; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.nth_prime", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_60nth_prime(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_60nth_prime(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *__pyx_t_7 = NULL;
    PyObject *__pyx_t_8 = NULL;
    int __pyx_t_9;
    long __pyx_t_10;
    unsigned long __pyx_t_11;
    unsigned long __pyx_t_12;
    PyObject *__pyx_t_13 = NULL;
    PyObject *__pyx_t_14 = NULL;
    PyObject *__pyx_t_15 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("nth_prime", 0);

    /* "cypari_src/gen.pyx":9584
 * 
 *     def nth_prime(self, long n):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.__nth_prime(n)
 *         except PariError:
 */
    {
      __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:*/ {

        /* "cypari_src/gen.pyx":9585
 *     def nth_prime(self, long n):
 *         try:
 *             return self.__nth_prime(n)             # <<<<<<<<<<<<<<
 *         except PariError:
 *             self.init_primes(max(2*num_primes,20*n))
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nth_prime_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        if (!__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L7_try_return;
      }
      __pyx_L3_error:;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cypari_src/gen.pyx":9586
 *         try:
 *             return self.__nth_prime(n)
 *         except PariError:             # <<<<<<<<<<<<<<
 *             self.init_primes(max(2*num_primes,20*n))
 *             return self.nth_prime(n)
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PariError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9586; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_9) {
        __Pyx_AddTraceback("cypari_src.gen.PariInstance.nth_prime", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9586; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_8);

        /* "cypari_src/gen.pyx":9587
 *             return self.__nth_prime(n)
 *         except PariError:
 *             self.init_primes(max(2*num_primes,20*n))             # <<<<<<<<<<<<<<
 *             return self.nth_prime(n)
 * 
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_primes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9587; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_10 = (20 * __pyx_v_n);
        __pyx_t_11 = (2 * __pyx_v_10cypari_src_3gen_num_primes);
        if (((__pyx_t_10 > __pyx_t_11) != 0)) {
          __pyx_t_12 = __pyx_t_10;
        } else {
          __pyx_t_12 = __pyx_t_11;
        }
        __pyx_t_13 = __Pyx_PyInt_From_unsigned_long(__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9587; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_14) {
          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9587; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else {
          __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9587; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __Pyx_GOTREF(__pyx_t_15);
          PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
          PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_15, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9587; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cypari_src/gen.pyx":9588
 *         except PariError:
 *             self.init_primes(max(2*num_primes,20*n))
 *             return self.nth_prime(n)             # <<<<<<<<<<<<<<
 * 
 *     def euler(self, precision=0):
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nth_prime); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9588; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_15 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9588; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_13 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_13) {
          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_15); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9588; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else {
          __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9588; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __Pyx_GOTREF(__pyx_t_14);
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
          PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_15);
          __Pyx_GIVEREF(__pyx_t_15);
          __pyx_t_15 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9588; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L6_except_return;
      }
      goto __pyx_L5_except_error;
      __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_L7_try_return:;
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      goto __pyx_L0;
      __pyx_L6_except_return:;
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9583
 * 
 * 
 *     def nth_prime(self, long n):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.__nth_prime(n)
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_13);
    __Pyx_XDECREF(__pyx_t_14);
    __Pyx_XDECREF(__pyx_t_15);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.nth_prime", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9590
 *             return self.nth_prime(n)
 * 
 *     def euler(self, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return Euler's constant to the requested real precision (in bits).
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_63euler(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_62euler[] = "\n        Return Euler's constant to the requested real precision (in bits).\n        \n        EXAMPLES::\n        \n            >>> pari.euler()\n            0.577215664901533\n            >>> oldprec = pari.set_real_precision(50)\n            >>> pari.euler(precision=100)\n            0.57721566490153286060651209008240243104\n            >>> pari.set_real_precision(oldprec)\n            50\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_63euler(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("euler (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "euler") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9590; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("euler", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9590; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.euler", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_62euler(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_62euler(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("euler", 0);

    /* "cypari_src/gen.pyx":9604
 *             50
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(mpeuler(pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9605
 *         """
 *         sig_on()
 *         return self.new_gen(mpeuler(pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def pi(self, precision=0):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, mpeuler(__pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9590
 *             return self.nth_prime(n)
 * 
 *     def euler(self, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return Euler's constant to the requested real precision (in bits).
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.euler", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9607
 *         return self.new_gen(mpeuler(pbw(precision)))
 * 
 *     def pi(self, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value of the constant pi to the requested real precision
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_65pi(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_64pi[] = "\n        Return the value of the constant pi to the requested real precision\n        (in bits).\n        \n        EXAMPLES::\n        \n            >>> pari.pi()\n            3.14159265358979\n            >>> oldprec = pari.set_real_precision(50)\n            >>> pari.pi(precision=100)\n            3.14159265358979323846264338327950288420\n            >>> pari.set_real_precision(oldprec)\n            50\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_65pi(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_precision = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("pi (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_0);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          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_precision);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pi") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9607; __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_precision = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("pi", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9607; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.pi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_64pi(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_precision);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_64pi(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_precision) {
    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;
    long __pyx_t_5;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("pi", 0);

    /* "cypari_src/gen.pyx":9622
 *             50
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(mppi(pbw(precision)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9623
 *         """
 *         sig_on()
 *         return self.new_gen(mppi(pbw(precision)))             # <<<<<<<<<<<<<<
 * 
 *     def pollegendre(self, long n, v=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pbw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_precision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_precision);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_precision);
      __Pyx_GIVEREF(__pyx_v_precision);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, mppi(__pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9607
 *         return self.new_gen(mpeuler(pbw(precision)))
 * 
 *     def pi(self, precision=0):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value of the constant pi to the requested real precision
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.pi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9625
 *         return self.new_gen(mppi(pbw(precision)))
 * 
 *     def pollegendre(self, long n, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         pollegendre(n, v=x): Legendre polynomial of degree n (n C-integer),
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_67pollegendre(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_66pollegendre[] = "\n        pollegendre(n, v=x): Legendre polynomial of degree n (n C-integer),\n        in variable v.\n        \n        EXAMPLES::\n        \n            >>> pari.pollegendre(7)\n            429/16*x^7 - 693/16*x^5 + 315/16*x^3 - 35/16*x\n            >>> pari.pollegendre(7, 'z')\n            429/16*z^7 - 693/16*z^5 + 315/16*z^3 - 35/16*z\n            >>> pari.pollegendre(0)\n            1\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_67pollegendre(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("pollegendre (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_v,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_n)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pollegendre") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9625; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9625; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_v = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("pollegendre", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9625; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.pollegendre", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_66pollegendre(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_n, __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_66pollegendre(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_v) {
    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("pollegendre", 0);

    /* "cypari_src/gen.pyx":9639
 *             1
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(pollegendre(n, self.get_var(v)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9640
 *         """
 *         sig_on()
 *         return self.new_gen(pollegendre(n, self.get_var(v)))             # <<<<<<<<<<<<<<
 * 
 *     def poltchebi(self, long n, v=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, pollegendre(__pyx_v_n, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_v)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9625
 *         return self.new_gen(mppi(pbw(precision)))
 * 
 *     def pollegendre(self, long n, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         pollegendre(n, v=x): Legendre polynomial of degree n (n C-integer),
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.pollegendre", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9642
 *         return self.new_gen(pollegendre(n, self.get_var(v)))
 * 
 *     def poltchebi(self, long n, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         poltchebi(n, v=x): Chebyshev polynomial of the first kind of degree
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_69poltchebi(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_68poltchebi[] = "\n        poltchebi(n, v=x): Chebyshev polynomial of the first kind of degree\n        n, in variable v.\n        \n        EXAMPLES::\n        \n            >>> pari.poltchebi(7)\n            64*x^7 - 112*x^5 + 56*x^3 - 7*x\n            >>> pari.poltchebi(7, 'z')\n            64*z^7 - 112*z^5 + 56*z^3 - 7*z\n            >>> pari.poltchebi(0)\n            1\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_69poltchebi(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("poltchebi (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_v,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_n)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "poltchebi") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9642; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9642; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_v = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("poltchebi", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9642; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.poltchebi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_68poltchebi(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_n, __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_68poltchebi(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_v) {
    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("poltchebi", 0);

    /* "cypari_src/gen.pyx":9656
 *             1
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polchebyshev1(n, self.get_var(v)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9657
 *         """
 *         sig_on()
 *         return self.new_gen(polchebyshev1(n, self.get_var(v)))             # <<<<<<<<<<<<<<
 * 
 *     def factorial(self, long n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polchebyshev1(__pyx_v_n, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_v)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9642
 *         return self.new_gen(pollegendre(n, self.get_var(v)))
 * 
 *     def poltchebi(self, long n, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         poltchebi(n, v=x): Chebyshev polynomial of the first kind of degree
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.poltchebi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9659
 *         return self.new_gen(polchebyshev1(n, self.get_var(v)))
 * 
 *     def factorial(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the factorial of the integer n as a PARI gen.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_71factorial(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_70factorial[] = "\n        Return the factorial of the integer n as a PARI gen.\n        \n        EXAMPLES::\n        \n            >>> pari.factorial(0)\n            1\n            >>> pari.factorial(1)\n            1\n            >>> pari.factorial(5)\n            120\n            >>> pari.factorial(25)\n            15511210043330985984000000\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_71factorial(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
    long __pyx_v_n;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("factorial (wrapper)", 0);
    assert(__pyx_arg_n); {
      __pyx_v_n = __Pyx_PyInt_As_long(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9659; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.factorial", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_70factorial(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((long)__pyx_v_n));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_70factorial(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("factorial", 0);

    /* "cypari_src/gen.pyx":9674
 *             15511210043330985984000000
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(mpfact(n))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9675
 *         """
 *         sig_on()
 *         return self.new_gen(mpfact(n))             # <<<<<<<<<<<<<<
 * 
 *     def polcyclo(self, long n, v=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, mpfact(__pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9659
 *         return self.new_gen(polchebyshev1(n, self.get_var(v)))
 * 
 *     def factorial(self, long n):             # <<<<<<<<<<<<<<
 *         """
 *         Return the factorial of the integer n as a PARI gen.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.factorial", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9677
 *         return self.new_gen(mpfact(n))
 * 
 *     def polcyclo(self, long n, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         polcyclo(n, v=x): cyclotomic polynomial of degree n, in variable
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_73polcyclo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_72polcyclo[] = "\n        polcyclo(n, v=x): cyclotomic polynomial of degree n, in variable\n        v.\n        \n        EXAMPLES::\n        \n            >>> pari.polcyclo(8)\n            x^4 + 1\n            >>> pari.polcyclo(7, 'z')\n            z^6 + z^5 + z^4 + z^3 + z^2 + z + 1\n            >>> pari.polcyclo(1)\n            x - 1\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_73polcyclo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polcyclo (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_v,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  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_n)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polcyclo") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9677; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9677; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_v = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polcyclo", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9677; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.polcyclo", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_72polcyclo(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_n, __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_72polcyclo(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_v) {
    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("polcyclo", 0);

    /* "cypari_src/gen.pyx":9691
 *             x - 1
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polcyclo(n, self.get_var(v)))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9692
 *         """
 *         sig_on()
 *         return self.new_gen(polcyclo(n, self.get_var(v)))             # <<<<<<<<<<<<<<
 * 
 *     def polsubcyclo(self, long n, long d, v=-1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polcyclo(__pyx_v_n, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_v)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9677
 *         return self.new_gen(mpfact(n))
 * 
 *     def polcyclo(self, long n, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         polcyclo(n, v=x): cyclotomic polynomial of degree n, in variable
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.polcyclo", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9694
 *         return self.new_gen(polcyclo(n, self.get_var(v)))
 * 
 *     def polsubcyclo(self, long n, long d, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         polsubcyclo(n, d, v=x): return the pari list of polynomial(s)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_75polsubcyclo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_74polsubcyclo[] = "\n        polsubcyclo(n, d, v=x): return the pari list of polynomial(s)\n        defining the sub-abelian extensions of degree `d` of the\n        cyclotomic field `\\QQ(\\zeta_n)`, where `d`\n        divides `\\phi(n)`.\n        \n        EXAMPLES::\n        \n            >>> pari.polsubcyclo(8, 4)\n            [x^4 + 1]\n            >>> pari.polsubcyclo(8, 2, 'z')\n            [z^2 - 2, z^2 + 1, z^2 + 2]\n            >>> pari.polsubcyclo(8, 1)\n            [x - 1]\n            >>> pari.polsubcyclo(8, 3)\n            []\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_75polsubcyclo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    long __pyx_v_d;
    PyObject *__pyx_v_v = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polsubcyclo (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_d,&__pyx_n_s_v,0};
      PyObject* values[3] = {0,0,0};
      values[2] = ((PyObject *)__pyx_int_neg_1);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          case  0: break;
          default: goto __pyx_L5_argtuple_error;
        }
        kw_args = PyDict_Size(__pyx_kwds);
        switch (pos_args) {
          case  0:
          if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("polsubcyclo", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v);
            if (value) { values[2] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polsubcyclo") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9694; __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);
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_d = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_d == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_v = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polsubcyclo", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9694; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.polsubcyclo", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_74polsubcyclo(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_n, __pyx_v_d, __pyx_v_v);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_74polsubcyclo(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, long __pyx_v_d, PyObject *__pyx_v_v) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_plist = 0;
    PyObject *__pyx_r = NULL;
    __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 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("polsubcyclo", 0);

    /* "cypari_src/gen.pyx":9713
 *         """
 *         cdef gen plist
 *         sig_on()             # <<<<<<<<<<<<<<
 *         plist = self.new_gen(polsubcyclo(n, d, self.get_var(v)))
 *         if typ(plist.g) != t_VEC:
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9714
 *         cdef gen plist
 *         sig_on()
 *         plist = self.new_gen(polsubcyclo(n, d, self.get_var(v)))             # <<<<<<<<<<<<<<
 *         if typ(plist.g) != t_VEC:
 *             return pari.vector(1, [plist])
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polsubcyclo(__pyx_v_n, __pyx_v_d, ((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->get_var(__pyx_v_self, __pyx_v_v)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_plist = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9715
 *         sig_on()
 *         plist = self.new_gen(polsubcyclo(n, d, self.get_var(v)))
 *         if typ(plist.g) != t_VEC:             # <<<<<<<<<<<<<<
 *             return pari.vector(1, [plist])
 *         else:
 */
    __pyx_t_2 = ((typ(__pyx_v_plist->g) != t_VEC) != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":9716
 *         plist = self.new_gen(polsubcyclo(n, d, self.get_var(v)))
 *         if typ(plist.g) != t_VEC:
 *             return pari.vector(1, [plist])             # <<<<<<<<<<<<<<
 *         else:
 *             return plist
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_vector); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_plist));
      PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_plist));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_plist));
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":9718
 *             return pari.vector(1, [plist])
 *         else:
 *             return plist             # <<<<<<<<<<<<<<
 *         #return self.new_gen(polsubcyclo(n, d, self.get_var(v)))
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_plist));
      __pyx_r = ((PyObject *)__pyx_v_plist);
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9694
 *         return self.new_gen(polcyclo(n, self.get_var(v)))
 * 
 *     def polsubcyclo(self, long n, long d, v=-1):             # <<<<<<<<<<<<<<
 *         """
 *         polsubcyclo(n, d, v=x): return the pari list of polynomial(s)
 */

    /* function exit code */
    __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_7);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.polsubcyclo", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_plist);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9721
 *         #return self.new_gen(polsubcyclo(n, d, self.get_var(v)))
 * 
 *     def polzagier(self, long n, long m):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polzag(n, m))
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_77polzagier(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_77polzagier(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    long __pyx_v_m;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("polzagier (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_m,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_n)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("polzagier", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polzagier") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9721; __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_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_m = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_m == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("polzagier", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.polzagier", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_76polzagier(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_n, __pyx_v_m);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_76polzagier(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, long __pyx_v_m) {
    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("polzagier", 0);

    /* "cypari_src/gen.pyx":9722
 * 
 *     def polzagier(self, long n, long m):
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(polzag(n, m))
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9723
 *     def polzagier(self, long n, long m):
 *         sig_on()
 *         return self.new_gen(polzag(n, m))             # <<<<<<<<<<<<<<
 * 
 *     def setrand(self, seed):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, polzag(__pyx_v_n, __pyx_v_m))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9721
 *         #return self.new_gen(polsubcyclo(n, d, self.get_var(v)))
 * 
 *     def polzagier(self, long n, long m):             # <<<<<<<<<<<<<<
 *         sig_on()
 *         return self.new_gen(polzag(n, m))
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.polzagier", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9725
 *         return self.new_gen(polzag(n, m))
 * 
 *     def setrand(self, seed):             # <<<<<<<<<<<<<<
 *         """
 *         Sets PARI's current random number seed.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_79setrand(PyObject *__pyx_v_self, PyObject *__pyx_v_seed); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_78setrand[] = "\n        Sets PARI's current random number seed.\n\n        INPUT:\n\n        - ``seed`` -- either a strictly positive integer or a GEN of\n          type ``t_VECSMALL`` as output by ``getrand()``\n        \n        This should not be called directly; instead, use Sage's global\n        random number seed handling in ``sage.misc.randstate``\n        and call ``current_randstate().set_seed_pari()``.\n        \n        EXAMPLES::\n        \n            >>> pari.setrand(50)\n            >>> a = pari.getrand(); a\n            Vecsmall([...])\n            >>> pari.setrand(a)\n            >>> a == pari.getrand()\n            True\n\n        TESTS:\n\n        Check that invalid inputs are handled properly (#11825)::\n\n            >>> pari.setrand(0)\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n            >>> pari.setrand(\"foobar\")\n            Traceback (most recent call last):\n            ...\n            PariError: incorrect type (11)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_79setrand(PyObject *__pyx_v_self, PyObject *__pyx_v_seed) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("setrand (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_78setrand(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((PyObject *)__pyx_v_seed));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_78setrand(CYTHON_UNUSED struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, PyObject *__pyx_v_seed) {
    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("setrand", 0);

    /* "cypari_src/gen.pyx":9760
 *             PariError: incorrect type (11)
 *         """
 *         t0GEN(seed)             # <<<<<<<<<<<<<<
 *         sig_on()
 *         setrand(t0)
 */
    __pyx_t_1 = __pyx_f_10cypari_src_3gen_t0GEN(__pyx_v_seed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9761
 *         """
 *         t0GEN(seed)
 *         sig_on()             # <<<<<<<<<<<<<<
 *         setrand(t0)
 *         sig_off()
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9762
 *         t0GEN(seed)
 *         sig_on()
 *         setrand(t0)             # <<<<<<<<<<<<<<
 *         sig_off()
 * 
 */
    setrand(__pyx_v_10cypari_src_3gen_t0);

    /* "cypari_src/gen.pyx":9763
 *         sig_on()
 *         setrand(t0)
 *         sig_off()             # <<<<<<<<<<<<<<
 * 
 *     def getrand(self):
 */
    __pyx_f_10cypari_src_3gen_sig_off();

    /* "cypari_src/gen.pyx":9725
 *         return self.new_gen(polzag(n, m))
 * 
 *     def setrand(self, seed):             # <<<<<<<<<<<<<<
 *         """
 *         Sets PARI's current random number seed.
 */

    /* function exit code */
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.setrand", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9765
 *         sig_off()
 * 
 *     def getrand(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns PARI's current random number seed.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_81getrand(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_80getrand[] = "\n        Returns PARI's current random number seed.\n\n        OUTPUT:\n\n        GEN of type t_VECSMALL\n        \n        EXAMPLES::\n        \n            >>> pari.setrand(50)\n            >>> a = pari.getrand(); a\n            Vecsmall([...])\n            >>> pari.setrand(a)\n            >>> a == pari.getrand()\n            True\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_81getrand(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("getrand (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_80getrand(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_80getrand(struct __pyx_obj_10cypari_src_3gen_PariInstance *__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("getrand", 0);

    /* "cypari_src/gen.pyx":9782
 *             True
 *         """
 *         sig_on()             # <<<<<<<<<<<<<<
 *         return self.new_gen(getrand())
 * 
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9783
 *         """
 *         sig_on()
 *         return self.new_gen(getrand())             # <<<<<<<<<<<<<<
 * 
 *     def vector(self, long n, entries=None):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, getrand())); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9765
 *         sig_off()
 * 
 *     def getrand(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns PARI's current random number seed.
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.getrand", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9785
 *         return self.new_gen(getrand())
 * 
 *     def vector(self, long n, entries=None):             # <<<<<<<<<<<<<<
 *         """
 *         vector(long n, entries=None): Create and return the length n PARI
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_83vector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_82vector[] = "\n        vector(long n, entries=None): Create and return the length n PARI\n        vector with given list of entries.\n        \n        EXAMPLES::\n        \n            >>> pari.vector(5, [1, 2, 5, 4, 3])\n            [1, 2, 5, 4, 3]\n            >>> pari.vector(2, ['x', 1])\n            [x, 1]\n            >>> pari.vector(2, ['x', 1, 5])\n            Traceback (most recent call last):\n            ...\n            IndexError: length of entries (=3) must equal n (=2)\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_83vector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_n;
    PyObject *__pyx_v_entries = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("vector (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_entries,0};
      PyObject* values[2] = {0,0};
      values[1] = ((PyObject *)Py_None);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          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_n)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_entries);
            if (value) { values[1] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vector") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9785; __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);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_n = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9785; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_entries = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("vector", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9785; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.vector", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_82vector(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_n, __pyx_v_entries);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_82vector(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n, PyObject *__pyx_v_entries) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_v = 0;
    PyObject *__pyx_v_i = NULL;
    PyObject *__pyx_v_x = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_t_3;
    Py_ssize_t __pyx_t_4;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *(*__pyx_t_7)(PyObject *);
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("vector", 0);

    /* "cypari_src/gen.pyx":9801
 *             IndexError: length of entries (=3) must equal n (=2)
 *         """
 *         cdef gen v = self._empty_vector(n)             # <<<<<<<<<<<<<<
 *         if entries is not None:
 *             if len(entries) != n:
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->_empty_vector(__pyx_v_self, __pyx_v_n)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_v = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9802
 *         """
 *         cdef gen v = self._empty_vector(n)
 *         if entries is not None:             # <<<<<<<<<<<<<<
 *             if len(entries) != n:
 *                 raise IndexError, "length of entries (=%s) must equal n (=%s)"%\
 */
    __pyx_t_2 = (__pyx_v_entries != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cypari_src/gen.pyx":9803
 *         cdef gen v = self._empty_vector(n)
 *         if entries is not None:
 *             if len(entries) != n:             # <<<<<<<<<<<<<<
 *                 raise IndexError, "length of entries (=%s) must equal n (=%s)"%\
 *                       (len(entries), n)
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_entries); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = ((__pyx_t_4 != __pyx_v_n) != 0);
      if (__pyx_t_3) {

        /* "cypari_src/gen.pyx":9805
 *             if len(entries) != n:
 *                 raise IndexError, "length of entries (=%s) must equal n (=%s)"%\
 *                       (len(entries), n)             # <<<<<<<<<<<<<<
 *             for i, x in enumerate(entries):
 *                 v[i] = x
 */
        __pyx_t_4 = PyObject_Length(__pyx_v_entries); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9805; __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 = 9805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_1 = 0;
        __pyx_t_5 = 0;

        /* "cypari_src/gen.pyx":9804
 *         if entries is not None:
 *             if len(entries) != n:
 *                 raise IndexError, "length of entries (=%s) must equal n (=%s)"%\             # <<<<<<<<<<<<<<
 *                       (len(entries), n)
 *             for i, x in enumerate(entries):
 */
        __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_length_of_entries_s_must_equal_n, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "cypari_src/gen.pyx":9806
 *                 raise IndexError, "length of entries (=%s) must equal n (=%s)"%\
 *                       (len(entries), n)
 *             for i, x in enumerate(entries):             # <<<<<<<<<<<<<<
 *                 v[i] = x
 *         return v
 */
      __Pyx_INCREF(__pyx_int_0);
      __pyx_t_5 = __pyx_int_0;
      if (likely(PyList_CheckExact(__pyx_v_entries)) || PyTuple_CheckExact(__pyx_v_entries)) {
        __pyx_t_6 = __pyx_v_entries; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_entries); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_1 = __pyx_t_7(__pyx_t_6);
          if (unlikely(!__pyx_t_1)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
        __pyx_t_1 = 0;
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
        __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5);
        __pyx_t_5 = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "cypari_src/gen.pyx":9807
 *                       (len(entries), n)
 *             for i, x in enumerate(entries):
 *                 v[i] = x             # <<<<<<<<<<<<<<
 *         return v
 * 
 */
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_v_i, __pyx_v_x) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "cypari_src/gen.pyx":9806
 *                 raise IndexError, "length of entries (=%s) must equal n (=%s)"%\
 *                       (len(entries), n)
 *             for i, x in enumerate(entries):             # <<<<<<<<<<<<<<
 *                 v[i] = x
 *         return v
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":9808
 *             for i, x in enumerate(entries):
 *                 v[i] = x
 *         return v             # <<<<<<<<<<<<<<
 * 
 *     cdef gen _empty_vector(self, long n):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_v));
    __pyx_r = ((PyObject *)__pyx_v_v);
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9785
 *         return self.new_gen(getrand())
 * 
 *     def vector(self, long n, entries=None):             # <<<<<<<<<<<<<<
 *         """
 *         vector(long n, entries=None): Create and return the length n PARI
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.vector", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_v);
    __Pyx_XDECREF(__pyx_v_i);
    __Pyx_XDECREF(__pyx_v_x);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9810
 *         return v
 * 
 *     cdef gen _empty_vector(self, long n):             # <<<<<<<<<<<<<<
 *         cdef gen v
 *         sig_on()
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen_12PariInstance__empty_vector(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_n) {
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_v = 0;
    struct __pyx_obj_10cypari_src_3gen_gen *__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("_empty_vector", 0);

    /* "cypari_src/gen.pyx":9812
 *     cdef gen _empty_vector(self, long n):
 *         cdef gen v
 *         sig_on()             # <<<<<<<<<<<<<<
 *         v = self.new_gen(zerovec(n))
 *         return v
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9813
 *         cdef gen v
 *         sig_on()
 *         v = self.new_gen(zerovec(n))             # <<<<<<<<<<<<<<
 *         return v
 * 
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, zerovec(__pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_v = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9814
 *         sig_on()
 *         v = self.new_gen(zerovec(n))
 *         return v             # <<<<<<<<<<<<<<
 * 
 *     def matrix(self, long m, long n, entries=None):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_v));
    __pyx_r = __pyx_v_v;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9810
 *         return v
 * 
 *     cdef gen _empty_vector(self, long n):             # <<<<<<<<<<<<<<
 *         cdef gen v
 *         sig_on()
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance._empty_vector", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_v);
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9816
 *         return v
 * 
 *     def matrix(self, long m, long n, entries=None):             # <<<<<<<<<<<<<<
 *         """
 *         matrix(long m, long n, entries=None): Create and return the m x n
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_85matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12PariInstance_84matrix[] = "\n        matrix(long m, long n, entries=None): Create and return the m x n\n        PARI matrix with given list of entries.\n        ";
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_85matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    long __pyx_v_m;
    long __pyx_v_n;
    PyObject *__pyx_v_entries = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("matrix (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_entries,0};
      PyObject* values[3] = {0,0,0};
      values[2] = ((PyObject *)Py_None);
      if (unlikely(__pyx_kwds)) {
        Py_ssize_t kw_args;
        const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
        switch (pos_args) {
          case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          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_m)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("matrix", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          case  2:
          if (kw_args > 0) {
            PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_entries);
            if (value) { values[2] = 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 = 9816; __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);
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          break;
          default: goto __pyx_L5_argtuple_error;
        }
      }
      __pyx_v_m = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_m == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_n = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_entries = values[2];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("matrix", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_84matrix(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), __pyx_v_m, __pyx_v_n, __pyx_v_entries);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_84matrix(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self, long __pyx_v_m, long __pyx_v_n, PyObject *__pyx_v_entries) {
    long __pyx_v_i;
    long __pyx_v_j;
    long __pyx_v_k;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_A = 0;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_x = 0;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    int __pyx_t_3;
    Py_ssize_t __pyx_t_4;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *__pyx_t_7 = NULL;
    PyObject *__pyx_t_8 = NULL;
    long __pyx_t_9;
    long __pyx_t_10;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("matrix", 0);

    /* "cypari_src/gen.pyx":9825
 *         cdef gen x
 * 
 *         sig_on()             # <<<<<<<<<<<<<<
 *          # The gtomat is very important!!  Without sage/PARI will segfault.
 *          # I do not know why. -- William Stein
 */
    SIG_ON_MACRO();

    /* "cypari_src/gen.pyx":9828
 *          # The gtomat is very important!!  Without sage/PARI will segfault.
 *          # I do not know why. -- William Stein
 *         A = self.new_gen(gtomat(zeromat(m,n)))             # <<<<<<<<<<<<<<
 *         if entries is not None:
 *             if len(entries) != m*n:
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_self->__pyx_vtab)->new_gen(__pyx_v_self, gtomat(zeromat(__pyx_v_m, __pyx_v_n)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_A = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9829
 *          # I do not know why. -- William Stein
 *         A = self.new_gen(gtomat(zeromat(m,n)))
 *         if entries is not None:             # <<<<<<<<<<<<<<
 *             if len(entries) != m*n:
 *                 raise IndexError, "len of entries (=%s) must be %s*%s=%s"%(len(entries),m,n,m*n)
 */
    __pyx_t_2 = (__pyx_v_entries != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cypari_src/gen.pyx":9830
 *         A = self.new_gen(gtomat(zeromat(m,n)))
 *         if entries is not None:
 *             if len(entries) != m*n:             # <<<<<<<<<<<<<<
 *                 raise IndexError, "len of entries (=%s) must be %s*%s=%s"%(len(entries),m,n,m*n)
 *             k = 0
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_entries); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = ((__pyx_t_4 != (__pyx_v_m * __pyx_v_n)) != 0);
      if (__pyx_t_3) {

        /* "cypari_src/gen.pyx":9831
 *         if entries is not None:
 *             if len(entries) != m*n:
 *                 raise IndexError, "len of entries (=%s) must be %s*%s=%s"%(len(entries),m,n,m*n)             # <<<<<<<<<<<<<<
 *             k = 0
 *             for i from 0 <= i < m:
 */
        __pyx_t_4 = PyObject_Length(__pyx_v_entries); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_m); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyInt_From_long((__pyx_v_m * __pyx_v_n)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_1 = 0;
        __pyx_t_5 = 0;
        __pyx_t_6 = 0;
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_len_of_entries_s_must_be_s_s_s, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_7, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "cypari_src/gen.pyx":9832
 *             if len(entries) != m*n:
 *                 raise IndexError, "len of entries (=%s) must be %s*%s=%s"%(len(entries),m,n,m*n)
 *             k = 0             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < m:
 *                 for j from 0 <= j < n:
 */
      __pyx_v_k = 0;

      /* "cypari_src/gen.pyx":9833
 *                 raise IndexError, "len of entries (=%s) must be %s*%s=%s"%(len(entries),m,n,m*n)
 *             k = 0
 *             for i from 0 <= i < m:             # <<<<<<<<<<<<<<
 *                 for j from 0 <= j < n:
 *                     x = pari(entries[k])
 */
      __pyx_t_9 = __pyx_v_m;
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {

        /* "cypari_src/gen.pyx":9834
 *             k = 0
 *             for i from 0 <= i < m:
 *                 for j from 0 <= j < n:             # <<<<<<<<<<<<<<
 *                     x = pari(entries[k])
 *                     A._refers_to[(i,j)] = x
 */
        __pyx_t_10 = __pyx_v_n;
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {

          /* "cypari_src/gen.pyx":9835
 *             for i from 0 <= i < m:
 *                 for j from 0 <= j < n:
 *                     x = pari(entries[k])             # <<<<<<<<<<<<<<
 *                     A._refers_to[(i,j)] = x
 *                     (<GEN>(A.g)[j+1])[i+1] = <long>(x.g)
 */
          __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entries, __pyx_v_k, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9835; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
            }
          }
          if (!__pyx_t_5) {
            __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9835; __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); __pyx_t_5 = NULL;
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_6);
            __pyx_t_6 = 0;
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_10cypari_src_3gen_gen))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_XDECREF_SET(__pyx_v_x, ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_7));
          __pyx_t_7 = 0;

          /* "cypari_src/gen.pyx":9836
 *                 for j from 0 <= j < n:
 *                     x = pari(entries[k])
 *                     A._refers_to[(i,j)] = x             # <<<<<<<<<<<<<<
 *                     (<GEN>(A.g)[j+1])[i+1] = <long>(x.g)
 *                     k = k + 1
 */
          __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_j); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_8);
          __pyx_t_7 = 0;
          __pyx_t_8 = 0;
          if (unlikely(PyObject_SetItem(__pyx_v_A->_refers_to, __pyx_t_1, ((PyObject *)__pyx_v_x)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "cypari_src/gen.pyx":9837
 *                     x = pari(entries[k])
 *                     A._refers_to[(i,j)] = x
 *                     (<GEN>(A.g)[j+1])[i+1] = <long>(x.g)             # <<<<<<<<<<<<<<
 *                     k = k + 1
 *         return A
 */
          (((GEN)(__pyx_v_A->g[(__pyx_v_j + 1)]))[(__pyx_v_i + 1)]) = ((long)__pyx_v_x->g);

          /* "cypari_src/gen.pyx":9838
 *                     A._refers_to[(i,j)] = x
 *                     (<GEN>(A.g)[j+1])[i+1] = <long>(x.g)
 *                     k = k + 1             # <<<<<<<<<<<<<<
 *         return A
 * 
 */
          __pyx_v_k = (__pyx_v_k + 1);
        }
      }
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":9839
 *                     (<GEN>(A.g)[j+1])[i+1] = <long>(x.g)
 *                     k = k + 1
 *         return A             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_A));
    __pyx_r = ((PyObject *)__pyx_v_A);
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9816
 *         return v
 * 
 *     def matrix(self, long m, long n, entries=None):             # <<<<<<<<<<<<<<
 *         """
 *         matrix(long m, long n, entries=None): Create and return the m x n
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8);
    __Pyx_AddTraceback("cypari_src.gen.PariInstance.matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_A);
    __Pyx_XDECREF((PyObject *)__pyx_v_x);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pxd":27
 * #cdef class PariInstance(sage.structure.parent_base.ParentWithBase):
 * cdef class PariInstance:
 *     cdef public UI_callback             # <<<<<<<<<<<<<<
 *     cdef gen PARI_ZERO, PARI_ONE, PARI_TWO
 *     cdef gen new_gen(self, GEN x)
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_11UI_callback_1__get__(PyObject *__pyx_v_self); /*proto*/
  static PyObject *__pyx_pw_10cypari_src_3gen_12PariInstance_11UI_callback_1__get__(PyObject *__pyx_v_self) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_11UI_callback___get__(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12PariInstance_11UI_callback___get__(struct __pyx_obj_10cypari_src_3gen_PariInstance *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__get__", 0);
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->UI_callback);
    __pyx_r = __pyx_v_self->UI_callback;
    goto __pyx_L0;

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

  /* Python wrapper */
  static int __pyx_pw_10cypari_src_3gen_12PariInstance_11UI_callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
  static int __pyx_pw_10cypari_src_3gen_12PariInstance_11UI_callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
    int __pyx_r;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_11UI_callback_2__set__(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

  static int __pyx_pf_10cypari_src_3gen_12PariInstance_11UI_callback_2__set__(struct __pyx_obj_10cypari_src_3gen_PariInstance *__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->UI_callback);
    __Pyx_DECREF(__pyx_v_self->UI_callback);
    __pyx_v_self->UI_callback = __pyx_v_value;

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

  /* Python wrapper */
  static int __pyx_pw_10cypari_src_3gen_12PariInstance_11UI_callback_5__del__(PyObject *__pyx_v_self); /*proto*/
  static int __pyx_pw_10cypari_src_3gen_12PariInstance_11UI_callback_5__del__(PyObject *__pyx_v_self) {
    int __pyx_r;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_12PariInstance_11UI_callback_4__del__(((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_v_self));

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

  static int __pyx_pf_10cypari_src_3gen_12PariInstance_11UI_callback_4__del__(struct __pyx_obj_10cypari_src_3gen_PariInstance *__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->UI_callback);
    __Pyx_DECREF(__pyx_v_self->UI_callback);
    __pyx_v_self->UI_callback = Py_None;

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

  /* "cypari_src/gen.pyx":9842
 * 
 * 
 * def init_pari_stack(size=8000000):             # <<<<<<<<<<<<<<
 *     """
 *     Change the PARI scratch stack space to the given size.
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_13init_pari_stack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_12init_pari_stack[] = "\n    Change the PARI scratch stack space to the given size.\n    \n    The main application of this command is that you've done some\n    individual PARI computation that used a lot of stack space. As a\n    result the PARI stack may have doubled several times and is now\n    quite large. That object you computed is copied off to the heap,\n    but the PARI stack is never automatically shrunk back down. If you\n    call this function you can shrink it back down.\n    \n    If you set this too small then it will automatically be increased\n    if it is exceeded, which could make some calculations initially\n    slower (since they have to be redone until the stack is big\n    enough).\n    \n    INPUT:\n    \n    -  ``size`` - an integer (default: 8000000)\n    \n    ";
  static PyMethodDef __pyx_mdef_10cypari_src_3gen_13init_pari_stack = {"init_pari_stack", (PyCFunction)__pyx_pw_10cypari_src_3gen_13init_pari_stack, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12init_pari_stack};
  static PyObject *__pyx_pw_10cypari_src_3gen_13init_pari_stack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_size = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("init_pari_stack (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0};
      PyObject* values[1] = {0};
      values[0] = ((PyObject *)__pyx_int_8000000);
      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_size);
            if (value) { values[0] = value; kw_args--; }
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init_pari_stack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9842; __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_size = values[0];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("init_pari_stack", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9842; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.init_pari_stack", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_12init_pari_stack(__pyx_self, __pyx_v_size);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_12init_pari_stack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_size) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    size_t __pyx_t_1;
    int __pyx_t_2;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("init_pari_stack", 0);

    /* "cypari_src/gen.pyx":9863
 * 
 *     """
 *     init_stack(size)             # <<<<<<<<<<<<<<
 * 
 * cdef int init_stack(size_t size) except -1:
 */
    __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __pyx_f_10cypari_src_3gen_init_stack(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cypari_src/gen.pyx":9842
 * 
 * 
 * def init_pari_stack(size=8000000):             # <<<<<<<<<<<<<<
 *     """
 *     Change the PARI scratch stack space to the given size.
 */

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

  /* "cypari_src/gen.pyx":9865
 *     init_stack(size)
 * 
 * cdef int init_stack(size_t size) except -1:             # <<<<<<<<<<<<<<
 *     cdef size_t s
 *     cdef pari_sp cur_stack_size
 */

  static int __pyx_f_10cypari_src_3gen_init_stack(size_t __pyx_v_size) {
    size_t __pyx_v_s;
    int __pyx_v_err;
    PyObject *__pyx_v_prev_stack_size = NULL;
    int __pyx_r;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    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("init_stack", 0);

    /* "cypari_src/gen.pyx":9870
 * 
 *     global top, bot, avma, mytop
 *     err = False    # whether or not a memory allocation error occurred.             # <<<<<<<<<<<<<<
 * 
 *     # delete this if get core dumps and change the 2* to a 1* below.
 */
    __pyx_v_err = 0;

    /* "cypari_src/gen.pyx":9873
 * 
 *     # delete this if get core dumps and change the 2* to a 1* below.
 *     if bot:             # <<<<<<<<<<<<<<
 *         PyMem_Free(<void*>bot)
 * 
 */
    __pyx_t_1 = (bot != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9874
 *     # delete this if get core dumps and change the 2* to a 1* below.
 *     if bot:
 *         PyMem_Free(<void*>bot)             # <<<<<<<<<<<<<<
 * 
 *     prev_stack_size = top - bot
 */
      PyMem_Free(((void *)bot));
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":9876
 *         PyMem_Free(<void*>bot)
 * 
 *     prev_stack_size = top - bot             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         size = 2 * prev_stack_size
 */
    __pyx_t_2 = __Pyx_PyInt_From_pari_sp((top - bot)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_prev_stack_size = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cypari_src/gen.pyx":9877
 * 
 *     prev_stack_size = top - bot
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         size = 2 * prev_stack_size
 * 
 */
    __pyx_t_1 = ((__pyx_v_size == 0) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9878
 *     prev_stack_size = top - bot
 *     if size == 0:
 *         size = 2 * prev_stack_size             # <<<<<<<<<<<<<<
 * 
 *     # Decide on size
 */
      __pyx_t_2 = PyNumber_Multiply(__pyx_int_2, __pyx_v_prev_stack_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_size = __pyx_t_3;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "cypari_src/gen.pyx":9881
 * 
 *     # Decide on size
 *     s = fix_size(size)             # <<<<<<<<<<<<<<
 * 
 *     # Allocate memory for new stack using Python's memory allocator.
 */
    __pyx_v_s = __pyx_f_10cypari_src_3gen_fix_size(__pyx_v_size);

    /* "cypari_src/gen.pyx":9886
 *     # As explained in the python/C API reference, using this instead
 *     # of malloc is much better (and more platform independent, etc.)
 *     bot = <pari_sp> PyMem_Malloc(s)             # <<<<<<<<<<<<<<
 *     while not bot:
 *         err = True
 */
    bot = ((pari_sp)PyMem_Malloc(__pyx_v_s));

    /* "cypari_src/gen.pyx":9887
 *     # of malloc is much better (and more platform independent, etc.)
 *     bot = <pari_sp> PyMem_Malloc(s)
 *     while not bot:             # <<<<<<<<<<<<<<
 *         err = True
 *         s = fix_size(prev_stack_size)
 */
    while (1) {
      __pyx_t_1 = ((!(bot != 0)) != 0);
      if (!__pyx_t_1) break;

      /* "cypari_src/gen.pyx":9888
 *     bot = <pari_sp> PyMem_Malloc(s)
 *     while not bot:
 *         err = True             # <<<<<<<<<<<<<<
 *         s = fix_size(prev_stack_size)
 *         bot = <pari_sp> PyMem_Malloc(s)
 */
      __pyx_v_err = 1;

      /* "cypari_src/gen.pyx":9889
 *     while not bot:
 *         err = True
 *         s = fix_size(prev_stack_size)             # <<<<<<<<<<<<<<
 *         bot = <pari_sp> PyMem_Malloc(s)
 *         if not bot:
 */
      __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_prev_stack_size); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_s = __pyx_f_10cypari_src_3gen_fix_size(__pyx_t_3);

      /* "cypari_src/gen.pyx":9890
 *         err = True
 *         s = fix_size(prev_stack_size)
 *         bot = <pari_sp> PyMem_Malloc(s)             # <<<<<<<<<<<<<<
 *         if not bot:
 *             prev_stack_size /= 2
 */
      bot = ((pari_sp)PyMem_Malloc(__pyx_v_s));

      /* "cypari_src/gen.pyx":9891
 *         s = fix_size(prev_stack_size)
 *         bot = <pari_sp> PyMem_Malloc(s)
 *         if not bot:             # <<<<<<<<<<<<<<
 *             prev_stack_size /= 2
 * 
 */
      __pyx_t_1 = ((!(bot != 0)) != 0);
      if (__pyx_t_1) {

        /* "cypari_src/gen.pyx":9892
 *         bot = <pari_sp> PyMem_Malloc(s)
 *         if not bot:
 *             prev_stack_size /= 2             # <<<<<<<<<<<<<<
 * 
 *     top = bot + s
 */
        __pyx_t_2 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_prev_stack_size, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_prev_stack_size, __pyx_t_2);
        __pyx_t_2 = 0;
        goto __pyx_L7;
      }
      __pyx_L7:;
    }

    /* "cypari_src/gen.pyx":9894
 *             prev_stack_size /= 2
 * 
 *     top = bot + s             # <<<<<<<<<<<<<<
 *     mytop = top
 *     avma = top
 */
    top = (bot + __pyx_v_s);

    /* "cypari_src/gen.pyx":9895
 * 
 *     top = bot + s
 *     mytop = top             # <<<<<<<<<<<<<<
 *     avma = top
 * 
 */
    __pyx_v_10cypari_src_3gen_mytop = top;

    /* "cypari_src/gen.pyx":9896
 *     top = bot + s
 *     mytop = top
 *     avma = top             # <<<<<<<<<<<<<<
 * 
 *     if err:
 */
    avma = top;

    /* "cypari_src/gen.pyx":9898
 *     avma = top
 * 
 *     if err:             # <<<<<<<<<<<<<<
 *         raise MemoryError, "Unable to allocate %s bytes memory for PARI."%size
 * 
 */
    __pyx_t_1 = (__pyx_v_err != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9899
 * 
 *     if err:
 *         raise MemoryError, "Unable to allocate %s bytes memory for PARI."%size             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_allocate_s_bytes_memor, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_t_4, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":9865
 *     init_stack(size)
 * 
 * cdef int init_stack(size_t size) except -1:             # <<<<<<<<<<<<<<
 *     cdef size_t s
 *     cdef pari_sp cur_stack_size
 */

    /* function exit code */
    __pyx_r = 0;
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.init_stack", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = -1;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_prev_stack_size);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9902
 * 
 * 
 * cdef size_t fix_size(size_t a):             # <<<<<<<<<<<<<<
 *     cdef size_t b
 *     b = a - (a & (sizeof(long)-1))     # sizeof(long) | b <= a
 */

  static size_t __pyx_f_10cypari_src_3gen_fix_size(size_t __pyx_v_a) {
    size_t __pyx_v_b;
    size_t __pyx_r;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    __Pyx_RefNannySetupContext("fix_size", 0);

    /* "cypari_src/gen.pyx":9904
 * cdef size_t fix_size(size_t a):
 *     cdef size_t b
 *     b = a - (a & (sizeof(long)-1))     # sizeof(long) | b <= a             # <<<<<<<<<<<<<<
 *     if b < 1024:
 *         b = 1024
 */
    __pyx_v_b = (__pyx_v_a - (__pyx_v_a & ((sizeof(long)) - 1)));

    /* "cypari_src/gen.pyx":9905
 *     cdef size_t b
 *     b = a - (a & (sizeof(long)-1))     # sizeof(long) | b <= a
 *     if b < 1024:             # <<<<<<<<<<<<<<
 *         b = 1024
 *     return b
 */
    __pyx_t_1 = ((__pyx_v_b < 1024) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9906
 *     b = a - (a & (sizeof(long)-1))     # sizeof(long) | b <= a
 *     if b < 1024:
 *         b = 1024             # <<<<<<<<<<<<<<
 *     return b
 * 
 */
      __pyx_v_b = 1024;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":9907
 *     if b < 1024:
 *         b = 1024
 *     return b             # <<<<<<<<<<<<<<
 * 
 * cdef GEN deepcopy_to_python_heap(GEN x, pari_sp* address, pari_sp prior_sp):
 */
    __pyx_r = __pyx_v_b;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9902
 * 
 * 
 * cdef size_t fix_size(size_t a):             # <<<<<<<<<<<<<<
 *     cdef size_t b
 *     b = a - (a & (sizeof(long)-1))     # sizeof(long) | b <= a
 */

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

  /* "cypari_src/gen.pyx":9909
 *     return b
 * 
 * cdef GEN deepcopy_to_python_heap(GEN x, pari_sp* address, pari_sp prior_sp):             # <<<<<<<<<<<<<<
 *     """
 *     Build a mini-stack in the python heap, just large enough to hold a copy
 */

  static GEN __pyx_f_10cypari_src_3gen_deepcopy_to_python_heap(GEN __pyx_v_x, pari_sp *__pyx_v_address, pari_sp __pyx_v_prior_sp) {
    size_t __pyx_v_s;
    pari_sp __pyx_v_tmp_bot;
    pari_sp __pyx_v_tmp_top;
    pari_sp __pyx_v_tmp_avma;
    GEN __pyx_v_h;
    GEN __pyx_r;
    __Pyx_RefNannyDeclarations
    pari_sp __pyx_t_1;
    pari_sp __pyx_t_2;
    pari_sp __pyx_t_3;
    int __pyx_t_4;
    int __pyx_t_5;
    size_t __pyx_t_6;
    __Pyx_RefNannySetupContext("deepcopy_to_python_heap", 0);

    /* "cypari_src/gen.pyx":9920
 *     cdef GEN h
 * 
 *     tmp_top, tmp_bot, tmp_avma = top, bot, avma             # <<<<<<<<<<<<<<
 *     if prior_sp == 0 or prior_sp == avma:
 *         # Note: some special PARI objects do not live on the stack.
 */
    __pyx_t_1 = top;
    __pyx_t_2 = bot;
    __pyx_t_3 = avma;
    __pyx_v_tmp_top = __pyx_t_1;
    __pyx_v_tmp_bot = __pyx_t_2;
    __pyx_v_tmp_avma = __pyx_t_3;

    /* "cypari_src/gen.pyx":9921
 * 
 *     tmp_top, tmp_bot, tmp_avma = top, bot, avma
 *     if prior_sp == 0 or prior_sp == avma:             # <<<<<<<<<<<<<<
 *         # Note: some special PARI objects do not live on the stack.
 *         # The copy is only used to figure out the size of x.
 */
    __pyx_t_5 = ((__pyx_v_prior_sp == 0) != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_prior_sp == avma) != 0);
    __pyx_t_4 = __pyx_t_5;
    __pyx_L4_bool_binop_done:;
    if (__pyx_t_4) {

      /* "cypari_src/gen.pyx":9924
 *         # Note: some special PARI objects do not live on the stack.
 *         # The copy is only used to figure out the size of x.
 *         h = gcopy(x)             # <<<<<<<<<<<<<<
 *         s = <size_t> (tmp_avma - avma)
 *     else:
 */
      __pyx_v_h = gcopy(__pyx_v_x);

      /* "cypari_src/gen.pyx":9925
 *         # The copy is only used to figure out the size of x.
 *         h = gcopy(x)
 *         s = <size_t> (tmp_avma - avma)             # <<<<<<<<<<<<<<
 *     else:
 *         s = <size_t> (prior_sp - avma)
 */
      __pyx_v_s = ((size_t)(__pyx_v_tmp_avma - avma));
      goto __pyx_L3;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":9927
 *         s = <size_t> (tmp_avma - avma)
 *     else:
 *         s = <size_t> (prior_sp - avma)             # <<<<<<<<<<<<<<
 * 
 *     #print( "Allocating %s bytes for PARI/Python object"%(<long> s) )
 */
      __pyx_v_s = ((size_t)(__pyx_v_prior_sp - avma));
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":9931
 *     #print( "Allocating %s bytes for PARI/Python object"%(<long> s) )
 *     # Trick PARI into using the mini-stack.
 *     bot = <pari_sp> PyMem_Malloc(s)             # <<<<<<<<<<<<<<
 *     top = avma = bot + s
 *     h = gcopy(x)
 */
    bot = ((pari_sp)PyMem_Malloc(__pyx_v_s));

    /* "cypari_src/gen.pyx":9932
 *     # Trick PARI into using the mini-stack.
 *     bot = <pari_sp> PyMem_Malloc(s)
 *     top = avma = bot + s             # <<<<<<<<<<<<<<
 *     h = gcopy(x)
 *     address[0] = bot
 */
    __pyx_t_6 = (bot + __pyx_v_s);
    top = __pyx_t_6;
    avma = __pyx_t_6;

    /* "cypari_src/gen.pyx":9933
 *     bot = <pari_sp> PyMem_Malloc(s)
 *     top = avma = bot + s
 *     h = gcopy(x)             # <<<<<<<<<<<<<<
 *     address[0] = bot
 * 
 */
    __pyx_v_h = gcopy(__pyx_v_x);

    /* "cypari_src/gen.pyx":9934
 *     top = avma = bot + s
 *     h = gcopy(x)
 *     address[0] = bot             # <<<<<<<<<<<<<<
 * 
 *     # Reset PARI's stack pointers to the real values.
 */
    (__pyx_v_address[0]) = bot;

    /* "cypari_src/gen.pyx":9937
 * 
 *     # Reset PARI's stack pointers to the real values.
 *     top, bot, avma = tmp_top, tmp_bot, tmp_avma             # <<<<<<<<<<<<<<
 *     return h
 * 
 */
    __pyx_t_3 = __pyx_v_tmp_top;
    __pyx_t_2 = __pyx_v_tmp_bot;
    __pyx_t_1 = __pyx_v_tmp_avma;
    top = __pyx_t_3;
    bot = __pyx_t_2;
    avma = __pyx_t_1;

    /* "cypari_src/gen.pyx":9938
 *     # Reset PARI's stack pointers to the real values.
 *     top, bot, avma = tmp_top, tmp_bot, tmp_avma
 *     return h             # <<<<<<<<<<<<<<
 * 
 * cdef gen _new_gen(GEN x, pari_sp prior_sp):
 */
    __pyx_r = __pyx_v_h;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9909
 *     return b
 * 
 * cdef GEN deepcopy_to_python_heap(GEN x, pari_sp* address, pari_sp prior_sp):             # <<<<<<<<<<<<<<
 *     """
 *     Build a mini-stack in the python heap, just large enough to hold a copy
 */

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

  /* "cypari_src/gen.pyx":9940
 *     return h
 * 
 * cdef gen _new_gen(GEN x, pari_sp prior_sp):             # <<<<<<<<<<<<<<
 *     cdef GEN h
 *     cdef pari_sp address
 */

  static struct __pyx_obj_10cypari_src_3gen_gen *__pyx_f_10cypari_src_3gen__new_gen(GEN __pyx_v_x, pari_sp __pyx_v_prior_sp) {
    GEN __pyx_v_h;
    pari_sp __pyx_v_address;
    struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_y = 0;
    struct __pyx_obj_10cypari_src_3gen_gen *__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("_new_gen", 0);

    /* "cypari_src/gen.pyx":9944
 *     cdef pari_sp address
 *     cdef gen y
 *     h = deepcopy_to_python_heap(x, &address, prior_sp)             # <<<<<<<<<<<<<<
 *     y = gen.__new__(gen)
 *     y.init(h, address)
 */
    __pyx_v_h = __pyx_f_10cypari_src_3gen_deepcopy_to_python_heap(__pyx_v_x, (&__pyx_v_address), __pyx_v_prior_sp);

    /* "cypari_src/gen.pyx":9945
 *     cdef gen y
 *     h = deepcopy_to_python_heap(x, &address, prior_sp)
 *     y = gen.__new__(gen)             # <<<<<<<<<<<<<<
 *     y.init(h, address)
 *     return y
 */
    __pyx_t_1 = __pyx_tp_new_10cypari_src_3gen_gen(((PyTypeObject *)((PyObject*)__pyx_ptype_10cypari_src_3gen_gen)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_10cypari_src_3gen_gen)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_y = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":9946
 *     h = deepcopy_to_python_heap(x, &address, prior_sp)
 *     y = gen.__new__(gen)
 *     y.init(h, address)             # <<<<<<<<<<<<<<
 *     return y
 * 
 */
    ((struct __pyx_vtabstruct_10cypari_src_3gen_gen *)__pyx_v_y->__pyx_vtab)->init(__pyx_v_y, __pyx_v_h, __pyx_v_address);

    /* "cypari_src/gen.pyx":9947
 *     y = gen.__new__(gen)
 *     y.init(h, address)
 *     return y             # <<<<<<<<<<<<<<
 * 
 * cdef GEN _Vec_append(GEN v, GEN a, long n):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_y));
    __pyx_r = __pyx_v_y;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":9940
 *     return h
 * 
 * cdef gen _new_gen(GEN x, pari_sp prior_sp):             # <<<<<<<<<<<<<<
 *     cdef GEN h
 *     cdef pari_sp address
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen._new_gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XDECREF((PyObject *)__pyx_v_y);
    __Pyx_XGIVEREF((PyObject *)__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":9949
 *     return y
 * 
 * cdef GEN _Vec_append(GEN v, GEN a, long n):             # <<<<<<<<<<<<<<
 *     """
 *     This implements appending zeros (or another constant GEN ``a``) to
 */

  static GEN __pyx_f_10cypari_src_3gen__Vec_append(GEN __pyx_v_v, GEN __pyx_v_a, long __pyx_v_n) {
    long __pyx_v_lenv;
    GEN __pyx_v_w;
    long __pyx_v_i;
    GEN __pyx_r;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    long __pyx_t_2;
    __Pyx_RefNannySetupContext("_Vec_append", 0);

    /* "cypari_src/gen.pyx":9971
 *     A GEN of the same type as ``v``.
 *     """
 *     cdef long lenv = lg(v)-1             # <<<<<<<<<<<<<<
 *     cdef GEN w
 *     cdef long i
 */
    __pyx_v_lenv = (lg(__pyx_v_v) - 1);

    /* "cypari_src/gen.pyx":9975
 *     cdef long i
 *     # Do we need to extend the vector with zeros?
 *     if n > lenv:             # <<<<<<<<<<<<<<
 *         w = cgetg(n+1, typ(v))
 *         for i from 1 <= i <= lenv:
 */
    __pyx_t_1 = ((__pyx_v_n > __pyx_v_lenv) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9976
 *     # Do we need to extend the vector with zeros?
 *     if n > lenv:
 *         w = cgetg(n+1, typ(v))             # <<<<<<<<<<<<<<
 *         for i from 1 <= i <= lenv:
 *             set_gel(w, i, gel(v, i))
 */
      __pyx_v_w = cgetg((__pyx_v_n + 1), typ(__pyx_v_v));

      /* "cypari_src/gen.pyx":9977
 *     if n > lenv:
 *         w = cgetg(n+1, typ(v))
 *         for i from 1 <= i <= lenv:             # <<<<<<<<<<<<<<
 *             set_gel(w, i, gel(v, i))
 *         for i from 1 <= i <= n-lenv:
 */
      __pyx_t_2 = __pyx_v_lenv;
      for (__pyx_v_i = 1; __pyx_v_i <= __pyx_t_2; __pyx_v_i++) {

        /* "cypari_src/gen.pyx":9978
 *         w = cgetg(n+1, typ(v))
 *         for i from 1 <= i <= lenv:
 *             set_gel(w, i, gel(v, i))             # <<<<<<<<<<<<<<
 *         for i from 1 <= i <= n-lenv:
 *             set_gel(w, i+lenv, a)
 */
        set_gel(__pyx_v_w, __pyx_v_i, gel(__pyx_v_v, __pyx_v_i));
      }

      /* "cypari_src/gen.pyx":9979
 *         for i from 1 <= i <= lenv:
 *             set_gel(w, i, gel(v, i))
 *         for i from 1 <= i <= n-lenv:             # <<<<<<<<<<<<<<
 *             set_gel(w, i+lenv, a)
 *         return w
 */
      __pyx_t_2 = (__pyx_v_n - __pyx_v_lenv);
      for (__pyx_v_i = 1; __pyx_v_i <= __pyx_t_2; __pyx_v_i++) {

        /* "cypari_src/gen.pyx":9980
 *             set_gel(w, i, gel(v, i))
 *         for i from 1 <= i <= n-lenv:
 *             set_gel(w, i+lenv, a)             # <<<<<<<<<<<<<<
 *         return w
 *     elif n < -lenv:
 */
        set_gel(__pyx_v_w, (__pyx_v_i + __pyx_v_lenv), __pyx_v_a);
      }

      /* "cypari_src/gen.pyx":9981
 *         for i from 1 <= i <= n-lenv:
 *             set_gel(w, i+lenv, a)
 *         return w             # <<<<<<<<<<<<<<
 *     elif n < -lenv:
 *         n = -n  # Make n positive
 */
      __pyx_r = __pyx_v_w;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9982
 *             set_gel(w, i+lenv, a)
 *         return w
 *     elif n < -lenv:             # <<<<<<<<<<<<<<
 *         n = -n  # Make n positive
 *         w = cgetg(n+1, typ(v))
 */
    __pyx_t_1 = ((__pyx_v_n < (-__pyx_v_lenv)) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":9983
 *         return w
 *     elif n < -lenv:
 *         n = -n  # Make n positive             # <<<<<<<<<<<<<<
 *         w = cgetg(n+1, typ(v))
 *         for i from 1 <= i <= lenv:
 */
      __pyx_v_n = (-__pyx_v_n);

      /* "cypari_src/gen.pyx":9984
 *     elif n < -lenv:
 *         n = -n  # Make n positive
 *         w = cgetg(n+1, typ(v))             # <<<<<<<<<<<<<<
 *         for i from 1 <= i <= lenv:
 *             set_gel(w, i+(n-lenv), gel(v, i))
 */
      __pyx_v_w = cgetg((__pyx_v_n + 1), typ(__pyx_v_v));

      /* "cypari_src/gen.pyx":9985
 *         n = -n  # Make n positive
 *         w = cgetg(n+1, typ(v))
 *         for i from 1 <= i <= lenv:             # <<<<<<<<<<<<<<
 *             set_gel(w, i+(n-lenv), gel(v, i))
 *         for i from 1 <= i <= n-lenv:
 */
      __pyx_t_2 = __pyx_v_lenv;
      for (__pyx_v_i = 1; __pyx_v_i <= __pyx_t_2; __pyx_v_i++) {

        /* "cypari_src/gen.pyx":9986
 *         w = cgetg(n+1, typ(v))
 *         for i from 1 <= i <= lenv:
 *             set_gel(w, i+(n-lenv), gel(v, i))             # <<<<<<<<<<<<<<
 *         for i from 1 <= i <= n-lenv:
 *             set_gel(w, i, a)
 */
        set_gel(__pyx_v_w, (__pyx_v_i + (__pyx_v_n - __pyx_v_lenv)), gel(__pyx_v_v, __pyx_v_i));
      }

      /* "cypari_src/gen.pyx":9987
 *         for i from 1 <= i <= lenv:
 *             set_gel(w, i+(n-lenv), gel(v, i))
 *         for i from 1 <= i <= n-lenv:             # <<<<<<<<<<<<<<
 *             set_gel(w, i, a)
 *         return w
 */
      __pyx_t_2 = (__pyx_v_n - __pyx_v_lenv);
      for (__pyx_v_i = 1; __pyx_v_i <= __pyx_t_2; __pyx_v_i++) {

        /* "cypari_src/gen.pyx":9988
 *             set_gel(w, i+(n-lenv), gel(v, i))
 *         for i from 1 <= i <= n-lenv:
 *             set_gel(w, i, a)             # <<<<<<<<<<<<<<
 *         return w
 *     else:
 */
        set_gel(__pyx_v_w, __pyx_v_i, __pyx_v_a);
      }

      /* "cypari_src/gen.pyx":9989
 *         for i from 1 <= i <= n-lenv:
 *             set_gel(w, i, a)
 *         return w             # <<<<<<<<<<<<<<
 *     else:
 *         return v
 */
      __pyx_r = __pyx_v_w;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":9991
 *         return w
 *     else:
 *         return v             # <<<<<<<<<<<<<<
 * 
 * ###################################
 */
      __pyx_r = __pyx_v_v;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":9949
 *     return y
 * 
 * cdef GEN _Vec_append(GEN v, GEN a, long n):             # <<<<<<<<<<<<<<
 *     """
 *     This implements appending zeros (or another constant GEN ``a``) to
 */

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

  /* "cypari_src/gen.pyx":10114
 * class PariError(Exception):
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         TESTS::
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_9PariError_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_9PariError___repr__[] = "\n        TESTS::\n            \n            >>> PariError(11)\n            PariError(11)\n        ";
  static PyMethodDef __pyx_mdef_10cypari_src_3gen_9PariError_1__repr__ = {"__repr__", (PyCFunction)__pyx_pw_10cypari_src_3gen_9PariError_1__repr__, METH_O, __pyx_doc_10cypari_src_3gen_9PariError___repr__};
  static PyObject *__pyx_pw_10cypari_src_3gen_9PariError_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_9PariError___repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_9PariError___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("__repr__", 0);

    /* "cypari_src/gen.pyx":10121
 *             PariError(11)
 *         """
 *         return "PariError(%d)"%self.errnum()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errnum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_PariError_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":10114
 * class PariError(Exception):
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         TESTS::
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_AddTraceback("cypari_src.gen.PariError.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":10123
 *         return "PariError(%d)"%self.errnum()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s (%d)"%(self.errmessage(self.errnum()), self.errnum())
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_9PariError_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
  static PyMethodDef __pyx_mdef_10cypari_src_3gen_9PariError_3__str__ = {"__str__", (PyCFunction)__pyx_pw_10cypari_src_3gen_9PariError_3__str__, METH_O, 0};
  static PyObject *__pyx_pw_10cypari_src_3gen_9PariError_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_9PariError_2__str__(__pyx_self, ((PyObject *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_9PariError_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("__str__", 0);

    /* "cypari_src/gen.pyx":10124
 * 
 *     def __str__(self):
 *         return "%s (%d)"%(self.errmessage(self.errnum()), self.errnum())             # <<<<<<<<<<<<<<
 * 
 *     def errmessage(self, d):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errmessage); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errnum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errnum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_d, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":10123
 *         return "PariError(%d)"%self.errnum()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s (%d)"%(self.errmessage(self.errnum()), self.errnum())
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_AddTraceback("cypari_src.gen.PariError.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":10126
 *         return "%s (%d)"%(self.errmessage(self.errnum()), self.errnum())
 * 
 *     def errmessage(self, d):             # <<<<<<<<<<<<<<
 *         global noer
 *         if 0 < d <= noer:
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_9PariError_5errmessage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyMethodDef __pyx_mdef_10cypari_src_3gen_9PariError_5errmessage = {"errmessage", (PyCFunction)__pyx_pw_10cypari_src_3gen_9PariError_5errmessage, METH_VARARGS|METH_KEYWORDS, 0};
  static PyObject *__pyx_pw_10cypari_src_3gen_9PariError_5errmessage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    CYTHON_UNUSED PyObject *__pyx_v_self = 0;
    PyObject *__pyx_v_d = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("errmessage (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_d,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_self)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("errmessage", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "errmessage") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10126; __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_self = values[0];
      __pyx_v_d = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("errmessage", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariError.errmessage", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_9PariError_4errmessage(__pyx_self, __pyx_v_self, __pyx_v_d);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_9PariError_4errmessage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    PyObject *__pyx_t_2 = NULL;
    int __pyx_t_3;
    Py_ssize_t __pyx_t_4;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    PyObject *__pyx_t_7 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("errmessage", 0);

    /* "cypari_src/gen.pyx":10128
 *     def errmessage(self, d):
 *         global noer
 *         if 0 < d <= noer:             # <<<<<<<<<<<<<<
 *             return chars_to_str(errmessage[d])
 *         elif d == -1:
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_d, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_From_int(noer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_d, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "cypari_src/gen.pyx":10129
 *         global noer
 *         if 0 < d <= noer:
 *             return chars_to_str(errmessage[d])             # <<<<<<<<<<<<<<
 *         elif d == -1:
 *             return "PARI was interrupted!"
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_chars_to_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_d); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = __Pyx_PyBytes_FromString((errmessage[__pyx_t_4])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":10130
 *         if 0 < d <= noer:
 *             return chars_to_str(errmessage[d])
 *         elif d == -1:             # <<<<<<<<<<<<<<
 *             return "PARI was interrupted!"
 *         else:
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_d, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "cypari_src/gen.pyx":10131
 *             return chars_to_str(errmessage[d])
 *         elif d == -1:
 *             return "PARI was interrupted!"             # <<<<<<<<<<<<<<
 *         else:
 *             return "unknown"
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_kp_s_PARI_was_interrupted);
      __pyx_r = __pyx_kp_s_PARI_was_interrupted;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":10133
 *             return "PARI was interrupted!"
 *         else:
 *             return "unknown"             # <<<<<<<<<<<<<<
 * 
 *     def errnum(self):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_s_unknown);
      __pyx_r = __pyx_n_s_unknown;
      goto __pyx_L0;
    }

    /* "cypari_src/gen.pyx":10126
 *         return "%s (%d)"%(self.errmessage(self.errnum()), self.errnum())
 * 
 *     def errmessage(self, d):             # <<<<<<<<<<<<<<
 *         global noer
 *         if 0 < d <= noer:
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_AddTraceback("cypari_src.gen.PariError.errmessage", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":10135
 *             return "unknown"
 * 
 *     def errnum(self):             # <<<<<<<<<<<<<<
 *         return self.args[0]
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_9PariError_7errnum(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
  static PyMethodDef __pyx_mdef_10cypari_src_3gen_9PariError_7errnum = {"errnum", (PyCFunction)__pyx_pw_10cypari_src_3gen_9PariError_7errnum, METH_O, 0};
  static PyObject *__pyx_pw_10cypari_src_3gen_9PariError_7errnum(PyObject *__pyx_self, PyObject *__pyx_v_self) {
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("errnum (wrapper)", 0);
    __pyx_r = __pyx_pf_10cypari_src_3gen_9PariError_6errnum(__pyx_self, ((PyObject *)__pyx_v_self));

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

  static PyObject *__pyx_pf_10cypari_src_3gen_9PariError_6errnum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("errnum", 0);

    /* "cypari_src/gen.pyx":10136
 * 
 *     def errnum(self):
 *         return self.args[0]             # <<<<<<<<<<<<<<
 * 
 *     def set_errnum(self, errnum):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10136; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":10135
 *             return "unknown"
 * 
 *     def errnum(self):             # <<<<<<<<<<<<<<
 *         return self.args[0]
 * 
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_AddTraceback("cypari_src.gen.PariError.errnum", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":10138
 *         return self.args[0]
 * 
 *     def set_errnum(self, errnum):             # <<<<<<<<<<<<<<
 *         self.args = (errnum,)
 * 
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_9PariError_9set_errnum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  static PyMethodDef __pyx_mdef_10cypari_src_3gen_9PariError_9set_errnum = {"set_errnum", (PyCFunction)__pyx_pw_10cypari_src_3gen_9PariError_9set_errnum, METH_VARARGS|METH_KEYWORDS, 0};
  static PyObject *__pyx_pw_10cypari_src_3gen_9PariError_9set_errnum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_self = 0;
    PyObject *__pyx_v_errnum = 0;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("set_errnum (wrapper)", 0);
    {
      static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_errnum,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_self)) != 0)) kw_args--;
          else goto __pyx_L5_argtuple_error;
          case  1:
          if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_errnum)) != 0)) kw_args--;
          else {
            __Pyx_RaiseArgtupleInvalid("set_errnum", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10138; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        }
        if (unlikely(kw_args > 0)) {
          if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_errnum") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10138; __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_self = values[0];
      __pyx_v_errnum = values[1];
    }
    goto __pyx_L4_argument_unpacking_done;
    __pyx_L5_argtuple_error:;
    __Pyx_RaiseArgtupleInvalid("set_errnum", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10138; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_L3_error:;
    __Pyx_AddTraceback("cypari_src.gen.PariError.set_errnum", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __Pyx_RefNannyFinishContext();
    return NULL;
    __pyx_L4_argument_unpacking_done:;
    __pyx_r = __pyx_pf_10cypari_src_3gen_9PariError_8set_errnum(__pyx_self, __pyx_v_self, __pyx_v_errnum);

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

  static PyObject *__pyx_pf_10cypari_src_3gen_9PariError_8set_errnum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errnum) {
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("set_errnum", 0);

    /* "cypari_src/gen.pyx":10139
 * 
 *     def set_errnum(self, errnum):
 *         self.args = (errnum,)             # <<<<<<<<<<<<<<
 * 
 * # Global variables we use for error handling and signals
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_errnum);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_errnum);
    __Pyx_GIVEREF(__pyx_v_errnum);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_args, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":10138
 *         return self.args[0]
 * 
 *     def set_errnum(self, errnum):             # <<<<<<<<<<<<<<
 *         self.args = (errnum,)
 * 
 */

    /* function exit code */
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_AddTraceback("cypari_src.gen.PariError.set_errnum", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":10168
 * # this is not null, we call it.
 * 
 * cdef void sigalrm_handler(int signum):             # <<<<<<<<<<<<<<
 *     global pari_instance
 *     if pari_instance.UI_callback is not None:
 */

  static void __pyx_f_10cypari_src_3gen_sigalrm_handler(CYTHON_UNUSED int __pyx_v_signum) {
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    int __pyx_t_2;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("sigalrm_handler", 0);

    /* "cypari_src/gen.pyx":10170
 * cdef void sigalrm_handler(int signum):
 *     global pari_instance
 *     if pari_instance.UI_callback is not None:             # <<<<<<<<<<<<<<
 *         pari_instance.UI_callback()
 * 
 */
    __pyx_t_1 = (__pyx_v_10cypari_src_3gen_pari_instance->UI_callback != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":10171
 *     global pari_instance
 *     if pari_instance.UI_callback is not None:
 *         pari_instance.UI_callback()             # <<<<<<<<<<<<<<
 * 
 * # Our replacement for PARI's signal handler.  Uses
 */
      __Pyx_INCREF(__pyx_v_10cypari_src_3gen_pari_instance->UI_callback);
      __pyx_t_4 = __pyx_v_10cypari_src_3gen_pari_instance->UI_callback; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":10168
 * # this is not null, we call it.
 * 
 * cdef void sigalrm_handler(int signum):             # <<<<<<<<<<<<<<
 *     global pari_instance
 *     if pari_instance.UI_callback is not None:
 */

    /* function exit code */
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_WriteUnraisable("cypari_src.gen.sigalrm_handler", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
    __pyx_L0:;
    __Pyx_RefNannyFinishContext();
  }

  /* "cypari_src/gen.pyx":10176
 * # our callback for SIGINT, ignores the rest.
 * # If needed we could handle SIGSEGV etc.
 * cdef void pari_signal_handler(int signum):             # <<<<<<<<<<<<<<
 *     if signum == SIGINT:
 *         pari_sigint_handler() # Call the callback, like PARI would
 */

  static void __pyx_f_10cypari_src_3gen_pari_signal_handler(int __pyx_v_signum) {
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    __Pyx_RefNannySetupContext("pari_signal_handler", 0);

    /* "cypari_src/gen.pyx":10177
 * # If needed we could handle SIGSEGV etc.
 * cdef void pari_signal_handler(int signum):
 *     if signum == SIGINT:             # <<<<<<<<<<<<<<
 *         pari_sigint_handler() # Call the callback, like PARI would
 * 
 */
    __pyx_t_1 = ((__pyx_v_signum == SIGINT) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":10178
 * cdef void pari_signal_handler(int signum):
 *     if signum == SIGINT:
 *         pari_sigint_handler() # Call the callback, like PARI would             # <<<<<<<<<<<<<<
 * 
 * cdef public void set_pari_signals(): # called by sig_on
 */
      __pyx_f_10cypari_src_3gen_pari_sigint_handler();
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":10176
 * # our callback for SIGINT, ignores the rest.
 * # If needed we could handle SIGSEGV etc.
 * cdef void pari_signal_handler(int signum):             # <<<<<<<<<<<<<<
 *     if signum == SIGINT:
 *         pari_sigint_handler() # Call the callback, like PARI would
 */

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

  /* "cypari_src/gen.pyx":10180
 *         pari_sigint_handler() # Call the callback, like PARI would
 * 
 * cdef public void set_pari_signals(): # called by sig_on             # <<<<<<<<<<<<<<
 *     cdef int n
 *     global num_signals, pari_sig
 */

  void set_pari_signals(void) {
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("set_pari_signals", 0);

    /* "cypari_src/gen.pyx":10185
 *     global old_sigint_handler, old_sigalrm_handler
 *     global sigalrm_handler, pari_signal_handler
 *     old_sigint_handler = signal(SIGINT, pari_signal_handler)             # <<<<<<<<<<<<<<
 *     old_sigalrm_handler = signal(SIGALRM, sigalrm_handler)
 * 
 */
    __pyx_v_10cypari_src_3gen_old_sigint_handler = signal(SIGINT, __pyx_f_10cypari_src_3gen_pari_signal_handler);

    /* "cypari_src/gen.pyx":10186
 *     global sigalrm_handler, pari_signal_handler
 *     old_sigint_handler = signal(SIGINT, pari_signal_handler)
 *     old_sigalrm_handler = signal(SIGALRM, sigalrm_handler)             # <<<<<<<<<<<<<<
 * 
 * cdef public void unset_pari_signals(): # called by sig_off
 */
    __pyx_v_10cypari_src_3gen_old_sigalrm_handler = signal(SIGALRM, __pyx_f_10cypari_src_3gen_sigalrm_handler);

    /* "cypari_src/gen.pyx":10180
 *         pari_sigint_handler() # Call the callback, like PARI would
 * 
 * cdef public void set_pari_signals(): # called by sig_on             # <<<<<<<<<<<<<<
 *     cdef int n
 *     global num_signals, pari_sig
 */

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

  /* "cypari_src/gen.pyx":10188
 *     old_sigalrm_handler = signal(SIGALRM, sigalrm_handler)
 * 
 * cdef public void unset_pari_signals(): # called by sig_off             # <<<<<<<<<<<<<<
 *     cdef int n
 *     global num_signals, pari_sig
 */

  void unset_pari_signals(void) {
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("unset_pari_signals", 0);

    /* "cypari_src/gen.pyx":10192
 *     global num_signals, pari_sig
 *     global old_handlers, old_sigalrm_handler
 *     signal(SIGINT, old_sigint_handler)             # <<<<<<<<<<<<<<
 *     signal(SIGALRM, old_sigalrm_handler)
 * 
 */
    signal(SIGINT, __pyx_v_10cypari_src_3gen_old_sigint_handler);

    /* "cypari_src/gen.pyx":10193
 *     global old_handlers, old_sigalrm_handler
 *     signal(SIGINT, old_sigint_handler)
 *     signal(SIGALRM, old_sigalrm_handler)             # <<<<<<<<<<<<<<
 * 
 * # sig_off resets all the flags and signals
 */
    signal(SIGALRM, __pyx_v_10cypari_src_3gen_old_sigalrm_handler);

    /* "cypari_src/gen.pyx":10188
 *     old_sigalrm_handler = signal(SIGALRM, sigalrm_handler)
 * 
 * cdef public void unset_pari_signals(): # called by sig_off             # <<<<<<<<<<<<<<
 *     cdef int n
 *     global num_signals, pari_sig
 */

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

  /* "cypari_src/gen.pyx":10196
 * 
 * # sig_off resets all the flags and signals
 * cdef inline void sig_off():             # <<<<<<<<<<<<<<
 *     global pari_error_number, noer, setjmp_active, interrupt_flag
 *     pari_error_number = noer
 */

  static CYTHON_INLINE void __pyx_f_10cypari_src_3gen_sig_off(void) {
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sig_off", 0);

    /* "cypari_src/gen.pyx":10198
 * cdef inline void sig_off():
 *     global pari_error_number, noer, setjmp_active, interrupt_flag
 *     pari_error_number = noer             # <<<<<<<<<<<<<<
 *     setjmp_active = 0
 *     interrupt_flag = 0
 */
    pari_error_number = noer;

    /* "cypari_src/gen.pyx":10199
 *     global pari_error_number, noer, setjmp_active, interrupt_flag
 *     pari_error_number = noer
 *     setjmp_active = 0             # <<<<<<<<<<<<<<
 *     interrupt_flag = 0
 *     IF UNAME_SYSNAME != 'Windows':
 */
    setjmp_active = 0;

    /* "cypari_src/gen.pyx":10200
 *     pari_error_number = noer
 *     setjmp_active = 0
 *     interrupt_flag = 0             # <<<<<<<<<<<<<<
 *     IF UNAME_SYSNAME != 'Windows':
 *         unset_pari_signals()
 */
    interrupt_flag = 0;

    /* "cypari_src/gen.pyx":10202
 *     interrupt_flag = 0
 *     IF UNAME_SYSNAME != 'Windows':
 *         unset_pari_signals()             # <<<<<<<<<<<<<<
 * 
 * # We don't use sig_str, but Sage did.  If needed, write this.
 */
    unset_pari_signals();

    /* "cypari_src/gen.pyx":10196
 * 
 * # sig_off resets all the flags and signals
 * cdef inline void sig_off():             # <<<<<<<<<<<<<<
 *     global pari_error_number, noer, setjmp_active, interrupt_flag
 *     pari_error_number = noer
 */

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

  /* "cypari_src/gen.pyx":10205
 * 
 * # We don't use sig_str, but Sage did.  If needed, write this.
 * cdef inline int sig_str(char *message):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

  static CYTHON_INLINE int __pyx_f_10cypari_src_3gen_sig_str(CYTHON_UNUSED char *__pyx_v_message) {
    int __pyx_r;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("sig_str", 0);

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

  /* "cypari_src/gen.pyx":10213
 * # cb_pari_err_recover.
 * 
 * cdef int pari_error_handler(long errno) except 0:             # <<<<<<<<<<<<<<
 *     #print('\nerror_handler: %d'%errno)
 *     global interrupt_flag
 */

  static int __pyx_f_10cypari_src_3gen_pari_error_handler(long __pyx_v_errno) {
    int __pyx_r;
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    PyObject *__pyx_t_5 = NULL;
    PyObject *__pyx_t_6 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("pari_error_handler", 0);

    /* "cypari_src/gen.pyx":10216
 *     #print('\nerror_handler: %d'%errno)
 *     global interrupt_flag
 *     if interrupt_flag:             # <<<<<<<<<<<<<<
 *         interrupt_flag = 0
 *         raise PariError(-1)
 */
    __pyx_t_1 = (interrupt_flag != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":10217
 *     global interrupt_flag
 *     if interrupt_flag:
 *         interrupt_flag = 0             # <<<<<<<<<<<<<<
 *         raise PariError(-1)
 *     else:
 */
      interrupt_flag = 0;

      /* "cypari_src/gen.pyx":10218
 *     if interrupt_flag:
 *         interrupt_flag = 0
 *         raise PariError(-1)             # <<<<<<<<<<<<<<
 *     else:
 *         raise PariError(errno)
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PariError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":10220
 *         raise PariError(-1)
 *     else:
 *         raise PariError(errno)             # <<<<<<<<<<<<<<
 * 
 * # The callback to be assigned to cp_pari_err_recover.  Calls
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PariError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_errno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10220; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":10213
 * # cb_pari_err_recover.
 * 
 * cdef int pari_error_handler(long errno) except 0:             # <<<<<<<<<<<<<<
 *     #print('\nerror_handler: %d'%errno)
 *     global interrupt_flag
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6);
    __Pyx_AddTraceback("cypari_src.gen.pari_error_handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":10225
 * # sig_off to reset all flags and signals and then calls longjmp.
 * 
 * cdef void pari_error_recoverer(long errno):             # <<<<<<<<<<<<<<
 *     global setjmp_active
 *     #print('\nerror_recoverer: %d  setjmp_active: %d'%(errno, setjmp_active))
 */

  static void __pyx_f_10cypari_src_3gen_pari_error_recoverer(long __pyx_v_errno) {
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    __Pyx_RefNannySetupContext("pari_error_recoverer", 0);

    /* "cypari_src/gen.pyx":10228
 *     global setjmp_active
 *     #print('\nerror_recoverer: %d  setjmp_active: %d'%(errno, setjmp_active))
 *     if setjmp_active:             # <<<<<<<<<<<<<<
 *         sig_off()
 *         longjmp(jmp_env, errno)
 */
    __pyx_t_1 = (setjmp_active != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":10229
 *     #print('\nerror_recoverer: %d  setjmp_active: %d'%(errno, setjmp_active))
 *     if setjmp_active:
 *         sig_off()             # <<<<<<<<<<<<<<
 *         longjmp(jmp_env, errno)
 * 
 */
      __pyx_f_10cypari_src_3gen_sig_off();

      /* "cypari_src/gen.pyx":10230
 *     if setjmp_active:
 *         sig_off()
 *         longjmp(jmp_env, errno)             # <<<<<<<<<<<<<<
 * 
 * # The callback to be assigned to cb_pari_sigint.  Sets the
 */
      longjmp(jmp_env, __pyx_v_errno);
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":10225
 * # sig_off to reset all flags and signals and then calls longjmp.
 * 
 * cdef void pari_error_recoverer(long errno):             # <<<<<<<<<<<<<<
 *     global setjmp_active
 *     #print('\nerror_recoverer: %d  setjmp_active: %d'%(errno, setjmp_active))
 */

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

  /* "cypari_src/gen.pyx":10235
 * # interrupt flag and then behaves like PARI's default handler.
 * 
 * cdef void pari_sigint_handler():             # <<<<<<<<<<<<<<
 *     global interrupt_flag, setjmp_active
 *     #print('\npari_sigint_handler: setjmp_active = %d'%setjmp_active)
 */

  static void __pyx_f_10cypari_src_3gen_pari_sigint_handler(void) {
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    __Pyx_RefNannySetupContext("pari_sigint_handler", 0);

    /* "cypari_src/gen.pyx":10238
 *     global interrupt_flag, setjmp_active
 *     #print('\npari_sigint_handler: setjmp_active = %d'%setjmp_active)
 *     if setjmp_active:             # <<<<<<<<<<<<<<
 *         interrupt_flag = 1
 *         pari_err(talker, interrupt_msg)
 */
    __pyx_t_1 = (setjmp_active != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":10239
 *     #print('\npari_sigint_handler: setjmp_active = %d'%setjmp_active)
 *     if setjmp_active:
 *         interrupt_flag = 1             # <<<<<<<<<<<<<<
 *         pari_err(talker, interrupt_msg)
 * 
 */
      interrupt_flag = 1;

      /* "cypari_src/gen.pyx":10240
 *     if setjmp_active:
 *         interrupt_flag = 1
 *         pari_err(talker, interrupt_msg)             # <<<<<<<<<<<<<<
 * 
 * # For reasons that I do not understand, the initialization of
 */
      pari_err(talker, interrupt_msg);
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":10235
 * # interrupt flag and then behaves like PARI's default handler.
 * 
 * cdef void pari_sigint_handler():             # <<<<<<<<<<<<<<
 *     global interrupt_flag, setjmp_active
 *     #print('\npari_sigint_handler: setjmp_active = %d'%setjmp_active)
 */

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

  /* "cypari_src/gen.pyx":10262
 * #              - Gonzalo Tornario
 * 
 * cdef void _pari_trap "_pari_trap" (long errno, long retries) except *:             # <<<<<<<<<<<<<<
 *     """
 *     TESTS::
 */

  static void _pari_trap(long __pyx_v_errno, long __pyx_v_retries) {
    __Pyx_RefNannyDeclarations
    int __pyx_t_1;
    PyObject *__pyx_t_2 = NULL;
    PyObject *__pyx_t_3 = NULL;
    PyObject *__pyx_t_4 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("_pari_trap", 0);

    /* "cypari_src/gen.pyx":10267
 * 
 *     """
 *     if retries > 100:             # <<<<<<<<<<<<<<
 *         sig_off()
 *         raise RuntimeError, "_pari_trap recursion too deep"
 */
    __pyx_t_1 = ((__pyx_v_retries > 100) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":10268
 *     """
 *     if retries > 100:
 *         sig_off()             # <<<<<<<<<<<<<<
 *         raise RuntimeError, "_pari_trap recursion too deep"
 *     if errno == errpile:
 */
      __pyx_f_10cypari_src_3gen_sig_off();

      /* "cypari_src/gen.pyx":10269
 *     if retries > 100:
 *         sig_off()
 *         raise RuntimeError, "_pari_trap recursion too deep"             # <<<<<<<<<<<<<<
 *     if errno == errpile:
 *         P.allocatemem(silent=True)
 */
      __Pyx_Raise(__pyx_builtin_RuntimeError, __pyx_kp_s_pari_trap_recursion_too_deep, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":10270
 *         sig_off()
 *         raise RuntimeError, "_pari_trap recursion too deep"
 *     if errno == errpile:             # <<<<<<<<<<<<<<
 *         P.allocatemem(silent=True)
 *     elif errno == user:
 */
    __pyx_t_1 = ((__pyx_v_errno == errpile) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":10271
 *         raise RuntimeError, "_pari_trap recursion too deep"
 *     if errno == errpile:
 *         P.allocatemem(silent=True)             # <<<<<<<<<<<<<<
 *     elif errno == user:
 *         sig_off()
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_10cypari_src_3gen_P), __pyx_n_s_allocatemem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_silent, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10271; __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_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4;
    }

    /* "cypari_src/gen.pyx":10272
 *     if errno == errpile:
 *         P.allocatemem(silent=True)
 *     elif errno == user:             # <<<<<<<<<<<<<<
 *         sig_off()
 *         raise Exception, "PARI user exception"
 */
    __pyx_t_1 = ((__pyx_v_errno == user) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":10273
 *         P.allocatemem(silent=True)
 *     elif errno == user:
 *         sig_off()             # <<<<<<<<<<<<<<
 *         raise Exception, "PARI user exception"
 *     else:
 */
      __pyx_f_10cypari_src_3gen_sig_off();

      /* "cypari_src/gen.pyx":10274
 *     elif errno == user:
 *         sig_off()
 *         raise Exception, "PARI user exception"             # <<<<<<<<<<<<<<
 *     else:
 *         sig_off()
 */
      __Pyx_Raise(__pyx_builtin_Exception, __pyx_kp_s_PARI_user_exception, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    /*else*/ {

      /* "cypari_src/gen.pyx":10276
 *         raise Exception, "PARI user exception"
 *     else:
 *         sig_off()             # <<<<<<<<<<<<<<
 *         raise PariError, errno
 * 
 */
      __pyx_f_10cypari_src_3gen_sig_off();

      /* "cypari_src/gen.pyx":10277
 *     else:
 *         sig_off()
 *         raise PariError, errno             # <<<<<<<<<<<<<<
 * 
 * def vecsmall_to_intlist(gen v):
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PariError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_errno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_4, __pyx_t_3, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L4:;

    /* "cypari_src/gen.pyx":10262
 * #              - Gonzalo Tornario
 * 
 * cdef void _pari_trap "_pari_trap" (long errno, long retries) except *:             # <<<<<<<<<<<<<<
 *     """
 *     TESTS::
 */

    /* function exit code */
    goto __pyx_L0;
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen._pari_trap", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_L0:;
    __Pyx_RefNannyFinishContext();
  }

  /* "cypari_src/gen.pyx":10279
 *         raise PariError, errno
 * 
 * def vecsmall_to_intlist(gen v):             # <<<<<<<<<<<<<<
 *     """
 *     INPUT:
 */

  /* Python wrapper */
  static PyObject *__pyx_pw_10cypari_src_3gen_15vecsmall_to_intlist(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/
  static char __pyx_doc_10cypari_src_3gen_14vecsmall_to_intlist[] = "\n    INPUT:\n    \n    \n    -  ``v`` - a gen of type Vecsmall\n    \n    \n    OUTPUT: a Python list of Python ints\n    ";
  static PyMethodDef __pyx_mdef_10cypari_src_3gen_15vecsmall_to_intlist = {"vecsmall_to_intlist", (PyCFunction)__pyx_pw_10cypari_src_3gen_15vecsmall_to_intlist, METH_O, __pyx_doc_10cypari_src_3gen_14vecsmall_to_intlist};
  static PyObject *__pyx_pw_10cypari_src_3gen_15vecsmall_to_intlist(PyObject *__pyx_self, PyObject *__pyx_v_v) {
    CYTHON_UNUSED int __pyx_lineno = 0;
    CYTHON_UNUSED const char *__pyx_filename = NULL;
    CYTHON_UNUSED int __pyx_clineno = 0;
    PyObject *__pyx_r = 0;
    __Pyx_RefNannyDeclarations
    __Pyx_RefNannySetupContext("vecsmall_to_intlist (wrapper)", 0);
    if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_10cypari_src_3gen_gen, 1, "v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = __pyx_pf_10cypari_src_3gen_14vecsmall_to_intlist(__pyx_self, ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_v_v));

    /* function exit code */
    goto __pyx_L0;
    __pyx_L1_error:;
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  static PyObject *__pyx_pf_10cypari_src_3gen_14vecsmall_to_intlist(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_10cypari_src_3gen_gen *__pyx_v_v) {
    PyObject *__pyx_v_k = 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;
    Py_ssize_t __pyx_t_5;
    PyObject *(*__pyx_t_6)(PyObject *);
    Py_ssize_t __pyx_t_7;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("vecsmall_to_intlist", 0);

    /* "cypari_src/gen.pyx":10289
 *     OUTPUT: a Python list of Python ints
 *     """
 *     if typ(v.g) != t_VECSMALL:             # <<<<<<<<<<<<<<
 *         raise TypeError, "input v must be of type vecsmall (use v.Vecsmall())"
 *     return [v.g[k+1] for k in range(glength(v.g))]
 */
    __pyx_t_1 = ((typ(__pyx_v_v->g) != t_VECSMALL) != 0);
    if (__pyx_t_1) {

      /* "cypari_src/gen.pyx":10290
 *     """
 *     if typ(v.g) != t_VECSMALL:
 *         raise TypeError, "input v must be of type vecsmall (use v.Vecsmall())"             # <<<<<<<<<<<<<<
 *     return [v.g[k+1] for k in range(glength(v.g))]
 * 
 */
      __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_input_v_must_be_of_type_vecsmall, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cypari_src/gen.pyx":10291
 *     if typ(v.g) != t_VECSMALL:
 *         raise TypeError, "input v must be of type vecsmall (use v.Vecsmall())"
 *     return [v.g[k+1] for k in range(glength(v.g))]             # <<<<<<<<<<<<<<
 * 
 * cdef _factor_int_when_pari_factor_failed(x, failed_factorization):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_long(glength(__pyx_v_v->g)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __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 = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_v->g[__pyx_t_7])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":10279
 *         raise PariError, errno
 * 
 * def vecsmall_to_intlist(gen v):             # <<<<<<<<<<<<<<
 *     """
 *     INPUT:
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4);
    __Pyx_AddTraceback("cypari_src.gen.vecsmall_to_intlist", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = NULL;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_k);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }

  /* "cypari_src/gen.pyx":10293
 *     return [v.g[k+1] for k in range(glength(v.g))]
 * 
 * cdef _factor_int_when_pari_factor_failed(x, failed_factorization):             # <<<<<<<<<<<<<<
 *     """
 *     This is called by factor when PARI's factor tried to factor, got
 */

  static PyObject *__pyx_f_10cypari_src_3gen__factor_int_when_pari_factor_failed(CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_failed_factorization) {
    PyObject *__pyx_v_P = NULL;
    PyObject *__pyx_v_E = NULL;
    PyObject *__pyx_v_w = NULL;
    Py_ssize_t __pyx_v_i;
    PyObject *__pyx_v_p = NULL;
    PyObject *__pyx_v_e = NULL;
    PyObject *__pyx_v_F = NULL;
    Py_ssize_t __pyx_v_j;
    PyObject *__pyx_v_m = NULL;
    PyObject *__pyx_r = NULL;
    __Pyx_RefNannyDeclarations
    PyObject *__pyx_t_1 = NULL;
    int __pyx_t_2;
    Py_ssize_t __pyx_t_3;
    int __pyx_t_4;
    PyObject *__pyx_t_5 = NULL;
    Py_ssize_t __pyx_t_6;
    PyObject *__pyx_t_7 = NULL;
    Py_ssize_t __pyx_t_8;
    Py_ssize_t __pyx_t_9;
    int __pyx_t_10;
    PyObject *__pyx_t_11 = NULL;
    PyObject *__pyx_t_12 = NULL;
    int __pyx_lineno = 0;
    const char *__pyx_filename = NULL;
    int __pyx_clineno = 0;
    __Pyx_RefNannySetupContext("_factor_int_when_pari_factor_failed", 0);

    /* "cypari_src/gen.pyx":10303
 *     forcing a fake failure in the code in misc.h.)
 *     """
 *     P = failed_factorization[0]  # 'primes'             # <<<<<<<<<<<<<<
 *     E = failed_factorization[1]  # exponents
 *     if len(P) == 1 and E[0] == 1:
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_failed_factorization, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10303; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_P = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":10304
 *     """
 *     P = failed_factorization[0]  # 'primes'
 *     E = failed_factorization[1]  # exponents             # <<<<<<<<<<<<<<
 *     if len(P) == 1 and E[0] == 1:
 *         # Major problem -- factor can't split the integer at all,
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_failed_factorization, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10304; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_E = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":10305
 *     P = failed_factorization[0]  # 'primes'
 *     E = failed_factorization[1]  # exponents
 *     if len(P) == 1 and E[0] == 1:             # <<<<<<<<<<<<<<
 *         # Major problem -- factor can't split the integer at all,
 *         # but it's composite.  We're stuffed.
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_P); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = ((__pyx_t_3 == 1) != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_E, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10305; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_4;
    __pyx_L4_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cypari_src/gen.pyx":10309
 *         # but it's composite.  We're stuffed.
 *         print( "BIG WARNING: The number %s wasn't split at all by PARI,"
 *                "but it's definitely composite."%(P[0]) )             # <<<<<<<<<<<<<<
 *         print( "This is probably an infinite loop..." )
 *     w = []
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_P, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10309; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_BIG_WARNING_The_number_s_wasn_t, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cypari_src/gen.pyx":10308
 *         # Major problem -- factor can't split the integer at all,
 *         # but it's composite.  We're stuffed.
 *         print( "BIG WARNING: The number %s wasn't split at all by PARI,"             # <<<<<<<<<<<<<<
 *                "but it's definitely composite."%(P[0]) )
 *         print( "This is probably an infinite loop..." )
 */
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10308; __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;

      /* "cypari_src/gen.pyx":10310
 *         print( "BIG WARNING: The number %s wasn't split at all by PARI,"
 *                "but it's definitely composite."%(P[0]) )
 *         print( "This is probably an infinite loop..." )             # <<<<<<<<<<<<<<
 *     w = []
 *     for i in range(len(P)):
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "cypari_src/gen.pyx":10311
 *                "but it's definitely composite."%(P[0]) )
 *         print( "This is probably an infinite loop..." )
 *     w = []             # <<<<<<<<<<<<<<
 *     for i in range(len(P)):
 *         p = P[i]
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_w = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cypari_src/gen.pyx":10312
 *         print( "This is probably an infinite loop..." )
 *     w = []
 *     for i in range(len(P)):             # <<<<<<<<<<<<<<
 *         p = P[i]
 *         e = E[i]
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_P); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_3; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "cypari_src/gen.pyx":10313
 *     w = []
 *     for i in range(len(P)):
 *         p = P[i]             # <<<<<<<<<<<<<<
 *         e = E[i]
 *         if not p.isprime():
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_P, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10313; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":10314
 *     for i in range(len(P)):
 *         p = P[i]
 *         e = E[i]             # <<<<<<<<<<<<<<
 *         if not p.isprime():
 *             # Try to factor further -- assume this works.
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_E, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10314; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cypari_src/gen.pyx":10315
 *         p = P[i]
 *         e = E[i]
 *         if not p.isprime():             # <<<<<<<<<<<<<<
 *             # Try to factor further -- assume this works.
 *             F = p.factor(proof=True)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_isprime); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_7) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = ((!__pyx_t_2) != 0);
      if (__pyx_t_4) {

        /* "cypari_src/gen.pyx":10317
 *         if not p.isprime():
 *             # Try to factor further -- assume this works.
 *             F = p.factor(proof=True)             # <<<<<<<<<<<<<<
 *             for j in range(len(F[0])):
 *                 w.append((F[0][j], F[1][j]))
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_factor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_proof, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_v_F, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "cypari_src/gen.pyx":10318
 *             # Try to factor further -- assume this works.
 *             F = p.factor(proof=True)
 *             for j in range(len(F[0])):             # <<<<<<<<<<<<<<
 *                 w.append((F[0][j], F[1][j]))
 *         else:
 */
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_F, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
          __pyx_v_j = __pyx_t_9;

          /* "cypari_src/gen.pyx":10319
 *             F = p.factor(proof=True)
 *             for j in range(len(F[0])):
 *                 w.append((F[0][j], F[1][j]))             # <<<<<<<<<<<<<<
 *         else:
 *             w.append((p, e))
 */
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_F, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_F, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_5 = 0;
          __pyx_t_1 = 0;
          __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_w, __pyx_t_7); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        goto __pyx_L8;
      }
      /*else*/ {

        /* "cypari_src/gen.pyx":10321
 *                 w.append((F[0][j], F[1][j]))
 *         else:
 *             w.append((p, e))             # <<<<<<<<<<<<<<
 *     m = pari.matrix(len(w), 2)
 *     for i in range(len(w)):
 */
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_p);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_p);
        __Pyx_GIVEREF(__pyx_v_p);
        __Pyx_INCREF(__pyx_v_e);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_e);
        __Pyx_GIVEREF(__pyx_v_e);
        __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_w, __pyx_t_7); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L8:;
    }

    /* "cypari_src/gen.pyx":10322
 *         else:
 *             w.append((p, e))
 *     m = pari.matrix(len(w), 2)             # <<<<<<<<<<<<<<
 *     for i in range(len(w)):
 *         m[i,0] = w[i][0]
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pari); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_matrix); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = PyList_GET_SIZE(__pyx_v_w); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = NULL;
    __pyx_t_3 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_3 = 1;
      }
    }
    __pyx_t_12 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_11) {
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_3, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_3, __pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_m = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cypari_src/gen.pyx":10323
 *             w.append((p, e))
 *     m = pari.matrix(len(w), 2)
 *     for i in range(len(w)):             # <<<<<<<<<<<<<<
 *         m[i,0] = w[i][0]
 *         m[i,1] = w[i][1]
 */
    __pyx_t_3 = PyList_GET_SIZE(__pyx_v_w); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_3; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "cypari_src/gen.pyx":10324
 *     m = pari.matrix(len(w), 2)
 *     for i in range(len(w)):
 *         m[i,0] = w[i][0]             # <<<<<<<<<<<<<<
 *         m[i,1] = w[i][1]
 *     return m
 */
      __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_w, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10324; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10324; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      __pyx_t_7 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_m, __pyx_t_12, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cypari_src/gen.pyx":10325
 *     for i in range(len(w)):
 *         m[i,0] = w[i][0]
 *         m[i,1] = w[i][1]             # <<<<<<<<<<<<<<
 *     return m
 */
      __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_w, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10325; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10325; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      __pyx_t_5 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_m, __pyx_t_7, __pyx_t_12) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }

    /* "cypari_src/gen.pyx":10326
 *         m[i,0] = w[i][0]
 *         m[i,1] = w[i][1]
 *     return m             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_m);
    __pyx_r = __pyx_v_m;
    goto __pyx_L0;

    /* "cypari_src/gen.pyx":10293
 *     return [v.g[k+1] for k in range(glength(v.g))]
 * 
 * cdef _factor_int_when_pari_factor_failed(x, failed_factorization):             # <<<<<<<<<<<<<<
 *     """
 *     This is called by factor when PARI's factor tried to factor, got
 */

    /* function exit code */
    __pyx_L1_error:;
    __Pyx_XDECREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_12);
    __Pyx_AddTraceback("cypari_src.gen._factor_int_when_pari_factor_failed", __pyx_clineno, __pyx_lineno, __pyx_filename);
    __pyx_r = 0;
    __pyx_L0:;
    __Pyx_XDECREF(__pyx_v_P);
    __Pyx_XDECREF(__pyx_v_E);
    __Pyx_XDECREF(__pyx_v_w);
    __Pyx_XDECREF(__pyx_v_p);
    __Pyx_XDECREF(__pyx_v_e);
    __Pyx_XDECREF(__pyx_v_F);
    __Pyx_XDECREF(__pyx_v_m);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    return __pyx_r;
  }
  static struct __pyx_vtabstruct_10cypari_src_3gen_gen __pyx_vtable_10cypari_src_3gen_gen;

  static PyObject *__pyx_tp_new_10cypari_src_3gen_gen(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
    struct __pyx_obj_10cypari_src_3gen_gen *p;
    PyObject *o;
    if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
      o = (*t->tp_alloc)(t, 0);
    } else {
      o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
    }
    if (unlikely(!o)) return 0;
    p = ((struct __pyx_obj_10cypari_src_3gen_gen *)o);
    p->__pyx_vtab = __pyx_vtabptr_10cypari_src_3gen_gen;
    p->_parent = Py_None; Py_INCREF(Py_None);
    p->_refers_to = Py_None; Py_INCREF(Py_None);
    return o;
  }

  static void __pyx_tp_dealloc_10cypari_src_3gen_gen(PyObject *o) {
    struct __pyx_obj_10cypari_src_3gen_gen *p = (struct __pyx_obj_10cypari_src_3gen_gen *)o;
    #if PY_VERSION_HEX >= 0x030400a1
    if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
    #endif
    PyObject_GC_UnTrack(o);
    {
      PyObject *etype, *eval, *etb;
      PyErr_Fetch(&etype, &eval, &etb);
      ++Py_REFCNT(o);
      __pyx_pw_10cypari_src_3gen_3gen_5__dealloc__(o);
      --Py_REFCNT(o);
      PyErr_Restore(etype, eval, etb);
    }
    Py_CLEAR(p->_parent);
    Py_CLEAR(p->_refers_to);
    (*Py_TYPE(o)->tp_free)(o);
  }

  static int __pyx_tp_traverse_10cypari_src_3gen_gen(PyObject *o, visitproc v, void *a) {
    int e;
    struct __pyx_obj_10cypari_src_3gen_gen *p = (struct __pyx_obj_10cypari_src_3gen_gen *)o;
    if (p->_parent) {
      e = (*v)(p->_parent, a); if (e) return e;
    }
    if (p->_refers_to) {
      e = (*v)(p->_refers_to, a); if (e) return e;
    }
    return 0;
  }

  static int __pyx_tp_clear_10cypari_src_3gen_gen(PyObject *o) {
    PyObject* tmp;
    struct __pyx_obj_10cypari_src_3gen_gen *p = (struct __pyx_obj_10cypari_src_3gen_gen *)o;
    tmp = ((PyObject*)p->_parent);
    p->_parent = Py_None; Py_INCREF(Py_None);
    Py_XDECREF(tmp);
    tmp = ((PyObject*)p->_refers_to);
    p->_refers_to = Py_None; Py_INCREF(Py_None);
    Py_XDECREF(tmp);
    return 0;
  }
  static PyObject *__pyx_sq_item_10cypari_src_3gen_gen(PyObject *o, Py_ssize_t i) {
    PyObject *r;
    PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
    r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
    Py_DECREF(x);
    return r;
  }

  static int __pyx_mp_ass_subscript_10cypari_src_3gen_gen(PyObject *o, PyObject *i, PyObject *v) {
    if (v) {
      return __pyx_pw_10cypari_src_3gen_3gen_77__setitem__(o, i, v);
    }
    else {
      PyErr_Format(PyExc_NotImplementedError,
        "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
      return -1;
    }
  }

  static PyMethodDef __pyx_methods_10cypari_src_3gen_gen[] = {
    {"parent", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_3parent, METH_NOARGS, 0},
    {"_testclass", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_11_testclass, METH_NOARGS, 0},
    {"list", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_13list, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_12list},
    {"_add_one", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_25_add_one, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_24_add_one},
    {"getattr", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_41getattr, METH_O, 0},
    {"mod", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_43mod, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_42mod},
    {"nf_get_pol", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_45nf_get_pol, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_44nf_get_pol},
    {"nf_get_diff", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_47nf_get_diff, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_46nf_get_diff},
    {"nf_get_sign", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_49nf_get_sign, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_48nf_get_sign},
    {"nf_get_zk", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_51nf_get_zk, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_50nf_get_zk},
    {"bnf_get_no", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_53bnf_get_no, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_52bnf_get_no},
    {"bnf_get_cyc", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_55bnf_get_cyc, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_54bnf_get_cyc},
    {"bnf_get_gen", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_57bnf_get_gen, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_56bnf_get_gen},
    {"bnf_get_reg", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_59bnf_get_reg, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_58bnf_get_reg},
    {"pr_get_p", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_61pr_get_p, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_60pr_get_p},
    {"pr_get_e", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_63pr_get_e, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_62pr_get_e},
    {"pr_get_f", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_65pr_get_f, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_64pr_get_f},
    {"pr_get_gen", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_67pr_get_gen, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_66pr_get_gen},
    {"bid_get_cyc", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_69bid_get_cyc, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_68bid_get_cyc},
    {"bid_get_gen", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_71bid_get_gen, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_70bid_get_gen},
    {"_gen_length", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_75_gen_length, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_74_gen_length},
    {"__copy__", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_83__copy__, METH_NOARGS, 0},
    {"list_str", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_85list_str, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_84list_str},
    {"hex", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_89hex, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_88hex},
    {"int_unsafe", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_93int_unsafe, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_92int_unsafe},
    {"intvec_unsafe", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_95intvec_unsafe, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_94intvec_unsafe},
    {"python_list_small", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_97python_list_small, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_96python_list_small},
    {"python_list", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_99python_list, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_98python_list},
    {"__complex__", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_103__complex__, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_102__complex__},
    {"gequal", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_107gequal, METH_O, __pyx_doc_10cypari_src_3gen_3gen_106gequal},
    {"gequal0", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_109gequal0, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_108gequal0},
    {"gequal_long", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_111gequal_long, METH_O, __pyx_doc_10cypari_src_3gen_3gen_110gequal_long},
    {"isprime", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_113isprime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_112isprime},
    {"qfbhclassno", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_115qfbhclassno, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_114qfbhclassno},
    {"ispseudoprime", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_117ispseudoprime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_116ispseudoprime},
    {"ispower", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_119ispower, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_118ispower},
    {"divrem", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_121divrem, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_120divrem},
    {"lex", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_123lex, METH_O, __pyx_doc_10cypari_src_3gen_3gen_122lex},
    {"max", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_125max, METH_O, __pyx_doc_10cypari_src_3gen_3gen_124max},
    {"min", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_127min, METH_O, __pyx_doc_10cypari_src_3gen_3gen_126min},
    {"shift", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_129shift, METH_O, __pyx_doc_10cypari_src_3gen_3gen_128shift},
    {"shiftmul", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_131shiftmul, METH_O, __pyx_doc_10cypari_src_3gen_3gen_130shiftmul},
    {"moebius", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_133moebius, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_132moebius},
    {"sign", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_135sign, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_134sign},
    {"vecmax", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_137vecmax, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_136vecmax},
    {"vecmin", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_139vecmin, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_138vecmin},
    {"Col", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_141Col, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_140Col},
    {"Colrev", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_143Colrev, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_142Colrev},
    {"List", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_145List, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_144List},
    {"Mat", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_147Mat, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_146Mat},
    {"Mod", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_149Mod, METH_O, __pyx_doc_10cypari_src_3gen_3gen_148Mod},
    {"Pol", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_151Pol, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_150Pol},
    {"Polrev", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_153Polrev, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_152Polrev},
    {"Qfb", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_155Qfb, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_154Qfb},
    {"Ser", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_157Ser, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_156Ser},
    {"Set", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_159Set, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_158Set},
    {"Str", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_161Str, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_160Str},
    {"Strchr", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_163Strchr, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_162Strchr},
    {"Strexpand", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_165Strexpand, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_164Strexpand},
    {"Strtex", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_167Strtex, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_166Strtex},
    {"printtex", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_169printtex, METH_NOARGS, 0},
    {"Vec", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_171Vec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_170Vec},
    {"Vecrev", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_173Vecrev, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_172Vecrev},
    {"Vecsmall", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_175Vecsmall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_174Vecsmall},
    {"binary", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_177binary, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_176binary},
    {"bitand", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_179bitand, METH_O, __pyx_doc_10cypari_src_3gen_3gen_178bitand},
    {"bitneg", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_181bitneg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_180bitneg},
    {"bitnegimply", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_183bitnegimply, METH_O, __pyx_doc_10cypari_src_3gen_3gen_182bitnegimply},
    {"bitor", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_185bitor, METH_O, __pyx_doc_10cypari_src_3gen_3gen_184bitor},
    {"bittest", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_187bittest, METH_O, __pyx_doc_10cypari_src_3gen_3gen_186bittest},
    {"bitxor", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_189bitxor, METH_O, __pyx_doc_10cypari_src_3gen_3gen_188bitxor},
    {"ceil", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_191ceil, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_190ceil},
    {"centerlift", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_193centerlift, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_192centerlift},
    {"component", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_195component, METH_O, __pyx_doc_10cypari_src_3gen_3gen_194component},
    {"conj", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_197conj, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_196conj},
    {"conjvec", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_199conjvec, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_198conjvec},
    {"denominator", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_201denominator, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_200denominator},
    {"floor", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_203floor, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_202floor},
    {"frac", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_205frac, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_204frac},
    {"imag", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_207imag, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_206imag},
    {"length", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_209length, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_208length},
    {"lift", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_211lift, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_210lift},
    {"numbpart", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_213numbpart, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_212numbpart},
    {"numerator", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_215numerator, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_214numerator},
    {"numtoperm", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_217numtoperm, METH_O, __pyx_doc_10cypari_src_3gen_3gen_216numtoperm},
    {"padicprec", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_219padicprec, METH_O, __pyx_doc_10cypari_src_3gen_3gen_218padicprec},
    {"padicprime", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_221padicprime, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_220padicprime},
    {"permtonum", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_223permtonum, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_222permtonum},
    {"precision", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_225precision, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_224precision},
    {"random", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_227random, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_226random},
    {"real", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_229real, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_228real},
    {"round", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_231round, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_230round},
    {"simplify", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_233simplify, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_232simplify},
    {"sizeword", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_235sizeword, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_234sizeword},
    {"sizebyte", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_237sizebyte, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_236sizebyte},
    {"sizedigit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_239sizedigit, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_238sizedigit},
    {"truncate", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_241truncate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_240truncate},
    {"valuation", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_243valuation, METH_O, __pyx_doc_10cypari_src_3gen_3gen_242valuation},
    {"_valp", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_245_valp, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_244_valp},
    {"variable", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_247variable, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_246variable},
    {"abs", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_249abs, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_248abs},
    {"acos", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_251acos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_250acos},
    {"acosh", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_253acosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_252acosh},
    {"agm", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_255agm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_254agm},
    {"arg", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_257arg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_256arg},
    {"asin", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_259asin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_258asin},
    {"asinh", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_261asinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_260asinh},
    {"atan", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_263atan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_262atan},
    {"atanh", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_265atanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_264atanh},
    {"bernfrac", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_267bernfrac, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_266bernfrac},
    {"bernreal", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_269bernreal, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_268bernreal},
    {"bernvec", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_271bernvec, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_270bernvec},
    {"besselh1", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_273besselh1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_272besselh1},
    {"besselh2", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_275besselh2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_274besselh2},
    {"besselj", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_277besselj, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_276besselj},
    {"besseljh", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_279besseljh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_278besseljh},
    {"besseli", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_281besseli, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_280besseli},
    {"besselk", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_283besselk, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_282besselk},
    {"besseln", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_285besseln, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_284besseln},
    {"cos", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_287cos, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_286cos},
    {"cosh", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_289cosh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_288cosh},
    {"cotan", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_291cotan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_290cotan},
    {"dilog", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_293dilog, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_292dilog},
    {"eint1", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_295eint1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_294eint1},
    {"erfc", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_297erfc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_296erfc},
    {"eta", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_299eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_298eta},
    {"exp", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_301exp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_300exp},
    {"gamma", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_303gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_302gamma},
    {"gammah", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_305gammah, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_304gammah},
    {"hyperu", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_307hyperu, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_306hyperu},
    {"incgam", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_309incgam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_308incgam},
    {"incgamc", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_311incgamc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_310incgamc},
    {"log", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_313log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_312log},
    {"log_gamma", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_315log_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_314log_gamma},
    {"polylog", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_317polylog, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_316polylog},
    {"psi", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_319psi, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_318psi},
    {"sin", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_321sin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_320sin},
    {"sinh", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_323sinh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_322sinh},
    {"sqr", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_325sqr, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_324sqr},
    {"sqrt", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_327sqrt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_326sqrt},
    {"sqrtn", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_329sqrtn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_328sqrtn},
    {"tan", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_331tan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_330tan},
    {"tanh", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_333tanh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_332tanh},
    {"teichmuller", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_335teichmuller, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_334teichmuller},
    {"theta", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_337theta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_336theta},
    {"thetanullk", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_339thetanullk, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_338thetanullk},
    {"weber", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_341weber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_340weber},
    {"zeta", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_343zeta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_342zeta},
    {"bezout", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_345bezout, METH_O, 0},
    {"binomial", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_347binomial, METH_O, __pyx_doc_10cypari_src_3gen_3gen_346binomial},
    {"contfrac", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_349contfrac, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_348contfrac},
    {"contfracpnqn", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_351contfracpnqn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_350contfracpnqn},
    {"fibonacci", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_353fibonacci, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_352fibonacci},
    {"gcd", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_355gcd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_354gcd},
    {"issquare", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_357issquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_356issquare},
    {"issquarefree", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_359issquarefree, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_358issquarefree},
    {"lcm", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_361lcm, METH_O, __pyx_doc_10cypari_src_3gen_3gen_360lcm},
    {"numdiv", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_363numdiv, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_362numdiv},
    {"phi", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_365phi, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_364phi},
    {"primepi", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_367primepi, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_366primepi},
    {"sumdiv", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_369sumdiv, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_368sumdiv},
    {"sumdivk", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_371sumdivk, METH_O, __pyx_doc_10cypari_src_3gen_3gen_370sumdivk},
    {"xgcd", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_373xgcd, METH_O, __pyx_doc_10cypari_src_3gen_3gen_372xgcd},
    {"ellinit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_375ellinit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_374ellinit},
    {"ellglobalred", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_377ellglobalred, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_376ellglobalred},
    {"elladd", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_379elladd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_378elladd},
    {"ellak", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_381ellak, METH_O, __pyx_doc_10cypari_src_3gen_3gen_380ellak},
    {"ellan", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_383ellan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_382ellan},
    {"ellanalyticrank", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_385ellanalyticrank, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_384ellanalyticrank},
    {"ellap", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_387ellap, METH_O, __pyx_doc_10cypari_src_3gen_3gen_386ellap},
    {"ellaplist", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_389ellaplist, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_388ellaplist},
    {"ellbil", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_391ellbil, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_390ellbil},
    {"ellchangecurve", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_393ellchangecurve, METH_O, __pyx_doc_10cypari_src_3gen_3gen_392ellchangecurve},
    {"elleta", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_395elleta, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_394elleta},
    {"ellheight", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_397ellheight, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_396ellheight},
    {"ellheightmatrix", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_399ellheightmatrix, METH_O, __pyx_doc_10cypari_src_3gen_3gen_398ellheightmatrix},
    {"ellisoncurve", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_401ellisoncurve, METH_O, __pyx_doc_10cypari_src_3gen_3gen_400ellisoncurve},
    {"elllocalred", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_403elllocalred, METH_O, __pyx_doc_10cypari_src_3gen_3gen_402elllocalred},
    {"elllseries", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_405elllseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_404elllseries},
    {"ellminimalmodel", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_407ellminimalmodel, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_406ellminimalmodel},
    {"ellorder", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_409ellorder, METH_O, __pyx_doc_10cypari_src_3gen_3gen_408ellorder},
    {"ellordinate", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_411ellordinate, METH_O, __pyx_doc_10cypari_src_3gen_3gen_410ellordinate},
    {"ellpointtoz", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_413ellpointtoz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_412ellpointtoz},
    {"ellpow", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_415ellpow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_414ellpow},
    {"ellrootno", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_417ellrootno, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_416ellrootno},
    {"ellsigma", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_419ellsigma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_418ellsigma},
    {"ellsub", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_421ellsub, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_420ellsub},
    {"elltaniyama", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_423elltaniyama, METH_NOARGS, 0},
    {"elltors", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_425elltors, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_424elltors},
    {"ellzeta", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_427ellzeta, METH_O, __pyx_doc_10cypari_src_3gen_3gen_426ellzeta},
    {"ellztopoint", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_429ellztopoint, METH_O, __pyx_doc_10cypari_src_3gen_3gen_428ellztopoint},
    {"omega", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_431omega, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_430omega},
    {"disc", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_433disc, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_432disc},
    {"j", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_435j, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_434j},
    {"ellj", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_437ellj, METH_NOARGS, 0},
    {"bnfcertify", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_439bnfcertify, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_438bnfcertify},
    {"bnfinit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_441bnfinit, METH_VARARGS|METH_KEYWORDS, 0},
    {"bnfisintnorm", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_443bnfisintnorm, METH_O, 0},
    {"bnfisnorm", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_445bnfisnorm, METH_VARARGS|METH_KEYWORDS, 0},
    {"bnfisprincipal", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_447bnfisprincipal, METH_VARARGS|METH_KEYWORDS, 0},
    {"bnfnarrow", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_449bnfnarrow, METH_NOARGS, 0},
    {"bnfsunit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_451bnfsunit, METH_VARARGS|METH_KEYWORDS, 0},
    {"bnfunit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_453bnfunit, METH_NOARGS, 0},
    {"bnfisunit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_455bnfisunit, METH_O, 0},
    {"dirzetak", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_457dirzetak, METH_O, 0},
    {"galoisapply", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_459galoisapply, METH_VARARGS|METH_KEYWORDS, 0},
    {"galoisinit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_461galoisinit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_460galoisinit},
    {"galoispermtopol", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_463galoispermtopol, METH_O, 0},
    {"galoisfixedfield", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_465galoisfixedfield, METH_VARARGS|METH_KEYWORDS, 0},
    {"idealred", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_467idealred, METH_VARARGS|METH_KEYWORDS, 0},
    {"idealadd", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_469idealadd, METH_VARARGS|METH_KEYWORDS, 0},
    {"idealaddtoone", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_471idealaddtoone, METH_VARARGS|METH_KEYWORDS, 0},
    {"idealappr", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_473idealappr, METH_VARARGS|METH_KEYWORDS, 0},
    {"idealcoprime", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_475idealcoprime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_474idealcoprime},
    {"idealdiv", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_477idealdiv, METH_VARARGS|METH_KEYWORDS, 0},
    {"idealfactor", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_479idealfactor, METH_O, 0},
    {"idealhnf", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_481idealhnf, METH_VARARGS|METH_KEYWORDS, 0},
    {"idealintersection", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_483idealintersection, METH_VARARGS|METH_KEYWORDS, 0},
    {"ideallist", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_485ideallist, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_484ideallist},
    {"ideallog", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_487ideallog, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_486ideallog},
    {"idealmul", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_489idealmul, METH_VARARGS|METH_KEYWORDS, 0},
    {"idealnorm", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_491idealnorm, METH_O, 0},
    {"idealprimedec", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_493idealprimedec, METH_O, __pyx_doc_10cypari_src_3gen_3gen_492idealprimedec},
    {"idealstar", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_495idealstar, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_494idealstar},
    {"idealtwoelt", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_497idealtwoelt, METH_VARARGS|METH_KEYWORDS, 0},
    {"idealval", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_499idealval, METH_VARARGS|METH_KEYWORDS, 0},
    {"elementval", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_501elementval, METH_VARARGS|METH_KEYWORDS, 0},
    {"modreverse", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_503modreverse, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_502modreverse},
    {"nfbasis", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_505nfbasis, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_504nfbasis},
    {"nfbasis_d", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_507nfbasis_d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_506nfbasis_d},
    {"nfbasistoalg", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_509nfbasistoalg, METH_O, __pyx_doc_10cypari_src_3gen_3gen_508nfbasistoalg},
    {"nfbasistoalg_lift", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_511nfbasistoalg_lift, METH_O, __pyx_doc_10cypari_src_3gen_3gen_510nfbasistoalg_lift},
    {"nfdisc", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_513nfdisc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_512nfdisc},
    {"nfeltreduce", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_515nfeltreduce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_514nfeltreduce},
    {"nffactor", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_517nffactor, METH_O, 0},
    {"nfgenerator", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_519nfgenerator, METH_NOARGS, 0},
    {"nfhilbert", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_521nfhilbert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_520nfhilbert},
    {"nfinit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_523nfinit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_522nfinit},
    {"_nfinit_with_prec", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_525_nfinit_with_prec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_524_nfinit_with_prec},
    {"nfisisom", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_527nfisisom, METH_O, __pyx_doc_10cypari_src_3gen_3gen_526nfisisom},
    {"nfrootsof1", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_529nfrootsof1, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_528nfrootsof1},
    {"nfsubfields", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_531nfsubfields, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_530nfsubfields},
    {"rnfcharpoly", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_533rnfcharpoly, METH_VARARGS|METH_KEYWORDS, 0},
    {"rnfdisc", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_535rnfdisc, METH_O, 0},
    {"rnfeltabstorel", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_537rnfeltabstorel, METH_O, 0},
    {"rnfeltreltoabs", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_539rnfeltreltoabs, METH_O, 0},
    {"rnfequation", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_541rnfequation, METH_VARARGS|METH_KEYWORDS, 0},
    {"rnfidealabstorel", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_543rnfidealabstorel, METH_O, 0},
    {"rnfidealdown", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_545rnfidealdown, METH_O, __pyx_doc_10cypari_src_3gen_3gen_544rnfidealdown},
    {"rnfidealhnf", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_547rnfidealhnf, METH_O, 0},
    {"rnfidealnormrel", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_549rnfidealnormrel, METH_O, 0},
    {"rnfidealreltoabs", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_551rnfidealreltoabs, METH_O, 0},
    {"rnfidealtwoelt", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_553rnfidealtwoelt, METH_O, 0},
    {"rnfinit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_555rnfinit, METH_O, __pyx_doc_10cypari_src_3gen_3gen_554rnfinit},
    {"rnfisfree", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_557rnfisfree, METH_O, 0},
    {"quadhilbert", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_559quadhilbert, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_558quadhilbert},
    {"reverse", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_561reverse, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_560reverse},
    {"content", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_563content, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_562content},
    {"deriv", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_565deriv, METH_VARARGS|METH_KEYWORDS, 0},
    {"eval", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_567eval, METH_O, 0},
    {"factornf", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_571factornf, METH_O, __pyx_doc_10cypari_src_3gen_3gen_570factornf},
    {"factorpadic", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_573factorpadic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_572factorpadic},
    {"factormod", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_575factormod, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_574factormod},
    {"intformal", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_577intformal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_576intformal},
    {"padicappr", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_579padicappr, METH_O, __pyx_doc_10cypari_src_3gen_3gen_578padicappr},
    {"newtonpoly", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_581newtonpoly, METH_O, __pyx_doc_10cypari_src_3gen_3gen_580newtonpoly},
    {"polcoeff", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_583polcoeff, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_582polcoeff},
    {"polcompositum", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_585polcompositum, METH_VARARGS|METH_KEYWORDS, 0},
    {"poldegree", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_587poldegree, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_586poldegree},
    {"poldisc", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_589poldisc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_588poldisc},
    {"poldiscreduced", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_591poldiscreduced, METH_NOARGS, 0},
    {"polgalois", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_593polgalois, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_592polgalois},
    {"nfgaloisconj", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_595nfgaloisconj, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_594nfgaloisconj},
    {"nfroots", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_597nfroots, METH_O, __pyx_doc_10cypari_src_3gen_3gen_596nfroots},
    {"polhensellift", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_599polhensellift, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_598polhensellift},
    {"polisirreducible", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_601polisirreducible, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_600polisirreducible},
    {"pollead", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_603pollead, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_602pollead},
    {"polrecip", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_605polrecip, METH_NOARGS, 0},
    {"polred", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_607polred, METH_VARARGS|METH_KEYWORDS, 0},
    {"polredabs", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_609polredabs, METH_VARARGS|METH_KEYWORDS, 0},
    {"polresultant", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_611polresultant, METH_VARARGS|METH_KEYWORDS, 0},
    {"polroots", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_613polroots, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_612polroots},
    {"polrootsmod", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_615polrootsmod, METH_VARARGS|METH_KEYWORDS, 0},
    {"polrootspadic", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_617polrootspadic, METH_VARARGS|METH_KEYWORDS, 0},
    {"polrootspadicfast", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_619polrootspadicfast, METH_VARARGS|METH_KEYWORDS, 0},
    {"polsturm", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_621polsturm, METH_VARARGS|METH_KEYWORDS, 0},
    {"polsturm_full", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_623polsturm_full, METH_NOARGS, 0},
    {"polsylvestermatrix", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_625polsylvestermatrix, METH_O, 0},
    {"polsym", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_627polsym, METH_O, 0},
    {"serconvol", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_629serconvol, METH_O, 0},
    {"serlaplace", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_631serlaplace, METH_NOARGS, 0},
    {"serreverse", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_633serreverse, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_632serreverse},
    {"thueinit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_635thueinit, METH_VARARGS|METH_KEYWORDS, 0},
    {"rnfisnorminit", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_637rnfisnorminit, METH_VARARGS|METH_KEYWORDS, 0},
    {"rnfisnorm", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_639rnfisnorm, METH_VARARGS|METH_KEYWORDS, 0},
    {"vecextract", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_641vecextract, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_640vecextract},
    {"ncols", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_643ncols, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_642ncols},
    {"nrows", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_645nrows, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_644nrows},
    {"mattranspose", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_647mattranspose, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_646mattranspose},
    {"matadjoint", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_649matadjoint, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_648matadjoint},
    {"qflll", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_651qflll, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_650qflll},
    {"qflllgram", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_653qflllgram, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_652qflllgram},
    {"lllgram", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_655lllgram, METH_NOARGS, 0},
    {"lllgramint", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_657lllgramint, METH_NOARGS, 0},
    {"qfminim", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_659qfminim, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_658qfminim},
    {"qfrep", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_661qfrep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_660qfrep},
    {"matsolve", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_663matsolve, METH_O, __pyx_doc_10cypari_src_3gen_3gen_662matsolve},
    {"matker", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_665matker, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_664matker},
    {"matkerint", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_667matkerint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_666matkerint},
    {"matdet", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_669matdet, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_668matdet},
    {"trace", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_671trace, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_670trace},
    {"mathnf", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_673mathnf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_672mathnf},
    {"mathnfmod", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_675mathnfmod, METH_O, __pyx_doc_10cypari_src_3gen_3gen_674mathnfmod},
    {"mathnfmodid", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_677mathnfmodid, METH_O, __pyx_doc_10cypari_src_3gen_3gen_676mathnfmodid},
    {"matsnf", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_679matsnf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_678matsnf},
    {"matrank", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_681matrank, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_680matrank},
    {"matfrobenius", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_683matfrobenius, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_682matfrobenius},
    {"factor", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_685factor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_684factor},
    {"hilbert", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_687hilbert, METH_VARARGS|METH_KEYWORDS, 0},
    {"chinese", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_689chinese, METH_O, 0},
    {"order", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_691order, METH_NOARGS, 0},
    {"znprimroot", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_693znprimroot, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_692znprimroot},
    {"norm", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_697norm, METH_NOARGS, 0},
    {"nextprime", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_699nextprime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_698nextprime},
    {"change_variable_name", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_701change_variable_name, METH_O, __pyx_doc_10cypari_src_3gen_3gen_700change_variable_name},
    {"subst", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_703subst, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_702subst},
    {"substpol", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_705substpol, METH_VARARGS|METH_KEYWORDS, 0},
    {"nf_subst", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_707nf_subst, METH_O, __pyx_doc_10cypari_src_3gen_3gen_706nf_subst},
    {"taylor", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_709taylor, METH_VARARGS|METH_KEYWORDS, 0},
    {"thue", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_711thue, METH_VARARGS|METH_KEYWORDS, 0},
    {"charpoly", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_713charpoly, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_712charpoly},
    {"kronecker", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_715kronecker, METH_O, 0},
    {"type", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_717type, METH_NOARGS, __pyx_doc_10cypari_src_3gen_3gen_716type},
    {"polinterpolate", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_719polinterpolate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_718polinterpolate},
    {"algdep", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_721algdep, METH_O, __pyx_doc_10cypari_src_3gen_3gen_720algdep},
    {"concat", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_723concat, METH_O, 0},
    {"lindep", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_725lindep, METH_VARARGS|METH_KEYWORDS, 0},
    {"listinsert", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_727listinsert, METH_VARARGS|METH_KEYWORDS, 0},
    {"listput", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_729listput, METH_VARARGS|METH_KEYWORDS, 0},
    {"elleisnum", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_731elleisnum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_730elleisnum},
    {"ellwp", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_733ellwp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_732ellwp},
    {"ellchangepoint", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_735ellchangepoint, METH_O, __pyx_doc_10cypari_src_3gen_3gen_734ellchangepoint},
    {"debug", (PyCFunction)__pyx_pw_10cypari_src_3gen_3gen_737debug, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_3gen_736debug},
    {0, 0, 0, 0}
  };

  static PyNumberMethods __pyx_tp_as_number_gen = {
    __pyx_pw_10cypari_src_3gen_3gen_15__add__, /*nb_add*/
    __pyx_pw_10cypari_src_3gen_3gen_17__sub__, /*nb_subtract*/
    __pyx_pw_10cypari_src_3gen_3gen_19__mul__, /*nb_multiply*/
    #if PY_MAJOR_VERSION < 3
    __pyx_pw_10cypari_src_3gen_3gen_23__div__, /*nb_divide*/
    #endif
    __pyx_pw_10cypari_src_3gen_3gen_27__mod__, /*nb_remainder*/
    0, /*nb_divmod*/
    __pyx_pw_10cypari_src_3gen_3gen_29__pow__, /*nb_power*/
    __pyx_pw_10cypari_src_3gen_3gen_31__neg__, /*nb_negative*/
    0, /*nb_positive*/
    __pyx_pw_10cypari_src_3gen_3gen_695__abs__, /*nb_absolute*/
    __pyx_pw_10cypari_src_3gen_3gen_105__nonzero__, /*nb_nonzero*/
    __pyx_pw_10cypari_src_3gen_3gen_39__invert__, /*nb_invert*/
    __pyx_pw_10cypari_src_3gen_3gen_37__lshift__, /*nb_lshift*/
    __pyx_pw_10cypari_src_3gen_3gen_35__rshift__, /*nb_rshift*/
    0, /*nb_and*/
    __pyx_pw_10cypari_src_3gen_3gen_33__xor__, /*nb_xor*/
    0, /*nb_or*/
    #if PY_MAJOR_VERSION < 3
    0, /*nb_coerce*/
    #endif
    __pyx_pw_10cypari_src_3gen_3gen_91__int__, /*nb_int*/
    #if PY_MAJOR_VERSION < 3
    __pyx_pw_10cypari_src_3gen_3gen_91__int__, /*nb_long*/
    #else
    0, /*reserved*/
    #endif
    __pyx_pw_10cypari_src_3gen_3gen_101__float__, /*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*/
    __pyx_pw_10cypari_src_3gen_3gen_21__truediv__, /*nb_true_divide*/
    0, /*nb_inplace_floor_divide*/
    0, /*nb_inplace_true_divide*/
    __pyx_pw_10cypari_src_3gen_3gen_87__index__, /*nb_index*/
    #if PY_VERSION_HEX >= 0x03050000
    0, /*nb_matrix_multiply*/
    #endif
    #if PY_VERSION_HEX >= 0x03050000
    0, /*nb_inplace_matrix_multiply*/
    #endif
  };

  static PySequenceMethods __pyx_tp_as_sequence_gen = {
    __pyx_pw_10cypari_src_3gen_3gen_79__len__, /*sq_length*/
    0, /*sq_concat*/
    0, /*sq_repeat*/
    __pyx_sq_item_10cypari_src_3gen_gen, /*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_gen = {
    __pyx_pw_10cypari_src_3gen_3gen_79__len__, /*mp_length*/
    __pyx_pw_10cypari_src_3gen_3gen_73__getitem__, /*mp_subscript*/
    __pyx_mp_ass_subscript_10cypari_src_3gen_gen, /*mp_ass_subscript*/
  };

  static PyTypeObject __pyx_type_10cypari_src_3gen_gen = {
    PyVarObject_HEAD_INIT(0, 0)
    "cypari_src.gen.gen", /*tp_name*/
    sizeof(struct __pyx_obj_10cypari_src_3gen_gen), /*tp_basicsize*/
    0, /*tp_itemsize*/
    __pyx_tp_dealloc_10cypari_src_3gen_gen, /*tp_dealloc*/
    0, /*tp_print*/
    0, /*tp_getattr*/
    0, /*tp_setattr*/
    #if PY_MAJOR_VERSION < 3
    0, /*tp_compare*/
    #else
    0, /*reserved*/
    #endif
    __pyx_pw_10cypari_src_3gen_3gen_7__repr__, /*tp_repr*/
    &__pyx_tp_as_number_gen, /*tp_as_number*/
    &__pyx_tp_as_sequence_gen, /*tp_as_sequence*/
    &__pyx_tp_as_mapping_gen, /*tp_as_mapping*/
    __pyx_pw_10cypari_src_3gen_3gen_9__hash__, /*tp_hash*/
    __pyx_pw_10cypari_src_3gen_3gen_569__call__, /*tp_call*/
    0, /*tp_str*/
    0, /*tp_getattro*/
    0, /*tp_setattro*/
    0, /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
    "\n    Python extension class that models the PARI GEN type.\n    ", /*tp_doc*/
    __pyx_tp_traverse_10cypari_src_3gen_gen, /*tp_traverse*/
    __pyx_tp_clear_10cypari_src_3gen_gen, /*tp_clear*/
    __pyx_pw_10cypari_src_3gen_3gen_81__richcmp__, /*tp_richcompare*/
    0, /*tp_weaklistoffset*/
    0, /*tp_iter*/
    0, /*tp_iternext*/
    __pyx_methods_10cypari_src_3gen_gen, /*tp_methods*/
    0, /*tp_members*/
    0, /*tp_getset*/
    0, /*tp_base*/
    0, /*tp_dict*/
    0, /*tp_descr_get*/
    0, /*tp_descr_set*/
    0, /*tp_dictoffset*/
    __pyx_pw_10cypari_src_3gen_3gen_1__init__, /*tp_init*/
    0, /*tp_alloc*/
    __pyx_tp_new_10cypari_src_3gen_gen, /*tp_new*/
    0, /*tp_free*/
    0, /*tp_is_gc*/
    0, /*tp_bases*/
    0, /*tp_mro*/
    0, /*tp_cache*/
    0, /*tp_subclasses*/
    0, /*tp_weaklist*/
    0, /*tp_del*/
    0, /*tp_version_tag*/
    #if PY_VERSION_HEX >= 0x030400a1
    0, /*tp_finalize*/
    #endif
  };
  static struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance __pyx_vtable_10cypari_src_3gen_PariInstance;

  static PyObject *__pyx_tp_new_10cypari_src_3gen_PariInstance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
    struct __pyx_obj_10cypari_src_3gen_PariInstance *p;
    PyObject *o;
    if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
      o = (*t->tp_alloc)(t, 0);
    } else {
      o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
    }
    if (unlikely(!o)) return 0;
    p = ((struct __pyx_obj_10cypari_src_3gen_PariInstance *)o);
    p->__pyx_vtab = __pyx_vtabptr_10cypari_src_3gen_PariInstance;
    p->UI_callback = Py_None; Py_INCREF(Py_None);
    p->PARI_ZERO = ((struct __pyx_obj_10cypari_src_3gen_gen *)Py_None); Py_INCREF(Py_None);
    p->PARI_ONE = ((struct __pyx_obj_10cypari_src_3gen_gen *)Py_None); Py_INCREF(Py_None);
    p->PARI_TWO = ((struct __pyx_obj_10cypari_src_3gen_gen *)Py_None); Py_INCREF(Py_None);
    return o;
  }

  static void __pyx_tp_dealloc_10cypari_src_3gen_PariInstance(PyObject *o) {
    struct __pyx_obj_10cypari_src_3gen_PariInstance *p = (struct __pyx_obj_10cypari_src_3gen_PariInstance *)o;
    #if PY_VERSION_HEX >= 0x030400a1
    if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
    #endif
    PyObject_GC_UnTrack(o);
    Py_CLEAR(p->UI_callback);
    Py_CLEAR(p->PARI_ZERO);
    Py_CLEAR(p->PARI_ONE);
    Py_CLEAR(p->PARI_TWO);
    (*Py_TYPE(o)->tp_free)(o);
  }

  static int __pyx_tp_traverse_10cypari_src_3gen_PariInstance(PyObject *o, visitproc v, void *a) {
    int e;
    struct __pyx_obj_10cypari_src_3gen_PariInstance *p = (struct __pyx_obj_10cypari_src_3gen_PariInstance *)o;
    if (p->UI_callback) {
      e = (*v)(p->UI_callback, a); if (e) return e;
    }
    if (p->PARI_ZERO) {
      e = (*v)(((PyObject*)p->PARI_ZERO), a); if (e) return e;
    }
    if (p->PARI_ONE) {
      e = (*v)(((PyObject*)p->PARI_ONE), a); if (e) return e;
    }
    if (p->PARI_TWO) {
      e = (*v)(((PyObject*)p->PARI_TWO), a); if (e) return e;
    }
    return 0;
  }

  static int __pyx_tp_clear_10cypari_src_3gen_PariInstance(PyObject *o) {
    PyObject* tmp;
    struct __pyx_obj_10cypari_src_3gen_PariInstance *p = (struct __pyx_obj_10cypari_src_3gen_PariInstance *)o;
    tmp = ((PyObject*)p->UI_callback);
    p->UI_callback = Py_None; Py_INCREF(Py_None);
    Py_XDECREF(tmp);
    tmp = ((PyObject*)p->PARI_ZERO);
    p->PARI_ZERO = ((struct __pyx_obj_10cypari_src_3gen_gen *)Py_None); Py_INCREF(Py_None);
    Py_XDECREF(tmp);
    tmp = ((PyObject*)p->PARI_ONE);
    p->PARI_ONE = ((struct __pyx_obj_10cypari_src_3gen_gen *)Py_None); Py_INCREF(Py_None);
    Py_XDECREF(tmp);
    tmp = ((PyObject*)p->PARI_TWO);
    p->PARI_TWO = ((struct __pyx_obj_10cypari_src_3gen_gen *)Py_None); Py_INCREF(Py_None);
    Py_XDECREF(tmp);
    return 0;
  }

  static PyObject *__pyx_getprop_10cypari_src_3gen_12PariInstance_UI_callback(PyObject *o, CYTHON_UNUSED void *x) {
    return __pyx_pw_10cypari_src_3gen_12PariInstance_11UI_callback_1__get__(o);
  }

  static int __pyx_setprop_10cypari_src_3gen_12PariInstance_UI_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
    if (v) {
      return __pyx_pw_10cypari_src_3gen_12PariInstance_11UI_callback_3__set__(o, v);
    }
    else {
      return __pyx_pw_10cypari_src_3gen_12PariInstance_11UI_callback_5__del__(o);
    }
  }

  static PyMethodDef __pyx_methods_10cypari_src_3gen_PariInstance[] = {
    {"_unsafe_deallocate_pari_stack", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_3_unsafe_deallocate_pari_stack, METH_NOARGS, 0},
    {"abort", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_9abort, METH_NOARGS, __pyx_doc_10cypari_src_3gen_12PariInstance_8abort},
    {"_set_alarm_handler", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_11_set_alarm_handler, METH_O, __pyx_doc_10cypari_src_3gen_12PariInstance_10_set_alarm_handler},
    {"shut_up", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_13shut_up, METH_NOARGS, 0},
    {"speak_up", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_15speak_up, METH_NOARGS, 0},
    {"stack_info", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_17stack_info, METH_NOARGS, 0},
    {"exception_info", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_19exception_info, METH_NOARGS, 0},
    {"default", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_21default, METH_VARARGS|METH_KEYWORDS, 0},
    {"set_debug_level", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_23set_debug_level, METH_O, __pyx_doc_10cypari_src_3gen_12PariInstance_22set_debug_level},
    {"get_debug_level", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_25get_debug_level, METH_NOARGS, __pyx_doc_10cypari_src_3gen_12PariInstance_24get_debug_level},
    {"set_real_precision", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_27set_real_precision, METH_O, __pyx_doc_10cypari_src_3gen_12PariInstance_26set_real_precision},
    {"get_real_precision", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_29get_real_precision, METH_NOARGS, __pyx_doc_10cypari_src_3gen_12PariInstance_28get_real_precision},
    {"set_series_precision", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_31set_series_precision, METH_O, 0},
    {"get_series_precision", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_33get_series_precision, METH_NOARGS, 0},
    {"double_to_gen", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_35double_to_gen, METH_O, 0},
    {"_real_coerced_to_bits_prec", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_37_real_coerced_to_bits_prec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_36_real_coerced_to_bits_prec},
    {"complex", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_39complex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_38complex},
    {"new_with_bits_prec", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_43new_with_bits_prec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_42new_with_bits_prec},
    {"allocatemem", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_45allocatemem, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_44allocatemem},
    {"pari_version", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_47pari_version, METH_NOARGS, 0},
    {"init_primes", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_49init_primes, METH_O, __pyx_doc_10cypari_src_3gen_12PariInstance_48init_primes},
    {"read", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_51read, METH_O, __pyx_doc_10cypari_src_3gen_12PariInstance_50read},
    {"_primelimit", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_53_primelimit, METH_NOARGS, __pyx_doc_10cypari_src_3gen_12PariInstance_52_primelimit},
    {"prime_list", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_55prime_list, METH_O, __pyx_doc_10cypari_src_3gen_12PariInstance_54prime_list},
    {"primes_up_to_n", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_57primes_up_to_n, METH_O, __pyx_doc_10cypari_src_3gen_12PariInstance_56primes_up_to_n},
    {"__nth_prime", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_59__nth_prime, METH_O, __pyx_doc_10cypari_src_3gen_12PariInstance_58__nth_prime},
    {"nth_prime", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_61nth_prime, METH_O, 0},
    {"euler", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_63euler, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_62euler},
    {"pi", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_65pi, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_64pi},
    {"pollegendre", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_67pollegendre, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_66pollegendre},
    {"poltchebi", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_69poltchebi, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_68poltchebi},
    {"factorial", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_71factorial, METH_O, __pyx_doc_10cypari_src_3gen_12PariInstance_70factorial},
    {"polcyclo", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_73polcyclo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_72polcyclo},
    {"polsubcyclo", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_75polsubcyclo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_74polsubcyclo},
    {"polzagier", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_77polzagier, METH_VARARGS|METH_KEYWORDS, 0},
    {"setrand", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_79setrand, METH_O, __pyx_doc_10cypari_src_3gen_12PariInstance_78setrand},
    {"getrand", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_81getrand, METH_NOARGS, __pyx_doc_10cypari_src_3gen_12PariInstance_80getrand},
    {"vector", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_83vector, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_82vector},
    {"matrix", (PyCFunction)__pyx_pw_10cypari_src_3gen_12PariInstance_85matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_12PariInstance_84matrix},
    {0, 0, 0, 0}
  };

  static struct PyGetSetDef __pyx_getsets_10cypari_src_3gen_PariInstance[] = {
    {(char *)"UI_callback", __pyx_getprop_10cypari_src_3gen_12PariInstance_UI_callback, __pyx_setprop_10cypari_src_3gen_12PariInstance_UI_callback, 0, 0},
    {0, 0, 0, 0, 0}
  };

  static PyTypeObject __pyx_type_10cypari_src_3gen_PariInstance = {
    PyVarObject_HEAD_INIT(0, 0)
    "cypari_src.gen.PariInstance", /*tp_name*/
    sizeof(struct __pyx_obj_10cypari_src_3gen_PariInstance), /*tp_basicsize*/
    0, /*tp_itemsize*/
    __pyx_tp_dealloc_10cypari_src_3gen_PariInstance, /*tp_dealloc*/
    0, /*tp_print*/
    0, /*tp_getattr*/
    0, /*tp_setattr*/
    #if PY_MAJOR_VERSION < 3
    0, /*tp_compare*/
    #else
    0, /*reserved*/
    #endif
    __pyx_pw_10cypari_src_3gen_12PariInstance_5__repr__, /*tp_repr*/
    0, /*tp_as_number*/
    0, /*tp_as_sequence*/
    0, /*tp_as_mapping*/
    __pyx_pw_10cypari_src_3gen_12PariInstance_7__hash__, /*tp_hash*/
    __pyx_pw_10cypari_src_3gen_12PariInstance_41__call__, /*tp_call*/
    0, /*tp_str*/
    0, /*tp_getattro*/
    0, /*tp_setattro*/
    0, /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
    0, /*tp_doc*/
    __pyx_tp_traverse_10cypari_src_3gen_PariInstance, /*tp_traverse*/
    __pyx_tp_clear_10cypari_src_3gen_PariInstance, /*tp_clear*/
    0, /*tp_richcompare*/
    0, /*tp_weaklistoffset*/
    0, /*tp_iter*/
    0, /*tp_iternext*/
    __pyx_methods_10cypari_src_3gen_PariInstance, /*tp_methods*/
    0, /*tp_members*/
    __pyx_getsets_10cypari_src_3gen_PariInstance, /*tp_getset*/
    0, /*tp_base*/
    0, /*tp_dict*/
    0, /*tp_descr_get*/
    0, /*tp_descr_set*/
    0, /*tp_dictoffset*/
    __pyx_pw_10cypari_src_3gen_12PariInstance_1__init__, /*tp_init*/
    0, /*tp_alloc*/
    __pyx_tp_new_10cypari_src_3gen_PariInstance, /*tp_new*/
    0, /*tp_free*/
    0, /*tp_is_gc*/
    0, /*tp_bases*/
    0, /*tp_mro*/
    0, /*tp_cache*/
    0, /*tp_subclasses*/
    0, /*tp_weaklist*/
    0, /*tp_del*/
    0, /*tp_version_tag*/
    #if PY_VERSION_HEX >= 0x030400a1
    0, /*tp_finalize*/
    #endif
  };

  static PyMethodDef __pyx_methods[] = {
    {"prec_bits_to_dec", (PyCFunction)__pyx_pw_10cypari_src_3gen_1prec_bits_to_dec, METH_O, __pyx_doc_10cypari_src_3gen_prec_bits_to_dec},
    {"prec_dec_to_bits", (PyCFunction)__pyx_pw_10cypari_src_3gen_3prec_dec_to_bits, METH_O, __pyx_doc_10cypari_src_3gen_2prec_dec_to_bits},
    {"prec_bits_to_words", (PyCFunction)__pyx_pw_10cypari_src_3gen_5prec_bits_to_words, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10cypari_src_3gen_4prec_bits_to_words},
    {"prec_words_to_bits", (PyCFunction)__pyx_pw_10cypari_src_3gen_7prec_words_to_bits, METH_O, __pyx_doc_10cypari_src_3gen_6prec_words_to_bits},
    {"prec_dec_to_words", (PyCFunction)__pyx_pw_10cypari_src_3gen_9prec_dec_to_words, METH_O, __pyx_doc_10cypari_src_3gen_8prec_dec_to_words},
    {"prec_words_to_dec", (PyCFunction)__pyx_pw_10cypari_src_3gen_11prec_words_to_dec, METH_O, __pyx_doc_10cypari_src_3gen_10prec_words_to_dec},
    {0, 0, 0, 0}
  };

  #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
      "gen",
      __pyx_k_PARI_C_library_interface_AUTHOR, /* 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_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
  {&__pyx_kp_s_0x, __pyx_k_0x, sizeof(__pyx_k_0x), 0, 0, 1, 0},
  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
  {&__pyx_kp_u_A_mathnf_flag_0_upper_triangula, __pyx_k_A_mathnf_flag_0_upper_triangula, sizeof(__pyx_k_A_mathnf_flag_0_upper_triangula), 0, 1, 0, 0},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
  {&__pyx_kp_s_BIG_WARNING_The_number_s_wasn_t, __pyx_k_BIG_WARNING_The_number_s_wasn_t, sizeof(__pyx_k_BIG_WARNING_The_number_s_wasn_t), 0, 0, 1, 0},
  {&__pyx_kp_u_Bessel_I_function_Bessel_functi, __pyx_k_Bessel_I_function_Bessel_functi, sizeof(__pyx_k_Bessel_I_function_Bessel_functi), 0, 1, 0, 0},
  {&__pyx_kp_u_Bessel_J_function_Bessel_functi, __pyx_k_Bessel_J_function_Bessel_functi, sizeof(__pyx_k_Bessel_J_function_Bessel_functi), 0, 1, 0, 0},
  {&__pyx_kp_u_Check_whether_a_and_b_are_equal, __pyx_k_Check_whether_a_and_b_are_equal, sizeof(__pyx_k_Check_whether_a_and_b_are_equal), 0, 1, 0, 0},
  {&__pyx_kp_u_Check_whether_a_is_equal_to_the, __pyx_k_Check_whether_a_is_equal_to_the, sizeof(__pyx_k_Check_whether_a_is_equal_to_the), 0, 1, 0, 0},
  {&__pyx_kp_u_Check_whether_a_is_equal_to_zer, __pyx_k_Check_whether_a_is_equal_to_zer, sizeof(__pyx_k_Check_whether_a_is_equal_to_zer), 0, 1, 0, 0},
  {&__pyx_kp_u_Computes_the_Hurwitz_Kronecker, __pyx_k_Computes_the_Hurwitz_Kronecker, sizeof(__pyx_k_Computes_the_Hurwitz_Kronecker), 0, 1, 0, 0},
  {&__pyx_kp_u_Convert_from_pari_real_precisio, __pyx_k_Convert_from_pari_real_precisio, sizeof(__pyx_k_Convert_from_pari_real_precisio), 0, 1, 0, 0},
  {&__pyx_kp_u_Convert_from_precision_expresse, __pyx_k_Convert_from_precision_expresse, sizeof(__pyx_k_Convert_from_precision_expresse), 0, 1, 0, 0},
  {&__pyx_kp_u_Convert_from_precision_expresse_2, __pyx_k_Convert_from_precision_expresse_2, sizeof(__pyx_k_Convert_from_precision_expresse_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Convert_from_precision_expresse_3, __pyx_k_Convert_from_precision_expresse_3, sizeof(__pyx_k_Convert_from_precision_expresse_3), 0, 1, 0, 0},
  {&__pyx_kp_u_Convert_from_precision_expresse_4, __pyx_k_Convert_from_precision_expresse_4, sizeof(__pyx_k_Convert_from_precision_expresse_4), 0, 1, 0, 0},
  {&__pyx_kp_u_Convert_from_precision_expresse_5, __pyx_k_Convert_from_precision_expresse_5, sizeof(__pyx_k_Convert_from_precision_expresse_5), 0, 1, 0, 0},
  {&__pyx_kp_u_Convert_self_to_a_list_of_PARI, __pyx_k_Convert_self_to_a_list_of_PARI, sizeof(__pyx_k_Convert_self_to_a_list_of_PARI), 0, 1, 0, 0},
  {&__pyx_kp_u_Create_the_PARI_object_obtained, __pyx_k_Create_the_PARI_object_obtained, sizeof(__pyx_k_Create_the_PARI_object_obtained), 0, 1, 0, 0},
  {&__pyx_kp_u_Creates_a_PARI_t_REAL_with_valu, __pyx_k_Creates_a_PARI_t_REAL_with_valu, sizeof(__pyx_k_Creates_a_PARI_t_REAL_with_valu), 0, 1, 0, 0},
  {&__pyx_kp_u_Creates_a_vector_containing_as, __pyx_k_Creates_a_vector_containing_as, sizeof(__pyx_k_Creates_a_vector_containing_as), 0, 1, 0, 0},
  {&__pyx_kp_s_Current_error_number_d, __pyx_k_Current_error_number_d, sizeof(__pyx_k_Current_error_number_d), 0, 0, 1, 0},
  {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1},
  {&__pyx_kp_u_Determine_whether_or_not_self_i, __pyx_k_Determine_whether_or_not_self_i, sizeof(__pyx_k_Determine_whether_or_not_self_i), 0, 1, 0, 0},
  {&__pyx_kp_s_Doubling_the_PARI_stack, __pyx_k_Doubling_the_PARI_stack, sizeof(__pyx_k_Doubling_the_PARI_stack), 0, 0, 1, 0},
  {&__pyx_kp_u_EXAMPLES_We_construct_a_relativ, __pyx_k_EXAMPLES_We_construct_a_relativ, sizeof(__pyx_k_EXAMPLES_We_construct_a_relativ), 0, 1, 0, 0},
  {&__pyx_kp_u_EXAMPLES_f_pari_x_2_y_3_x_y_f_x, __pyx_k_EXAMPLES_f_pari_x_2_y_3_x_y_f_x, sizeof(__pyx_k_EXAMPLES_f_pari_x_2_y_3_x_y_f_x), 0, 1, 0, 0},
  {&__pyx_kp_u_EXAMPLES_n_pari_set_real_precis, __pyx_k_EXAMPLES_n_pari_set_real_precis, sizeof(__pyx_k_EXAMPLES_n_pari_set_real_precis), 0, 1, 0, 0},
  {&__pyx_kp_u_EXAMPLES_pari_10_issquarefree_T, __pyx_k_EXAMPLES_pari_10_issquarefree_T, sizeof(__pyx_k_EXAMPLES_pari_10_issquarefree_T), 0, 1, 0, 0},
  {&__pyx_kp_u_Edited_from_the_pari_documentat, __pyx_k_Edited_from_the_pari_documentat, sizeof(__pyx_k_Edited_from_the_pari_documentat), 0, 1, 0, 0},
  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  {&__pyx_kp_u_Factorization_of_the_polynomial, __pyx_k_Factorization_of_the_polynomial, sizeof(__pyx_k_Factorization_of_the_polynomial), 0, 1, 0, 0},
  {&__pyx_kp_u_For_real_x_return_the_largest_i, __pyx_k_For_real_x_return_the_largest_i, sizeof(__pyx_k_For_real_x_return_the_largest_i), 0, 1, 0, 0},
  {&__pyx_kp_u_For_real_x_return_the_smallest, __pyx_k_For_real_x_return_the_smallest, sizeof(__pyx_k_For_real_x_return_the_smallest), 0, 1, 0, 0},
  {&__pyx_n_s_GeneratorType, __pyx_k_GeneratorType, sizeof(__pyx_k_GeneratorType), 0, 0, 1, 1},
  {&__pyx_kp_u_Given_a_PARI_number_field_self, __pyx_k_Given_a_PARI_number_field_self, sizeof(__pyx_k_Given_a_PARI_number_field_self), 0, 1, 0, 0},
  {&__pyx_kp_u_Given_an_INTMOD_or_POLMOD_Mod_a, __pyx_k_Given_an_INTMOD_or_POLMOD_Mod_a, sizeof(__pyx_k_Given_an_INTMOD_or_POLMOD_Mod_a), 0, 1, 0, 0},
  {&__pyx_kp_u_Given_an_ideal_I_in_Hermite_nor, __pyx_k_Given_an_ideal_I_in_Hermite_nor, sizeof(__pyx_k_Given_an_ideal_I_in_Hermite_nor), 0, 1, 0, 0},
  {&__pyx_kp_u_Given_two_integral_ideals_x_and, __pyx_k_Given_two_integral_ideals_x_and, sizeof(__pyx_k_Given_two_integral_ideals_x_and), 0, 1, 0, 0},
  {&__pyx_kp_u_Greatest_common_divisor_of_all, __pyx_k_Greatest_common_divisor_of_all, sizeof(__pyx_k_Greatest_common_divisor_of_all), 0, 1, 0, 0},
  {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_u_In_self_replace_the_variable_va, __pyx_k_In_self_replace_the_variable_va, sizeof(__pyx_k_In_self_replace_the_variable_va), 0, 1, 0, 0},
  {&__pyx_kp_u_In_self_which_must_be_a_t_POL_o, __pyx_k_In_self_which_must_be_a_t_POL_o, sizeof(__pyx_k_In_self_which_must_be_a_t_POL_o), 0, 1, 0, 0},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_s_Interface_to_the_PARI_C_library, __pyx_k_Interface_to_the_PARI_C_library, sizeof(__pyx_k_Interface_to_the_PARI_C_library), 0, 0, 1, 0},
  {&__pyx_kp_u_J_Bessel_function_of_half_integ, __pyx_k_J_Bessel_function_of_half_integ, sizeof(__pyx_k_J_Bessel_function_of_half_integ), 0, 1, 0, 0},
  {&__pyx_kp_u_List_x_transforms_the_PARI_vect, __pyx_k_List_x_transforms_the_PARI_vect, sizeof(__pyx_k_List_x_transforms_the_PARI_vect), 0, 1, 0, 0},
  {&__pyx_kp_u_Logarithm_of_the_gamma_function, __pyx_k_Logarithm_of_the_gamma_function, sizeof(__pyx_k_Logarithm_of_the_gamma_function), 0, 1, 0, 0},
  {&__pyx_kp_u_M_matfrobenius_flag_0_Return_th, __pyx_k_M_matfrobenius_flag_0_Return_th, sizeof(__pyx_k_M_matfrobenius_flag_0_Return_th), 0, 1, 0, 0},
  {&__pyx_kp_s_Mat, __pyx_k_Mat, sizeof(__pyx_k_Mat), 0, 0, 1, 0},
  {&__pyx_n_s_Mat_2, __pyx_k_Mat_2, sizeof(__pyx_k_Mat_2), 0, 0, 1, 1},
  {&__pyx_kp_u_Mat_x_Returns_the_matrix_define, __pyx_k_Mat_x_Returns_the_matrix_define, sizeof(__pyx_k_Mat_x_Returns_the_matrix_define), 0, 1, 0, 0},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_n_s_Mod, __pyx_k_Mod, sizeof(__pyx_k_Mod), 0, 0, 1, 1},
  {&__pyx_kp_u_Mod_x_y_Returns_the_object_x_mo, __pyx_k_Mod_x_y_Returns_the_object_x_mo, sizeof(__pyx_k_Mod_x_y_Returns_the_object_x_mo), 0, 1, 0, 0},
  {&__pyx_kp_s_Not_a_PARI_number_field, __pyx_k_Not_a_PARI_number_field, sizeof(__pyx_k_Not_a_PARI_number_field), 0, 0, 1, 0},
  {&__pyx_kp_s_Not_an_INTMOD_or_POLMOD_in_mod, __pyx_k_Not_an_INTMOD_or_POLMOD_in_mod, sizeof(__pyx_k_Not_an_INTMOD_or_POLMOD_in_mod), 0, 0, 1, 0},
  {&__pyx_kp_s_Object_s_must_be_of_type_t_VEC, __pyx_k_Object_s_must_be_of_type_t_VEC, sizeof(__pyx_k_Object_s_must_be_of_type_t_VEC), 0, 0, 1, 0},
  {&__pyx_kp_s_Object_s_must_be_of_type_t_VECSM, __pyx_k_Object_s_must_be_of_type_t_VECSM, sizeof(__pyx_k_Object_s_must_be_of_type_t_VECSM), 0, 0, 1, 0},
  {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
  {&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1},
  {&__pyx_kp_s_PARI_stack_size_d, __pyx_k_PARI_stack_size_d, sizeof(__pyx_k_PARI_stack_size_d), 0, 0, 1, 0},
  {&__pyx_kp_s_PARI_user_exception, __pyx_k_PARI_user_exception, sizeof(__pyx_k_PARI_user_exception), 0, 0, 1, 0},
  {&__pyx_kp_s_PARI_was_interrupted, __pyx_k_PARI_was_interrupted, sizeof(__pyx_k_PARI_was_interrupted), 0, 0, 1, 0},
  {&__pyx_n_s_PariError, __pyx_k_PariError, sizeof(__pyx_k_PariError), 0, 0, 1, 1},
  {&__pyx_n_s_PariError___repr, __pyx_k_PariError___repr, sizeof(__pyx_k_PariError___repr), 0, 0, 1, 1},
  {&__pyx_kp_u_PariError___repr___line_10114, __pyx_k_PariError___repr___line_10114, sizeof(__pyx_k_PariError___repr___line_10114), 0, 1, 0, 0},
  {&__pyx_n_s_PariError___str, __pyx_k_PariError___str, sizeof(__pyx_k_PariError___str), 0, 0, 1, 1},
  {&__pyx_kp_s_PariError_d, __pyx_k_PariError_d, sizeof(__pyx_k_PariError_d), 0, 0, 1, 0},
  {&__pyx_n_s_PariError_errmessage, __pyx_k_PariError_errmessage, sizeof(__pyx_k_PariError_errmessage), 0, 0, 1, 1},
  {&__pyx_n_s_PariError_errnum, __pyx_k_PariError_errnum, sizeof(__pyx_k_PariError_errnum), 0, 0, 1, 1},
  {&__pyx_n_s_PariError_set_errnum, __pyx_k_PariError_set_errnum, sizeof(__pyx_k_PariError_set_errnum), 0, 0, 1, 1},
  {&__pyx_kp_u_PariInstance___call___line_9300, __pyx_k_PariInstance___call___line_9300, sizeof(__pyx_k_PariInstance___call___line_9300), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance__primelimit_line_94, __pyx_k_PariInstance__primelimit_line_94, sizeof(__pyx_k_PariInstance__primelimit_line_94), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance__real_coerced_to_bi, __pyx_k_PariInstance__real_coerced_to_bi, sizeof(__pyx_k_PariInstance__real_coerced_to_bi), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_euler_line_9590, __pyx_k_PariInstance_euler_line_9590, sizeof(__pyx_k_PariInstance_euler_line_9590), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_factorial_line_9659, __pyx_k_PariInstance_factorial_line_9659, sizeof(__pyx_k_PariInstance_factorial_line_9659), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_getrand_line_9765, __pyx_k_PariInstance_getrand_line_9765, sizeof(__pyx_k_PariInstance_getrand_line_9765), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_init_primes_line_94, __pyx_k_PariInstance_init_primes_line_94, sizeof(__pyx_k_PariInstance_init_primes_line_94), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_pi_line_9607, __pyx_k_PariInstance_pi_line_9607, sizeof(__pyx_k_PariInstance_pi_line_9607), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_polcyclo_line_9677, __pyx_k_PariInstance_polcyclo_line_9677, sizeof(__pyx_k_PariInstance_polcyclo_line_9677), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_pollegendre_line_96, __pyx_k_PariInstance_pollegendre_line_96, sizeof(__pyx_k_PariInstance_pollegendre_line_96), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_polsubcyclo_line_96, __pyx_k_PariInstance_polsubcyclo_line_96, sizeof(__pyx_k_PariInstance_polsubcyclo_line_96), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_poltchebi_line_9642, __pyx_k_PariInstance_poltchebi_line_9642, sizeof(__pyx_k_PariInstance_poltchebi_line_9642), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_prime_list_line_950, __pyx_k_PariInstance_prime_list_line_950, sizeof(__pyx_k_PariInstance_prime_list_line_950), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_primes_up_to_n_line, __pyx_k_PariInstance_primes_up_to_n_line, sizeof(__pyx_k_PariInstance_primes_up_to_n_line), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_read_line_9455, __pyx_k_PariInstance_read_line_9455, sizeof(__pyx_k_PariInstance_read_line_9455), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_setrand_line_9725, __pyx_k_PariInstance_setrand_line_9725, sizeof(__pyx_k_PariInstance_setrand_line_9725), 0, 1, 0, 0},
  {&__pyx_kp_u_PariInstance_vector_line_9785, __pyx_k_PariInstance_vector_line_9785, sizeof(__pyx_k_PariInstance_vector_line_9785), 0, 1, 0, 0},
  {&__pyx_kp_u_Pol_x_v_convert_x_into_a_polyno, __pyx_k_Pol_x_v_convert_x_into_a_polyno, sizeof(__pyx_k_Pol_x_v_convert_x_into_a_polyno), 0, 1, 0, 0},
  {&__pyx_n_s_Polrev, __pyx_k_Polrev, sizeof(__pyx_k_Polrev), 0, 0, 1, 1},
  {&__pyx_kp_u_Polrev_x_v_Convert_x_into_a_pol, __pyx_k_Polrev_x_v_Convert_x_into_a_pol, sizeof(__pyx_k_Polrev_x_v_Convert_x_into_a_pol), 0, 1, 0, 0},
  {&__pyx_kp_u_Prime_ideal_decomposition_of_th, __pyx_k_Prime_ideal_decomposition_of_th, sizeof(__pyx_k_Prime_ideal_decomposition_of_th), 0, 1, 0, 0},
  {&__pyx_kp_u_Qfb_a_b_c_D_0_Returns_the_binar, __pyx_k_Qfb_a_b_c_D_0_Returns_the_binar, sizeof(__pyx_k_Qfb_a_b_c_D_0_Returns_the_binar), 0, 1, 0, 0},
  {&__pyx_kp_u_Read_a_script_from_the_named_fi, __pyx_k_Read_a_script_from_the_named_fi, sizeof(__pyx_k_Read_a_script_from_the_named_fi), 0, 1, 0, 0},
  {&__pyx_kp_u_Recompute_the_primes_table_incl, __pyx_k_Recompute_the_primes_table_incl, sizeof(__pyx_k_Recompute_the_primes_table_incl), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_Euler_s_constant_to_the, __pyx_k_Return_Euler_s_constant_to_the, sizeof(__pyx_k_Return_Euler_s_constant_to_the), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_Python_int_Very_fast_and, __pyx_k_Return_Python_int_Very_fast_and, sizeof(__pyx_k_Return_Python_int_Very_fast_and), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_a_Python_list_of_the_PAR, __pyx_k_Return_a_Python_list_of_the_PAR, sizeof(__pyx_k_Return_a_Python_list_of_the_PAR), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_a_Python_list_of_the_PAR_2, __pyx_k_Return_a_Python_list_of_the_PAR_2, sizeof(__pyx_k_Return_a_Python_list_of_the_PAR_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_a_basis_of_the_kernel_of, __pyx_k_Return_a_basis_of_the_kernel_of, sizeof(__pyx_k_Return_a_basis_of_the_kernel_of), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_a_primitive_root_modulo, __pyx_k_Return_a_primitive_root_modulo, sizeof(__pyx_k_Return_a_primitive_root_modulo), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_a_python_integer_represe, __pyx_k_Return_a_python_integer_represe, sizeof(__pyx_k_Return_a_python_integer_represe), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_a_string_containing_the, __pyx_k_Return_a_string_containing_the, sizeof(__pyx_k_Return_a_string_containing_the), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_self_1_OUTPUT_pari_gen_E, __pyx_k_Return_self_1_OUTPUT_pari_gen_E, sizeof(__pyx_k_Return_self_1_OUTPUT_pari_gen_E), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_self_as_a_Python_complex, __pyx_k_Return_self_as_a_Python_complex, sizeof(__pyx_k_Return_self_as_a_Python_complex), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_Euler_phi_function_o, __pyx_k_Return_the_Euler_phi_function_o, sizeof(__pyx_k_Return_the_Euler_phi_function_o), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_Fibonacci_number_of, __pyx_k_Return_the_Fibonacci_number_of, sizeof(__pyx_k_Return_the_Fibonacci_number_of), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_PARI_elliptic_curve, __pyx_k_Return_the_PARI_elliptic_curve, sizeof(__pyx_k_Return_the_PARI_elliptic_curve), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_PARI_type_of_self_as, __pyx_k_Return_the_PARI_type_of_self_as, sizeof(__pyx_k_Return_the_PARI_type_of_self_as), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_big_ideal_bid_struct, __pyx_k_Return_the_big_ideal_bid_struct, sizeof(__pyx_k_Return_the_big_ideal_bid_struct), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_complementary_error, __pyx_k_Return_the_complementary_error, sizeof(__pyx_k_Return_the_complementary_error), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_determinant_of_this, __pyx_k_Return_the_determinant_of_this, sizeof(__pyx_k_Return_the_determinant_of_this), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_discrete_logarithm_o, __pyx_k_Return_the_discrete_logarithm_o, sizeof(__pyx_k_Return_the_discrete_logarithm_o), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_factorial_of_the_int, __pyx_k_Return_the_factorial_of_the_int, sizeof(__pyx_k_Return_the_factorial_of_the_int), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_factorization_of_x_I, __pyx_k_Return_the_factorization_of_x_I, sizeof(__pyx_k_Return_the_factorization_of_x_I), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_first_n_Fourier_coef, __pyx_k_Return_the_first_n_Fourier_coef, sizeof(__pyx_k_Return_the_first_n_Fourier_coef), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_hash_of_self_compute, __pyx_k_Return_the_hash_of_self_compute, sizeof(__pyx_k_Return_the_hash_of_self_compute), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_integer_kernel_of_a, __pyx_k_Return_the_integer_kernel_of_a, sizeof(__pyx_k_Return_the_integer_kernel_of_a), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_least_common_multipl, __pyx_k_Return_the_least_common_multipl, sizeof(__pyx_k_Return_the_least_common_multipl), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_length_of_self_as_a, __pyx_k_Return_the_length_of_self_as_a, sizeof(__pyx_k_Return_the_length_of_self_as_a), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_nth_entry_of_self_Th, __pyx_k_Return_the_nth_entry_of_self_Th, sizeof(__pyx_k_Return_the_nth_entry_of_self_Th), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_number_of_columns_of, __pyx_k_Return_the_number_of_columns_of, sizeof(__pyx_k_Return_the_number_of_columns_of), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_number_of_divisors_o, __pyx_k_Return_the_number_of_divisors_o, sizeof(__pyx_k_Return_the_number_of_divisors_o), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_number_of_primes_alr, __pyx_k_Return_the_number_of_primes_alr, sizeof(__pyx_k_Return_the_number_of_primes_alr), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_number_of_primes_les, __pyx_k_Return_the_number_of_primes_les, sizeof(__pyx_k_Return_the_number_of_primes_les), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_number_of_rows_of_se, __pyx_k_Return_the_number_of_rows_of_se, sizeof(__pyx_k_Return_the_number_of_rows_of_se), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_primes_n_as_a_pari_l, __pyx_k_Return_the_primes_n_as_a_pari_l, sizeof(__pyx_k_Return_the_primes_n_as_a_pari_l), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_roots_of_poly_in_the, __pyx_k_Return_the_roots_of_poly_in_the, sizeof(__pyx_k_Return_the_roots_of_poly_in_the), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_sum_of_the_divisors, __pyx_k_Return_the_sum_of_the_divisors, sizeof(__pyx_k_Return_the_sum_of_the_divisors), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_sum_of_the_k_th_powe, __pyx_k_Return_the_sum_of_the_k_th_powe, sizeof(__pyx_k_Return_the_sum_of_the_k_th_powe), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_total_number_of_byte, __pyx_k_Return_the_total_number_of_byte, sizeof(__pyx_k_Return_the_total_number_of_byte), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_total_number_of_mach, __pyx_k_Return_the_total_number_of_mach, sizeof(__pyx_k_Return_the_total_number_of_mach), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_trace_of_this_PARI_o, __pyx_k_Return_the_trace_of_this_PARI_o, sizeof(__pyx_k_Return_the_trace_of_this_PARI_o), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_valuation_of_x_where, __pyx_k_Return_the_valuation_of_x_where, sizeof(__pyx_k_Return_the_valuation_of_x_where), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_value_of_the_constan, __pyx_k_Return_the_value_of_the_constan, sizeof(__pyx_k_Return_the_value_of_the_constan), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_value_or_the_series, __pyx_k_Return_the_value_or_the_series, sizeof(__pyx_k_Return_the_value_or_the_series), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_PARI_s_current_random_n, __pyx_k_Returns_PARI_s_current_random_n, sizeof(__pyx_k_Returns_PARI_s_current_random_n), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_Python_int_list_form_of, __pyx_k_Returns_Python_int_list_form_of, sizeof(__pyx_k_Returns_Python_int_list_form_of), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_2_component_vector_wi, __pyx_k_Returns_a_2_component_vector_wi, sizeof(__pyx_k_Returns_a_2_component_vector_wi), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_Python_list_r1_r2_whe, __pyx_k_Returns_a_Python_list_r1_r2_whe, sizeof(__pyx_k_Returns_a_Python_list_r1_r2_whe), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_polynomial_over_QQ_wh, __pyx_k_Returns_a_polynomial_over_QQ_wh, sizeof(__pyx_k_Returns_a_polynomial_over_QQ_wh), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_vector_of_generators, __pyx_k_Returns_a_vector_of_generators, sizeof(__pyx_k_Returns_a_vector_of_generators), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_vector_of_generators_2, __pyx_k_Returns_a_vector_of_generators_2, sizeof(__pyx_k_Returns_a_vector_of_generators_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_vector_with_a_ZZ_basi, __pyx_k_Returns_a_vector_with_a_ZZ_basi, sizeof(__pyx_k_Returns_a_vector_with_a_ZZ_basi), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_Hermite_Normal_Form, __pyx_k_Returns_the_Hermite_Normal_Form, sizeof(__pyx_k_Returns_the_Hermite_Normal_Form), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_Hermite_normal_form, __pyx_k_Returns_the_Hermite_normal_form, sizeof(__pyx_k_Returns_the_Hermite_normal_form), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_absolute_value_of_x, __pyx_k_Returns_the_absolute_value_of_x, sizeof(__pyx_k_Returns_the_absolute_value_of_x), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_class_number_of_sel, __pyx_k_Returns_the_class_number_of_sel, sizeof(__pyx_k_Returns_the_class_number_of_sel), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_defining_polynomial, __pyx_k_Returns_the_defining_polynomial, sizeof(__pyx_k_Returns_the_defining_polynomial), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_different_of_this_n, __pyx_k_Returns_the_different_of_this_n, sizeof(__pyx_k_Returns_the_different_of_this_n), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_prime_of_ZZ_lying_b, __pyx_k_Returns_the_prime_of_ZZ_lying_b, sizeof(__pyx_k_Returns_the_prime_of_ZZ_lying_b), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_ramification_index, __pyx_k_Returns_the_ramification_index, sizeof(__pyx_k_Returns_the_ramification_index), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_regulator_of_this_n, __pyx_k_Returns_the_regulator_of_this_n, sizeof(__pyx_k_Returns_the_regulator_of_this_n), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_residue_class_degre, __pyx_k_Returns_the_residue_class_degre, sizeof(__pyx_k_Returns_the_residue_class_degre), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_second_generator_of, __pyx_k_Returns_the_second_generator_of, sizeof(__pyx_k_Returns_the_second_generator_of), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_structure_of_the_cl, __pyx_k_Returns_the_structure_of_the_cl, sizeof(__pyx_k_Returns_the_structure_of_the_cl), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_the_structure_of_the_gr, __pyx_k_Returns_the_structure_of_the_gr, sizeof(__pyx_k_Returns_the_structure_of_the_gr), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_u_v_d_such_that_d_gcd_x, __pyx_k_Returns_u_v_d_such_that_d_gcd_x, sizeof(__pyx_k_Returns_u_v_d_such_that_d_gcd_x), 0, 1, 0, 0},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1},
  {&__pyx_n_s_SIGINT, __pyx_k_SIGINT, sizeof(__pyx_k_SIGINT), 0, 0, 1, 1},
  {&__pyx_kp_u_Ser_x_v_x_Create_a_power_series, __pyx_k_Ser_x_v_x_Create_a_power_series, sizeof(__pyx_k_Ser_x_v_x_Create_a_power_series), 0, 1, 0, 0},
  {&__pyx_kp_u_Set_the_nth_entry_to_a_referenc, __pyx_k_Set_the_nth_entry_to_a_referenc, sizeof(__pyx_k_Set_the_nth_entry_to_a_referenc), 0, 1, 0, 0},
  {&__pyx_kp_u_Set_x_convert_x_into_a_set_i_e, __pyx_k_Set_x_convert_x_into_a_set_i_e, sizeof(__pyx_k_Set_x_convert_x_into_a_set_i_e), 0, 1, 0, 0},
  {&__pyx_kp_s_Setjmp_enabled_d, __pyx_k_Setjmp_enabled_d, sizeof(__pyx_k_Setjmp_enabled_d), 0, 0, 1, 0},
  {&__pyx_kp_u_Sets_PARI_s_current_random_numb, __pyx_k_Sets_PARI_s_current_random_numb, sizeof(__pyx_k_Sets_PARI_s_current_random_numb), 0, 1, 0, 0},
  {&__pyx_kp_u_Show_the_internal_structure_of, __pyx_k_Show_the_internal_structure_of, sizeof(__pyx_k_Show_the_internal_structure_of), 0, 1, 0, 0},
  {&__pyx_kp_u_Str_self_Return_the_print_repre, __pyx_k_Str_self_Return_the_print_repre, sizeof(__pyx_k_Str_self_Return_the_print_repre), 0, 1, 0, 0},
  {&__pyx_kp_u_Strchr_x_converts_x_to_a_string, __pyx_k_Strchr_x_converts_x_to_a_string, sizeof(__pyx_k_Strchr_x_converts_x_to_a_string), 0, 1, 0, 0},
  {&__pyx_n_s_Strtex, __pyx_k_Strtex, sizeof(__pyx_k_Strtex), 0, 0, 1, 1},
  {&__pyx_kp_u_Strtex_x_Translates_the_vector, __pyx_k_Strtex_x_Translates_the_vector, sizeof(__pyx_k_Strtex_x_Translates_the_vector), 0, 1, 0, 0},
  {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
  {&__pyx_kp_u_TESTS_PariError_11_PariError_11, __pyx_k_TESTS_PariError_11_PariError_11, sizeof(__pyx_k_TESTS_PariError_11_PariError_11), 0, 1, 0, 0},
  {&__pyx_kp_u_The_Bernoulli_number_B_x_as_for, __pyx_k_The_Bernoulli_number_B_x_as_for, sizeof(__pyx_k_The_Bernoulli_number_B_x_as_for), 0, 1, 0, 0},
  {&__pyx_kp_u_The_Bernoulli_number_B_x_where, __pyx_k_The_Bernoulli_number_B_x_where, sizeof(__pyx_k_The_Bernoulli_number_B_x_where), 0, 1, 0, 0},
  {&__pyx_kp_u_The_H_1_Bessel_function_of_inde, __pyx_k_The_H_1_Bessel_function_of_inde, sizeof(__pyx_k_The_H_1_Bessel_function_of_inde), 0, 1, 0, 0},
  {&__pyx_kp_u_The_H_2_Bessel_function_of_inde, __pyx_k_The_H_2_Bessel_function_of_inde, sizeof(__pyx_k_The_H_2_Bessel_function_of_inde), 0, 1, 0, 0},
  {&__pyx_kp_u_The_arithmetic_geometric_mean_o, __pyx_k_The_arithmetic_geometric_mean_o, sizeof(__pyx_k_The_arithmetic_geometric_mean_o), 0, 1, 0, 0},
  {&__pyx_kp_u_The_cosine_function_If_x_is_an, __pyx_k_The_cosine_function_If_x_is_an, sizeof(__pyx_k_The_cosine_function_If_x_is_an), 0, 1, 0, 0},
  {&__pyx_kp_u_The_cotangent_of_x_If_x_is_an_e, __pyx_k_The_cotangent_of_x_If_x_is_an_e, sizeof(__pyx_k_The_cotangent_of_x_If_x_is_an_e), 0, 1, 0, 0},
  {&__pyx_kp_u_The_hyperbolic_cosine_function, __pyx_k_The_hyperbolic_cosine_function, sizeof(__pyx_k_The_hyperbolic_cosine_function), 0, 1, 0, 0},
  {&__pyx_kp_u_The_hyperbolic_sine_function_If, __pyx_k_The_hyperbolic_sine_function_If, sizeof(__pyx_k_The_hyperbolic_sine_function_If), 0, 1, 0, 0},
  {&__pyx_kp_u_The_principal_branch_of_cos_1_x, __pyx_k_The_principal_branch_of_cos_1_x, sizeof(__pyx_k_The_principal_branch_of_cos_1_x), 0, 1, 0, 0},
  {&__pyx_kp_u_The_principal_branch_of_cosh_1, __pyx_k_The_principal_branch_of_cosh_1, sizeof(__pyx_k_The_principal_branch_of_cosh_1), 0, 1, 0, 0},
  {&__pyx_kp_u_The_principal_branch_of_sin_1_x, __pyx_k_The_principal_branch_of_sin_1_x, sizeof(__pyx_k_The_principal_branch_of_sin_1_x), 0, 1, 0, 0},
  {&__pyx_kp_u_The_principal_branch_of_sinh_1, __pyx_k_The_principal_branch_of_sinh_1, sizeof(__pyx_k_The_principal_branch_of_sinh_1), 0, 1, 0, 0},
  {&__pyx_kp_u_The_principal_branch_of_tan_1_x, __pyx_k_The_principal_branch_of_tan_1_x, sizeof(__pyx_k_The_principal_branch_of_tan_1_x), 0, 1, 0, 0},
  {&__pyx_kp_u_The_principal_branch_of_tanh_1, __pyx_k_The_principal_branch_of_tanh_1, sizeof(__pyx_k_The_principal_branch_of_tanh_1), 0, 1, 0, 0},
  {&__pyx_kp_u_The_principal_branch_of_the_dil, __pyx_k_The_principal_branch_of_the_dil, sizeof(__pyx_k_The_principal_branch_of_the_dil), 0, 1, 0, 0},
  {&__pyx_kp_u_The_uniformizer_of_the_p_adic_r, __pyx_k_The_uniformizer_of_the_p_adic_r, sizeof(__pyx_k_The_uniformizer_of_the_p_adic_r), 0, 1, 0, 0},
  {&__pyx_kp_s_This_is_probably_an_infinite_loo, __pyx_k_This_is_probably_an_infinite_loo, sizeof(__pyx_k_This_is_probably_an_infinite_loo), 0, 0, 1, 0},
  {&__pyx_kp_u_Transform_the_object_x_into_a_c, __pyx_k_Transform_the_object_x_into_a_c, sizeof(__pyx_k_Transform_the_object_x_into_a_c), 0, 1, 0, 0},
  {&__pyx_kp_u_Transform_the_object_x_into_a_c_2, __pyx_k_Transform_the_object_x_into_a_c_2, sizeof(__pyx_k_Transform_the_object_x_into_a_c_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Transform_the_object_x_into_a_t, __pyx_k_Transform_the_object_x_into_a_t, sizeof(__pyx_k_Transform_the_object_x_into_a_t), 0, 1, 0, 0},
  {&__pyx_kp_u_Transform_the_object_x_into_a_v, __pyx_k_Transform_the_object_x_into_a_v, sizeof(__pyx_k_Transform_the_object_x_into_a_v), 0, 1, 0, 0},
  {&__pyx_kp_u_Transform_the_object_x_into_a_v_2, __pyx_k_Transform_the_object_x_into_a_v_2, sizeof(__pyx_k_Transform_the_object_x_into_a_v_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Transforms_the_column_vector_x, __pyx_k_Transforms_the_column_vector_x, sizeof(__pyx_k_Transforms_the_column_vector_x), 0, 1, 0, 0},
  {&__pyx_kp_u_Transforms_the_column_vector_x_2, __pyx_k_Transforms_the_column_vector_x_2, sizeof(__pyx_k_Transforms_the_column_vector_x_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Transpose_of_the_matrix_self_EX, __pyx_k_Transpose_of_the_matrix_self_EX, sizeof(__pyx_k_Transpose_of_the_matrix_self_EX), 0, 1, 0, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_kp_s_Unable_to_allocate_s_bytes_memor, __pyx_k_Unable_to_allocate_s_bytes_memor, sizeof(__pyx_k_Unable_to_allocate_s_bytes_memor), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_PARI_type_s, __pyx_k_Unknown_PARI_type_s, sizeof(__pyx_k_Unknown_PARI_type_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Use_for_exponentiation_not_which, __pyx_k_Use_for_exponentiation_not_which, sizeof(__pyx_k_Use_for_exponentiation_not_which), 0, 0, 1, 0},
  {&__pyx_kp_s_Users_dunfield_work_CyPari_cypa, __pyx_k_Users_dunfield_work_CyPari_cypa, sizeof(__pyx_k_Users_dunfield_work_CyPari_cypa), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_Vec, __pyx_k_Vec, sizeof(__pyx_k_Vec), 0, 0, 1, 1},
  {&__pyx_n_s_Vecrev, __pyx_k_Vecrev, sizeof(__pyx_k_Vecrev), 0, 0, 1, 1},
  {&__pyx_kp_u_Vector_of_vectors_L_of_all_idea, __pyx_k_Vector_of_vectors_L_of_all_idea, sizeof(__pyx_k_Vector_of_vectors_L_of_all_idea), 0, 1, 0, 0},
  {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0},
  {&__pyx_kp_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 0},
  {&__pyx_kp_s__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 1, 0},
  {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0},
  {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0},
  {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0},
  {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0},
  {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0},
  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
  {&__pyx_kp_u_a_hyperu_b_x_U_confluent_hyperg, __pyx_k_a_hyperu_b_x_U_confluent_hyperg, sizeof(__pyx_k_a_hyperu_b_x_U_confluent_hyperg), 0, 1, 0, 0},
  {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1},
  {&__pyx_n_s_add_one, __pyx_k_add_one, sizeof(__pyx_k_add_one), 0, 0, 1, 1},
  {&__pyx_n_s_alarm_handler, __pyx_k_alarm_handler, sizeof(__pyx_k_alarm_handler), 0, 0, 1, 1},
  {&__pyx_n_s_allocatemem, __pyx_k_allocatemem, sizeof(__pyx_k_allocatemem), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_kp_u_arg_x_argument_of_x_such_that_p, __pyx_k_arg_x_argument_of_x_such_that_p, sizeof(__pyx_k_arg_x_argument_of_x_such_that_p), 0, 1, 0, 0},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_kp_s_attempt_to_assign_sequence_of_si, __pyx_k_attempt_to_assign_sequence_of_si, sizeof(__pyx_k_attempt_to_assign_sequence_of_si), 0, 0, 1, 0},
  {&__pyx_n_s_aut, __pyx_k_aut, sizeof(__pyx_k_aut), 0, 0, 1, 1},
  {&__pyx_kp_s_available_d, __pyx_k_available_d, sizeof(__pyx_k_available_d), 0, 0, 1, 0},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_s_bezout, __pyx_k_bezout, sizeof(__pyx_k_bezout), 0, 0, 1, 1},
  {&__pyx_n_s_bid, __pyx_k_bid, sizeof(__pyx_k_bid), 0, 0, 1, 1},
  {&__pyx_kp_u_binary_x_gives_the_vector_forme, __pyx_k_binary_x_gives_the_vector_forme, sizeof(__pyx_k_binary_x_gives_the_vector_forme), 0, 1, 0, 0},
  {&__pyx_kp_u_binomial_x_k_return_the_binomia, __pyx_k_binomial_x_k_return_the_binomia, sizeof(__pyx_k_binomial_x_k_return_the_binomia), 0, 1, 0, 0},
  {&__pyx_kp_u_bitand_x_y_Bitwise_and_of_two_i, __pyx_k_bitand_x_y_Bitwise_and_of_two_i, sizeof(__pyx_k_bitand_x_y_Bitwise_and_of_two_i), 0, 1, 0, 0},
  {&__pyx_kp_u_bitneg_x_n_1_Bitwise_negation_o, __pyx_k_bitneg_x_n_1_Bitwise_negation_o, sizeof(__pyx_k_bitneg_x_n_1_Bitwise_negation_o), 0, 1, 0, 0},
  {&__pyx_kp_u_bitnegimply_x_y_Bitwise_negated, __pyx_k_bitnegimply_x_y_Bitwise_negated, sizeof(__pyx_k_bitnegimply_x_y_Bitwise_negated), 0, 1, 0, 0},
  {&__pyx_kp_u_bitor_x_y_Bitwise_or_of_two_int, __pyx_k_bitor_x_y_Bitwise_or_of_two_int, sizeof(__pyx_k_bitor_x_y_Bitwise_or_of_two_int), 0, 1, 0, 0},
  {&__pyx_n_s_bits, __pyx_k_bits, sizeof(__pyx_k_bits), 0, 0, 1, 1},
  {&__pyx_kp_u_bittest_x_long_n_Returns_bit_nu, __pyx_k_bittest_x_long_n_Returns_bit_nu, sizeof(__pyx_k_bittest_x_long_n_Returns_bit_nu), 0, 1, 0, 0},
  {&__pyx_kp_u_bitxor_x_y_Bitwise_exclusive_or, __pyx_k_bitxor_x_y_Bitwise_exclusive_or, sizeof(__pyx_k_bitxor_x_y_Bitwise_exclusive_or), 0, 1, 0, 0},
  {&__pyx_n_s_bound, __pyx_k_bound, sizeof(__pyx_k_bound), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_kp_s_cannot_index_PARI_type_s_by_tupl, __pyx_k_cannot_index_PARI_type_s_by_tupl, sizeof(__pyx_k_cannot_index_PARI_type_s_by_tupl), 0, 0, 1, 0},
  {&__pyx_kp_u_centerlift_x_v_Centered_lift_of, __pyx_k_centerlift_x_v_Centered_lift_of, sizeof(__pyx_k_centerlift_x_v_Centered_lift_of), 0, 1, 0, 0},
  {&__pyx_kp_s_change_variable_name_only_works, __pyx_k_change_variable_name_only_works, sizeof(__pyx_k_change_variable_name_only_works), 0, 0, 1, 0},
  {&__pyx_n_s_chars_to_str, __pyx_k_chars_to_str, sizeof(__pyx_k_chars_to_str), 0, 0, 1, 1},
  {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1},
  {&__pyx_kp_s_column_index_out_of_bounds, __pyx_k_column_index_out_of_bounds, sizeof(__pyx_k_column_index_out_of_bounds), 0, 0, 1, 0},
  {&__pyx_kp_s_column_j_s_must_be_between_0_and, __pyx_k_column_j_s_must_be_between_0_and, sizeof(__pyx_k_column_j_s_must_be_between_0_and), 0, 0, 1, 0},
  {&__pyx_n_s_component, __pyx_k_component, sizeof(__pyx_k_component), 0, 0, 1, 1},
  {&__pyx_kp_u_component_x_long_n_Return_n_th, __pyx_k_component_x_long_n_Return_n_th, sizeof(__pyx_k_component_x_long_n_Return_n_th), 0, 1, 0, 0},
  {&__pyx_kp_u_conj_x_Return_the_algebraic_con, __pyx_k_conj_x_Return_the_algebraic_con, sizeof(__pyx_k_conj_x_Return_the_algebraic_con), 0, 1, 0, 0},
  {&__pyx_kp_u_conjvec_x_Returns_the_vector_of, __pyx_k_conjvec_x_Returns_the_vector_of, sizeof(__pyx_k_conjvec_x_Returns_the_vector_of), 0, 1, 0, 0},
  {&__pyx_n_s_cypari_src_gen, __pyx_k_cypari_src_gen, sizeof(__pyx_k_cypari_src_gen), 0, 0, 1, 1},
  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
  {&__pyx_kp_s_d_full, __pyx_k_d_full, sizeof(__pyx_k_d_full), 0, 0, 1, 0},
  {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
  {&__pyx_n_s_default_int_handler, __pyx_k_default_int_handler, sizeof(__pyx_k_default_int_handler), 0, 0, 1, 1},
  {&__pyx_kp_s_default_s, __pyx_k_default_s, sizeof(__pyx_k_default_s), 0, 0, 1, 0},
  {&__pyx_kp_s_default_s_s, __pyx_k_default_s_s, sizeof(__pyx_k_default_s_s), 0, 0, 1, 0},
  {&__pyx_n_s_den, __pyx_k_den, sizeof(__pyx_k_den), 0, 0, 1, 1},
  {&__pyx_n_s_denom, __pyx_k_denom, sizeof(__pyx_k_denom), 0, 0, 1, 1},
  {&__pyx_kp_u_denominator_x_Return_the_denomi, __pyx_k_denominator_x_Return_the_denomi, sizeof(__pyx_k_denominator_x_Return_the_denomi), 0, 1, 0, 0},
  {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_kp_u_e_disc_return_the_discriminant, __pyx_k_e_disc_return_the_discriminant, sizeof(__pyx_k_e_disc_return_the_discriminant), 0, 1, 0, 0},
  {&__pyx_kp_u_e_elladd_z0_z1_return_the_sum_o, __pyx_k_e_elladd_z0_z1_return_the_sum_o, sizeof(__pyx_k_e_elladd_z0_z1_return_the_sum_o), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellak_n_Returns_the_coefficie, __pyx_k_e_ellak_n_Returns_the_coefficie, sizeof(__pyx_k_e_ellak_n_Returns_the_coefficie), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellap_p_Returns_the_prime_ind, __pyx_k_e_ellap_p_Returns_the_prime_ind, sizeof(__pyx_k_e_ellap_p_Returns_the_prime_ind), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellaplist_n_Returns_a_PARI_li, __pyx_k_e_ellaplist_n_Returns_a_PARI_li, sizeof(__pyx_k_e_ellaplist_n_Returns_a_PARI_li), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellbil_z0_z1_return_the_value, __pyx_k_e_ellbil_z0_z1_return_the_value, sizeof(__pyx_k_e_ellbil_z0_z1_return_the_value), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellchangecurve_ch_return_the, __pyx_k_e_ellchangecurve_ch_return_the, sizeof(__pyx_k_e_ellchangecurve_ch_return_the), 0, 1, 0, 0},
  {&__pyx_kp_u_e_elleta_return_the_vector_eta1, __pyx_k_e_elleta_return_the_vector_eta1, sizeof(__pyx_k_e_elleta_return_the_vector_eta1), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellglobalred_return_informati, __pyx_k_e_ellglobalred_return_informati, sizeof(__pyx_k_e_ellglobalred_return_informati), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellheight_a_flag_2_return_the, __pyx_k_e_ellheight_a_flag_2_return_the, sizeof(__pyx_k_e_ellheight_a_flag_2_return_the), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellheightmatrix_x_return_the, __pyx_k_e_ellheightmatrix_x_return_the, sizeof(__pyx_k_e_ellheightmatrix_x_return_the), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellisoncurve_x_return_True_if, __pyx_k_e_ellisoncurve_x_return_True_if, sizeof(__pyx_k_e_ellisoncurve_x_return_True_if), 0, 1, 0, 0},
  {&__pyx_kp_u_e_elllocalred_p_computes_the_da, __pyx_k_e_elllocalred_p_computes_the_da, sizeof(__pyx_k_e_elllocalred_p_computes_the_da), 0, 1, 0, 0},
  {&__pyx_kp_u_e_elllseries_s_A_1_return_the_v, __pyx_k_e_elllseries_s_A_1_return_the_v, sizeof(__pyx_k_e_elllseries_s_A_1_return_the_v), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellorder_x_return_the_order_o, __pyx_k_e_ellorder_x_return_the_order_o, sizeof(__pyx_k_e_ellorder_x_return_the_order_o), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellordinate_x_return_the_y_co, __pyx_k_e_ellordinate_x_return_the_y_co, sizeof(__pyx_k_e_ellordinate_x_return_the_y_co), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellpointtoz_P_return_the_comp, __pyx_k_e_ellpointtoz_P_return_the_comp, sizeof(__pyx_k_e_ellpointtoz_P_return_the_comp), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellpow_z_n_return_n_times_the, __pyx_k_e_ellpow_z_n_return_n_times_the, sizeof(__pyx_k_e_ellpow_z_n_return_n_times_the), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellrootno_p_return_the_local, __pyx_k_e_ellrootno_p_return_the_local, sizeof(__pyx_k_e_ellrootno_p_return_the_local), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellsigma_z_flag_0_return_the, __pyx_k_e_ellsigma_z_flag_0_return_the, sizeof(__pyx_k_e_ellsigma_z_flag_0_return_the), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellsub_z0_z1_return_z0_z1_on, __pyx_k_e_ellsub_z0_z1_return_z0_z1_on, sizeof(__pyx_k_e_ellsub_z0_z1_return_z0_z1_on), 0, 1, 0, 0},
  {&__pyx_kp_u_e_elltors_flag_0_return_informa, __pyx_k_e_elltors_flag_0_return_informa, sizeof(__pyx_k_e_elltors_flag_0_return_informa), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellzeta_z_return_the_value_at, __pyx_k_e_ellzeta_z_return_the_value_at, sizeof(__pyx_k_e_ellzeta_z_return_the_value_at), 0, 1, 0, 0},
  {&__pyx_kp_u_e_ellztopoint_z_return_the_poin, __pyx_k_e_ellztopoint_z_return_the_poin, sizeof(__pyx_k_e_ellztopoint_z_return_the_poin), 0, 1, 0, 0},
  {&__pyx_kp_u_e_j_return_the_j_invariant_of_t, __pyx_k_e_j_return_the_j_invariant_of_t, sizeof(__pyx_k_e_j_return_the_j_invariant_of_t), 0, 1, 0, 0},
  {&__pyx_kp_u_e_omega_return_basis_for_the_pe, __pyx_k_e_omega_return_basis_for_the_pe, sizeof(__pyx_k_e_omega_return_basis_for_the_pe), 0, 1, 0, 0},
  {&__pyx_kp_u_ellminimalmodel_e_return_the_st, __pyx_k_ellminimalmodel_e_return_the_st, sizeof(__pyx_k_ellminimalmodel_e_return_the_st), 0, 1, 0, 0},
  {&__pyx_n_s_entries, __pyx_k_entries, sizeof(__pyx_k_entries), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_errmessage, __pyx_k_errmessage, sizeof(__pyx_k_errmessage), 0, 0, 1, 1},
  {&__pyx_n_s_errnum, __pyx_k_errnum, sizeof(__pyx_k_errnum), 0, 0, 1, 1},
  {&__pyx_n_s_estimate, __pyx_k_estimate, sizeof(__pyx_k_estimate), 0, 0, 1, 1},
  {&__pyx_n_s_eval, __pyx_k_eval, sizeof(__pyx_k_eval), 0, 0, 1, 1},
  {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
  {&__pyx_n_s_fa, __pyx_k_fa, sizeof(__pyx_k_fa), 0, 0, 1, 1},
  {&__pyx_n_s_factor, __pyx_k_factor, sizeof(__pyx_k_factor), 0, 0, 1, 1},
  {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
  {&__pyx_n_s_find_root, __pyx_k_find_root, sizeof(__pyx_k_find_root), 0, 0, 1, 1},
  {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1},
  {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
  {&__pyx_kp_u_frac_x_Return_the_fractional_pa, __pyx_k_frac_x_Return_the_fractional_pa, sizeof(__pyx_k_frac_x_Return_the_fractional_pa), 0, 1, 0, 0},
  {&__pyx_n_s_future_builtins, __pyx_k_future_builtins, sizeof(__pyx_k_future_builtins), 0, 0, 1, 1},
  {&__pyx_kp_u_gen_Col_line_2080, __pyx_k_gen_Col_line_2080, sizeof(__pyx_k_gen_Col_line_2080), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Colrev_line_2127, __pyx_k_gen_Colrev_line_2127, sizeof(__pyx_k_gen_Colrev_line_2127), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_List_line_2180, __pyx_k_gen_List_line_2180, sizeof(__pyx_k_gen_List_line_2180), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Mat_line_2200, __pyx_k_gen_Mat_line_2200, sizeof(__pyx_k_gen_Mat_line_2200), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Mod_line_2263, __pyx_k_gen_Mod_line_2263, sizeof(__pyx_k_gen_Mod_line_2263), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Pol_line_2324, __pyx_k_gen_Pol_line_2324, sizeof(__pyx_k_gen_Pol_line_2324), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Polrev_line_2383, __pyx_k_gen_Polrev_line_2383, sizeof(__pyx_k_gen_Polrev_line_2383), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Qfb_line_2423, __pyx_k_gen_Qfb_line_2423, sizeof(__pyx_k_gen_Qfb_line_2423), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Ser_line_2475, __pyx_k_gen_Ser_line_2475, sizeof(__pyx_k_gen_Ser_line_2475), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Set_line_2532, __pyx_k_gen_Set_line_2532, sizeof(__pyx_k_gen_Set_line_2532), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Str_line_2567, __pyx_k_gen_Str_line_2567, sizeof(__pyx_k_gen_Str_line_2567), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Strchr_line_2607, __pyx_k_gen_Strchr_line_2607, sizeof(__pyx_k_gen_Strchr_line_2607), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Strtex_line_2657, __pyx_k_gen_Strtex_line_2657, sizeof(__pyx_k_gen_Strtex_line_2657), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Vec_line_2694, __pyx_k_gen_Vec_line_2694, sizeof(__pyx_k_gen_Vec_line_2694), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Vecrev_line_2752, __pyx_k_gen_Vecrev_line_2752, sizeof(__pyx_k_gen_Vecrev_line_2752), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_Vecsmall_line_2799, __pyx_k_gen_Vecsmall_line_2799, sizeof(__pyx_k_gen_Vecsmall_line_2799), 0, 1, 0, 0},
  {&__pyx_kp_u_gen___complex___line_1673, __pyx_k_gen___complex___line_1673, sizeof(__pyx_k_gen___complex___line_1673), 0, 1, 0, 0},
  {&__pyx_kp_u_gen___getitem___line_982, __pyx_k_gen___getitem___line_982, sizeof(__pyx_k_gen___getitem___line_982), 0, 1, 0, 0},
  {&__pyx_kp_u_gen___hash___line_432, __pyx_k_gen___hash___line_432, sizeof(__pyx_k_gen___hash___line_432), 0, 1, 0, 0},
  {&__pyx_kp_u_gen___index___line_1458, __pyx_k_gen___index___line_1458, sizeof(__pyx_k_gen___index___line_1458), 0, 1, 0, 0},
  {&__pyx_kp_u_gen___int___line_1498, __pyx_k_gen___int___line_1498, sizeof(__pyx_k_gen___int___line_1498), 0, 1, 0, 0},
  {&__pyx_kp_u_gen___setitem___line_1211, __pyx_k_gen___setitem___line_1211, sizeof(__pyx_k_gen___setitem___line_1211), 0, 1, 0, 0},
  {&__pyx_kp_u_gen__add_one_line_556, __pyx_k_gen__add_one_line_556, sizeof(__pyx_k_gen__add_one_line_556), 0, 1, 0, 0},
  {&__pyx_kp_u_gen__gen_length_line_1196, __pyx_k_gen__gen_length_line_1196, sizeof(__pyx_k_gen__gen_length_line_1196), 0, 1, 0, 0},
  {&__pyx_kp_u_gen__valp_line_3997, __pyx_k_gen__valp_line_3997, sizeof(__pyx_k_gen__valp_line_3997), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_abs_line_4056, __pyx_k_gen_abs_line_4056, sizeof(__pyx_k_gen_abs_line_4056), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_acos_line_4082, __pyx_k_gen_acos_line_4082, sizeof(__pyx_k_gen_acos_line_4082), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_acosh_line_4107, __pyx_k_gen_acosh_line_4107, sizeof(__pyx_k_gen_acosh_line_4107), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_agm_line_4131, __pyx_k_gen_agm_line_4131, sizeof(__pyx_k_gen_agm_line_4131), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_algdep_line_8596, __pyx_k_gen_algdep_line_8596, sizeof(__pyx_k_gen_algdep_line_8596), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_arg_line_4160, __pyx_k_gen_arg_line_4160, sizeof(__pyx_k_gen_arg_line_4160), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_asin_line_4177, __pyx_k_gen_asin_line_4177, sizeof(__pyx_k_gen_asin_line_4177), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_asinh_line_4199, __pyx_k_gen_asinh_line_4199, sizeof(__pyx_k_gen_asinh_line_4199), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_atan_line_4219, __pyx_k_gen_atan_line_4219, sizeof(__pyx_k_gen_atan_line_4219), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_atanh_line_4239, __pyx_k_gen_atanh_line_4239, sizeof(__pyx_k_gen_atanh_line_4239), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bernfrac_line_4261, __pyx_k_gen_bernfrac_line_4261, sizeof(__pyx_k_gen_bernfrac_line_4261), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bernreal_line_4278, __pyx_k_gen_bernreal_line_4278, sizeof(__pyx_k_gen_bernreal_line_4278), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bernvec_line_4293, __pyx_k_gen_bernvec_line_4293, sizeof(__pyx_k_gen_bernvec_line_4293), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_besselh1_line_4314, __pyx_k_gen_besselh1_line_4314, sizeof(__pyx_k_gen_besselh1_line_4314), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_besselh2_line_4334, __pyx_k_gen_besselh2_line_4334, sizeof(__pyx_k_gen_besselh2_line_4334), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_besseli_line_4401, __pyx_k_gen_besseli_line_4401, sizeof(__pyx_k_gen_besseli_line_4401), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_besselj_line_4354, __pyx_k_gen_besselj_line_4354, sizeof(__pyx_k_gen_besselj_line_4354), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_besseljh_line_4377, __pyx_k_gen_besseljh_line_4377, sizeof(__pyx_k_gen_besseljh_line_4377), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_besselk_line_4426, __pyx_k_gen_besselk_line_4426, sizeof(__pyx_k_gen_besselk_line_4426), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_besseln_line_4468, __pyx_k_gen_besseln_line_4468, sizeof(__pyx_k_gen_besseln_line_4468), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bid_get_cyc_line_937, __pyx_k_gen_bid_get_cyc_line_937, sizeof(__pyx_k_gen_bid_get_cyc_line_937), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bid_get_gen_line_955, __pyx_k_gen_bid_get_gen_line_955, sizeof(__pyx_k_gen_bid_get_gen_line_955), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_binary_line_2841, __pyx_k_gen_binary_line_2841, sizeof(__pyx_k_gen_binary_line_2841), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_binomial_line_5243, __pyx_k_gen_binomial_line_5243, sizeof(__pyx_k_gen_binomial_line_5243), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bitand_line_2881, __pyx_k_gen_bitand_line_2881, sizeof(__pyx_k_gen_bitand_line_2881), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bitneg_line_2922, __pyx_k_gen_bitneg_line_2922, sizeof(__pyx_k_gen_bitneg_line_2922), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bitnegimply_line_2968, __pyx_k_gen_bitnegimply_line_2968, sizeof(__pyx_k_gen_bitnegimply_line_2968), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bitor_line_3002, __pyx_k_gen_bitor_line_3002, sizeof(__pyx_k_gen_bitor_line_3002), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bittest_line_3037, __pyx_k_gen_bittest_line_3037, sizeof(__pyx_k_gen_bittest_line_3037), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bitxor_line_3078, __pyx_k_gen_bitxor_line_3078, sizeof(__pyx_k_gen_bitxor_line_3078), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bnf_get_cyc_line_805, __pyx_k_gen_bnf_get_cyc_line_805, sizeof(__pyx_k_gen_bnf_get_cyc_line_805), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bnf_get_gen_line_821, __pyx_k_gen_bnf_get_gen_line_821, sizeof(__pyx_k_gen_bnf_get_gen_line_821), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bnf_get_no_line_792, __pyx_k_gen_bnf_get_no_line_792, sizeof(__pyx_k_gen_bnf_get_no_line_792), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_bnf_get_reg_line_837, __pyx_k_gen_bnf_get_reg_line_837, sizeof(__pyx_k_gen_bnf_get_reg_line_837), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ceil_line_3111, __pyx_k_gen_ceil_line_3111, sizeof(__pyx_k_gen_ceil_line_3111), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_centerlift_line_3153, __pyx_k_gen_centerlift_line_3153, sizeof(__pyx_k_gen_centerlift_line_3153), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_change_variable_name_line_83, __pyx_k_gen_change_variable_name_line_83, sizeof(__pyx_k_gen_change_variable_name_line_83), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_component_line_3192, __pyx_k_gen_component_line_3192, sizeof(__pyx_k_gen_component_line_3192), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_conj_line_3238, __pyx_k_gen_conj_line_3238, sizeof(__pyx_k_gen_conj_line_3238), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_conjvec_line_3270, __pyx_k_gen_conjvec_line_3270, sizeof(__pyx_k_gen_conjvec_line_3270), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_content_line_7461, __pyx_k_gen_content_line_7461, sizeof(__pyx_k_gen_content_line_7461), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_cos_line_4488, __pyx_k_gen_cos_line_4488, sizeof(__pyx_k_gen_cos_line_4488), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_cosh_line_4509, __pyx_k_gen_cosh_line_4509, sizeof(__pyx_k_gen_cosh_line_4509), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_cotan_line_4530, __pyx_k_gen_cotan_line_4530, sizeof(__pyx_k_gen_cotan_line_4530), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_debug_line_8776, __pyx_k_gen_debug_line_8776, sizeof(__pyx_k_gen_debug_line_8776), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_denominator_line_3294, __pyx_k_gen_denominator_line_3294, sizeof(__pyx_k_gen_denominator_line_3294), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_dilog_line_4557, __pyx_k_gen_dilog_line_4557, sizeof(__pyx_k_gen_dilog_line_4557), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_disc_line_6585, __pyx_k_gen_disc_line_6585, sizeof(__pyx_k_gen_disc_line_6585), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_elladd_line_5559, __pyx_k_gen_elladd_line_5559, sizeof(__pyx_k_gen_elladd_line_5559), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellak_line_5595, __pyx_k_gen_ellak_line_5595, sizeof(__pyx_k_gen_ellak_line_5595), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellan_line_5634, __pyx_k_gen_ellan_line_5634, sizeof(__pyx_k_gen_ellan_line_5634), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellanalyticrank_line_5674, __pyx_k_gen_ellanalyticrank_line_5674, sizeof(__pyx_k_gen_ellanalyticrank_line_5674), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellap_line_5689, __pyx_k_gen_ellap_line_5689, sizeof(__pyx_k_gen_ellap_line_5689), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellaplist_line_5729, __pyx_k_gen_ellaplist_line_5729, sizeof(__pyx_k_gen_ellaplist_line_5729), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellbil_line_5801, __pyx_k_gen_ellbil_line_5801, sizeof(__pyx_k_gen_ellbil_line_5801), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellchangecurve_line_5826, __pyx_k_gen_ellchangecurve_line_5826, sizeof(__pyx_k_gen_ellchangecurve_line_5826), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellchangepoint_line_8751, __pyx_k_gen_ellchangepoint_line_8751, sizeof(__pyx_k_gen_ellchangepoint_line_8751), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_elleisnum_line_8635, __pyx_k_gen_elleisnum_line_8635, sizeof(__pyx_k_gen_elleisnum_line_8635), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_elleta_line_5857, __pyx_k_gen_elleta_line_5857, sizeof(__pyx_k_gen_elleta_line_5857), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellglobalred_line_5524, __pyx_k_gen_ellglobalred_line_5524, sizeof(__pyx_k_gen_ellglobalred_line_5524), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellheight_line_5879, __pyx_k_gen_ellheight_line_5879, sizeof(__pyx_k_gen_ellheight_line_5879), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellheightmatrix_line_5926, __pyx_k_gen_ellheightmatrix_line_5926, sizeof(__pyx_k_gen_ellheightmatrix_line_5926), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellinit_line_5451, __pyx_k_gen_ellinit_line_5451, sizeof(__pyx_k_gen_ellinit_line_5451), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellisoncurve_line_5955, __pyx_k_gen_ellisoncurve_line_5955, sizeof(__pyx_k_gen_ellisoncurve_line_5955), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_elllocalred_line_5983, __pyx_k_gen_elllocalred_line_5983, sizeof(__pyx_k_gen_elllocalred_line_5983), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_elllseries_line_6138, __pyx_k_gen_elllseries_line_6138, sizeof(__pyx_k_gen_elllseries_line_6138), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellminimalmodel_line_6181, __pyx_k_gen_ellminimalmodel_line_6181, sizeof(__pyx_k_gen_ellminimalmodel_line_6181), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellorder_line_6219, __pyx_k_gen_ellorder_line_6219, sizeof(__pyx_k_gen_ellorder_line_6219), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellordinate_line_6250, __pyx_k_gen_ellordinate_line_6250, sizeof(__pyx_k_gen_ellordinate_line_6250), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellpointtoz_line_6281, __pyx_k_gen_ellpointtoz_line_6281, sizeof(__pyx_k_gen_ellpointtoz_line_6281), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellpow_line_6307, __pyx_k_gen_ellpow_line_6307, sizeof(__pyx_k_gen_ellpow_line_6307), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellrootno_line_6370, __pyx_k_gen_ellrootno_line_6370, sizeof(__pyx_k_gen_ellrootno_line_6370), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellsigma_line_6408, __pyx_k_gen_ellsigma_line_6408, sizeof(__pyx_k_gen_ellsigma_line_6408), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellsub_line_6425, __pyx_k_gen_ellsub_line_6425, sizeof(__pyx_k_gen_ellsub_line_6425), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_elltors_line_6455, __pyx_k_gen_elltors_line_6455, sizeof(__pyx_k_gen_elltors_line_6455), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellwp_line_8677, __pyx_k_gen_ellwp_line_8677, sizeof(__pyx_k_gen_ellwp_line_8677), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellzeta_line_6500, __pyx_k_gen_ellzeta_line_6500, sizeof(__pyx_k_gen_ellzeta_line_6500), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ellztopoint_line_6533, __pyx_k_gen_ellztopoint_line_6533, sizeof(__pyx_k_gen_ellztopoint_line_6533), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_erfc_line_4608, __pyx_k_gen_erfc_line_4608, sizeof(__pyx_k_gen_erfc_line_4608), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_eta_line_4631, __pyx_k_gen_eta_line_4631, sizeof(__pyx_k_gen_eta_line_4631), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_exp_line_4660, __pyx_k_gen_exp_line_4660, sizeof(__pyx_k_gen_exp_line_4660), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_factor_line_8228, __pyx_k_gen_factor_line_8228, sizeof(__pyx_k_gen_factor_line_8228), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_factornf_line_7487, __pyx_k_gen_factornf_line_7487, sizeof(__pyx_k_gen_factornf_line_7487), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_fibonacci_line_5287, __pyx_k_gen_fibonacci_line_5287, sizeof(__pyx_k_gen_fibonacci_line_5287), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_floor_line_3324, __pyx_k_gen_floor_line_3324, sizeof(__pyx_k_gen_floor_line_3324), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_frac_line_3367, __pyx_k_gen_frac_line_3367, sizeof(__pyx_k_gen_frac_line_3367), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_gamma_line_4681, __pyx_k_gen_gamma_line_4681, sizeof(__pyx_k_gen_gamma_line_4681), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_gammah_line_4709, __pyx_k_gen_gammah_line_4709, sizeof(__pyx_k_gen_gammah_line_4709), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_gequal0_line_1758, __pyx_k_gen_gequal0_line_1758, sizeof(__pyx_k_gen_gequal0_line_1758), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_gequal_line_1724, __pyx_k_gen_gequal_line_1724, sizeof(__pyx_k_gen_gequal_line_1724), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_gequal_long_line_1778, __pyx_k_gen_gequal_long_line_1778, sizeof(__pyx_k_gen_gequal_long_line_1778), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_hex_line_1477, __pyx_k_gen_hex_line_1477, sizeof(__pyx_k_gen_hex_line_1477), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_hyperu_line_4730, __pyx_k_gen_hyperu_line_4730, sizeof(__pyx_k_gen_hyperu_line_4730), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_idealcoprime_line_6743, __pyx_k_gen_idealcoprime_line_6743, sizeof(__pyx_k_gen_idealcoprime_line_6743), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ideallist_line_6791, __pyx_k_gen_ideallist_line_6791, sizeof(__pyx_k_gen_ideallist_line_6791), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ideallog_line_6817, __pyx_k_gen_ideallog_line_6817, sizeof(__pyx_k_gen_ideallog_line_6817), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_idealprimedec_line_6861, __pyx_k_gen_idealprimedec_line_6861, sizeof(__pyx_k_gen_idealprimedec_line_6861), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_idealstar_line_6881, __pyx_k_gen_idealstar_line_6881, sizeof(__pyx_k_gen_idealstar_line_6881), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_imag_line_3393, __pyx_k_gen_imag_line_3393, sizeof(__pyx_k_gen_imag_line_3393), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_incgam_line_4750, __pyx_k_gen_incgam_line_4750, sizeof(__pyx_k_gen_incgam_line_4750), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_incgamc_line_4773, __pyx_k_gen_incgamc_line_4773, sizeof(__pyx_k_gen_incgamc_line_4773), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_intvec_unsafe_line_1563, __pyx_k_gen_intvec_unsafe_line_1563, sizeof(__pyx_k_gen_intvec_unsafe_line_1563), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ispower_line_1928, __pyx_k_gen_ispower_line_1928, sizeof(__pyx_k_gen_ispower_line_1928), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_isprime_line_1809, __pyx_k_gen_isprime_line_1809, sizeof(__pyx_k_gen_isprime_line_1809), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_ispseudoprime_line_1889, __pyx_k_gen_ispseudoprime_line_1889, sizeof(__pyx_k_gen_ispseudoprime_line_1889), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_issquarefree_line_5334, __pyx_k_gen_issquarefree_line_5334, sizeof(__pyx_k_gen_issquarefree_line_5334), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_j_line_6599, __pyx_k_gen_j_line_6599, sizeof(__pyx_k_gen_j_line_6599), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_lcm_line_5348, __pyx_k_gen_lcm_line_5348, sizeof(__pyx_k_gen_lcm_line_5348), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_lift_line_3430, __pyx_k_gen_lift_line_3430, sizeof(__pyx_k_gen_lift_line_3430), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_list_line_458, __pyx_k_gen_list_line_458, sizeof(__pyx_k_gen_list_line_458), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_log_gamma_line_4841, __pyx_k_gen_log_gamma_line_4841, sizeof(__pyx_k_gen_log_gamma_line_4841), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_log_line_4799, __pyx_k_gen_log_line_4799, sizeof(__pyx_k_gen_log_line_4799), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_matadjoint_line_7876, __pyx_k_gen_matadjoint_line_7876, sizeof(__pyx_k_gen_matadjoint_line_7876), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_matdet_line_8032, __pyx_k_gen_matdet_line_8032, sizeof(__pyx_k_gen_matdet_line_8032), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_matfrobenius_line_8182, __pyx_k_gen_matfrobenius_line_8182, sizeof(__pyx_k_gen_matfrobenius_line_8182), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_mathnf_line_8066, __pyx_k_gen_mathnf_line_8066, sizeof(__pyx_k_gen_mathnf_line_8066), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_mathnfmod_line_8092, __pyx_k_gen_mathnfmod_line_8092, sizeof(__pyx_k_gen_mathnfmod_line_8092), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_mathnfmodid_line_8126, __pyx_k_gen_mathnfmodid_line_8126, sizeof(__pyx_k_gen_mathnfmodid_line_8126), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_matker_line_7977, __pyx_k_gen_matker_line_7977, sizeof(__pyx_k_gen_matker_line_7977), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_matkerint_line_8006, __pyx_k_gen_matkerint_line_8006, sizeof(__pyx_k_gen_matkerint_line_8006), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_matsnf_line_8155, __pyx_k_gen_matsnf_line_8155, sizeof(__pyx_k_gen_matsnf_line_8155), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_matsolve_line_7950, __pyx_k_gen_matsolve_line_7950, sizeof(__pyx_k_gen_matsolve_line_7950), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_mattranspose_line_7864, __pyx_k_gen_mattranspose_line_7864, sizeof(__pyx_k_gen_mattranspose_line_7864), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_mod_line_623, __pyx_k_gen_mod_line_623, sizeof(__pyx_k_gen_mod_line_623), 0, 1, 0, 0},
  {&__pyx_kp_s_gen_must_be_of_PARI_type_t_INT_o, __pyx_k_gen_must_be_of_PARI_type_t_INT_o, sizeof(__pyx_k_gen_must_be_of_PARI_type_t_INT_o), 0, 0, 1, 0},
  {&__pyx_kp_s_gen_must_be_of_PARI_type_t_VEC, __pyx_k_gen_must_be_of_PARI_type_t_VEC, sizeof(__pyx_k_gen_must_be_of_PARI_type_t_VEC), 0, 0, 1, 0},
  {&__pyx_kp_u_gen_ncols_line_7829, __pyx_k_gen_ncols_line_7829, sizeof(__pyx_k_gen_ncols_line_7829), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_newtonpoly_line_7541, __pyx_k_gen_newtonpoly_line_7541, sizeof(__pyx_k_gen_newtonpoly_line_7541), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nextprime_line_8346, __pyx_k_gen_nextprime_line_8346, sizeof(__pyx_k_gen_nextprime_line_8346), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nf_get_diff_line_724, __pyx_k_gen_nf_get_diff_line_724, sizeof(__pyx_k_gen_nf_get_diff_line_724), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nf_get_pol_line_691, __pyx_k_gen_nf_get_pol_line_691, sizeof(__pyx_k_gen_nf_get_pol_line_691), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nf_get_sign_line_744, __pyx_k_gen_nf_get_sign_line_744, sizeof(__pyx_k_gen_nf_get_sign_line_744), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nf_get_zk_line_772, __pyx_k_gen_nf_get_zk_line_772, sizeof(__pyx_k_gen_nf_get_zk_line_772), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nf_subst_line_8456, __pyx_k_gen_nf_subst_line_8456, sizeof(__pyx_k_gen_nf_subst_line_8456), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfbasis_d_line_7002, __pyx_k_gen_nfbasis_d_line_7002, sizeof(__pyx_k_gen_nfbasis_d_line_7002), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfbasis_line_6955, __pyx_k_gen_nfbasis_line_6955, sizeof(__pyx_k_gen_nfbasis_line_6955), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfbasistoalg_lift_line_7066, __pyx_k_gen_nfbasistoalg_lift_line_7066, sizeof(__pyx_k_gen_nfbasistoalg_lift_line_7066), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfbasistoalg_line_7034, __pyx_k_gen_nfbasistoalg_line_7034, sizeof(__pyx_k_gen_nfbasistoalg_line_7034), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfdisc_line_7097, __pyx_k_gen_nfdisc_line_7097, sizeof(__pyx_k_gen_nfdisc_line_7097), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfeltreduce_line_7132, __pyx_k_gen_nfeltreduce_line_7132, sizeof(__pyx_k_gen_nfeltreduce_line_7132), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfgaloisconj_line_7607, __pyx_k_gen_nfgaloisconj_line_7607, sizeof(__pyx_k_gen_nfgaloisconj_line_7607), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfhilbert_line_7160, __pyx_k_gen_nfhilbert_line_7160, sizeof(__pyx_k_gen_nfhilbert_line_7160), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfinit_line_7194, __pyx_k_gen_nfinit_line_7194, sizeof(__pyx_k_gen_nfinit_line_7194), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfisisom_line_7258, __pyx_k_gen_nfisisom_line_7258, sizeof(__pyx_k_gen_nfisisom_line_7258), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfroots_line_7636, __pyx_k_gen_nfroots_line_7636, sizeof(__pyx_k_gen_nfroots_line_7636), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nfrootsof1_line_7298, __pyx_k_gen_nfrootsof1_line_7298, sizeof(__pyx_k_gen_nfrootsof1_line_7298), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_nrows_line_7844, __pyx_k_gen_nrows_line_7844, sizeof(__pyx_k_gen_nrows_line_7844), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_numbpart_line_3465, __pyx_k_gen_numbpart_line_3465, sizeof(__pyx_k_gen_numbpart_line_3465), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_numdiv_line_5359, __pyx_k_gen_numdiv_line_5359, sizeof(__pyx_k_gen_numdiv_line_5359), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_omega_line_6572, __pyx_k_gen_omega_line_6572, sizeof(__pyx_k_gen_omega_line_6572), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_padicprec_line_3522, __pyx_k_gen_padicprec_line_3522, sizeof(__pyx_k_gen_padicprec_line_3522), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_padicprime_line_3554, __pyx_k_gen_padicprime_line_3554, sizeof(__pyx_k_gen_padicprime_line_3554), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_phi_line_5371, __pyx_k_gen_phi_line_5371, sizeof(__pyx_k_gen_phi_line_5371), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_polcoeff_line_7556, __pyx_k_gen_polcoeff_line_7556, sizeof(__pyx_k_gen_polcoeff_line_7556), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_polylog_line_4867, __pyx_k_gen_polylog_line_4867, sizeof(__pyx_k_gen_polylog_line_4867), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_pr_get_e_line_870, __pyx_k_gen_pr_get_e_line_870, sizeof(__pyx_k_gen_pr_get_e_line_870), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_pr_get_f_line_893, __pyx_k_gen_pr_get_f_line_893, sizeof(__pyx_k_gen_pr_get_f_line_893), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_pr_get_gen_line_916, __pyx_k_gen_pr_get_gen_line_916, sizeof(__pyx_k_gen_pr_get_gen_line_916), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_pr_get_p_line_852, __pyx_k_gen_pr_get_p_line_852, sizeof(__pyx_k_gen_pr_get_p_line_852), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_primepi_line_5381, __pyx_k_gen_primepi_line_5381, sizeof(__pyx_k_gen_primepi_line_5381), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_psi_line_4895, __pyx_k_gen_psi_line_4895, sizeof(__pyx_k_gen_psi_line_4895), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_python_list_line_1627, __pyx_k_gen_python_list_line_1627, sizeof(__pyx_k_gen_python_list_line_1627), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_python_list_small_line_1604, __pyx_k_gen_python_list_small_line_1604, sizeof(__pyx_k_gen_python_list_small_line_1604), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_qfbhclassno_line_1848, __pyx_k_gen_qfbhclassno_line_1848, sizeof(__pyx_k_gen_qfbhclassno_line_1848), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_quadhilbert_line_7428, __pyx_k_gen_quadhilbert_line_7428, sizeof(__pyx_k_gen_quadhilbert_line_7428), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_rnfidealdown_line_7362, __pyx_k_gen_rnfidealdown_line_7362, sizeof(__pyx_k_gen_rnfidealdown_line_7362), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_rnfinit_line_7405, __pyx_k_gen_rnfinit_line_7405, sizeof(__pyx_k_gen_rnfinit_line_7405), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_round_line_3665, __pyx_k_gen_round_line_3665, sizeof(__pyx_k_gen_round_line_3665), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_serreverse_line_7766, __pyx_k_gen_serreverse_line_7766, sizeof(__pyx_k_gen_serreverse_line_7766), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_simplify_line_3721, __pyx_k_gen_simplify_line_3721, sizeof(__pyx_k_gen_simplify_line_3721), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_sin_line_4915, __pyx_k_gen_sin_line_4915, sizeof(__pyx_k_gen_sin_line_4915), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_sinh_line_4934, __pyx_k_gen_sinh_line_4934, sizeof(__pyx_k_gen_sinh_line_4934), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_sizebyte_line_3795, __pyx_k_gen_sizebyte_line_3795, sizeof(__pyx_k_gen_sizebyte_line_3795), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_sizedigit_line_3814, __pyx_k_gen_sizedigit_line_3814, sizeof(__pyx_k_gen_sizedigit_line_3814), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_sizeword_line_3762, __pyx_k_gen_sizeword_line_3762, sizeof(__pyx_k_gen_sizeword_line_3762), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_sqr_line_4953, __pyx_k_gen_sqr_line_4953, sizeof(__pyx_k_gen_sqr_line_4953), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_sqrt_line_4980, __pyx_k_gen_sqrt_line_4980, sizeof(__pyx_k_gen_sqrt_line_4980), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_sqrtn_line_4997, __pyx_k_gen_sqrtn_line_4997, sizeof(__pyx_k_gen_sqrtn_line_4997), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_subst_line_8423, __pyx_k_gen_subst_line_8423, sizeof(__pyx_k_gen_subst_line_8423), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_sumdiv_line_5411, __pyx_k_gen_sumdiv_line_5411, sizeof(__pyx_k_gen_sumdiv_line_5411), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_sumdivk_line_5423, __pyx_k_gen_sumdivk_line_5423, sizeof(__pyx_k_gen_sumdivk_line_5423), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_tan_line_5055, __pyx_k_gen_tan_line_5055, sizeof(__pyx_k_gen_tan_line_5055), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_tanh_line_5074, __pyx_k_gen_tanh_line_5074, sizeof(__pyx_k_gen_tanh_line_5074), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_teichmuller_line_5098, __pyx_k_gen_teichmuller_line_5098, sizeof(__pyx_k_gen_teichmuller_line_5098), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_theta_line_5113, __pyx_k_gen_theta_line_5113, sizeof(__pyx_k_gen_theta_line_5113), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_thetanullk_line_5132, __pyx_k_gen_thetanullk_line_5132, sizeof(__pyx_k_gen_thetanullk_line_5132), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_trace_line_8054, __pyx_k_gen_trace_line_8054, sizeof(__pyx_k_gen_trace_line_8054), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_truncate_line_3858, __pyx_k_gen_truncate_line_3858, sizeof(__pyx_k_gen_truncate_line_3858), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_type_line_8523, __pyx_k_gen_type_line_8523, sizeof(__pyx_k_gen_type_line_8523), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_valuation_line_3921, __pyx_k_gen_valuation_line_3921, sizeof(__pyx_k_gen_valuation_line_3921), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_variable_line_4019, __pyx_k_gen_variable_line_4019, sizeof(__pyx_k_gen_variable_line_4019), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_weber_line_5149, __pyx_k_gen_weber_line_5149, sizeof(__pyx_k_gen_weber_line_5149), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_xgcd_line_5435, __pyx_k_gen_xgcd_line_5435, sizeof(__pyx_k_gen_xgcd_line_5435), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_zeta_line_5178, __pyx_k_gen_zeta_line_5178, sizeof(__pyx_k_gen_zeta_line_5178), 0, 1, 0, 0},
  {&__pyx_kp_u_gen_znprimroot_line_8309, __pyx_k_gen_znprimroot_line_8309, sizeof(__pyx_k_gen_znprimroot_line_8309), 0, 1, 0, 0},
  {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
  {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1},
  {&__pyx_n_s_im, __pyx_k_im, sizeof(__pyx_k_im), 0, 0, 1, 1},
  {&__pyx_n_s_imag, __pyx_k_imag, sizeof(__pyx_k_imag), 0, 0, 1, 1},
  {&__pyx_kp_u_imag_x_Return_the_imaginary_par, __pyx_k_imag_x_Return_the_imaginary_par, sizeof(__pyx_k_imag_x_Return_the_imaginary_par), 0, 1, 0, 0},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_kp_s_in_Python_and_has_the_wrong_prec, __pyx_k_in_Python_and_has_the_wrong_prec, sizeof(__pyx_k_in_Python_and_has_the_wrong_prec), 0, 0, 1, 0},
  {&__pyx_kp_s_index_must_be_an_integer_or_a_2, __pyx_k_index_must_be_an_integer_or_a_2, sizeof(__pyx_k_index_must_be_an_integer_or_a_2), 0, 0, 1, 0},
  {&__pyx_kp_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 0},
  {&__pyx_kp_s_index_s_must_be_between_0_and_s, __pyx_k_index_s_must_be_between_0_and_s, sizeof(__pyx_k_index_s_must_be_between_0_and_s), 0, 0, 1, 0},
  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_init_pari_stack, __pyx_k_init_pari_stack, sizeof(__pyx_k_init_pari_stack), 0, 0, 1, 1},
  {&__pyx_n_s_init_primes, __pyx_k_init_primes, sizeof(__pyx_k_init_primes), 0, 0, 1, 1},
  {&__pyx_kp_s_input_v_must_be_of_type_vecsmall, __pyx_k_input_v_must_be_of_type_vecsmall, sizeof(__pyx_k_input_v_must_be_of_type_vecsmall), 0, 0, 1, 0},
  {&__pyx_n_s_isprime, __pyx_k_isprime, sizeof(__pyx_k_isprime), 0, 0, 1, 1},
  {&__pyx_kp_u_isprime_x_flag_0_Returns_True_i, __pyx_k_isprime_x_flag_0_Returns_True_i, sizeof(__pyx_k_isprime_x_flag_0_Returns_True_i), 0, 1, 0, 0},
  {&__pyx_kp_u_ispseudoprime_x_flag_0_Returns, __pyx_k_ispseudoprime_x_flag_0_Returns, sizeof(__pyx_k_ispseudoprime_x_flag_0_Returns), 0, 1, 0, 0},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1},
  {&__pyx_kp_s_len_of_entries_s_must_be_s_s_s, __pyx_k_len_of_entries_s_must_be_s_s_s, sizeof(__pyx_k_len_of_entries_s_must_be_s_s_s), 0, 0, 1, 0},
  {&__pyx_kp_s_length_of_entries_s_must_equal_n, __pyx_k_length_of_entries_s_must_equal_n, sizeof(__pyx_k_length_of_entries_s_must_equal_n), 0, 0, 1, 0},
  {&__pyx_kp_u_lift_x_v_Returns_the_lift_of_an, __pyx_k_lift_x_v_Returns_the_lift_of_an, sizeof(__pyx_k_lift_x_v_Returns_the_lift_of_an), 0, 1, 0, 0},
  {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1},
  {&__pyx_n_s_lmax, __pyx_k_lmax, sizeof(__pyx_k_lmax), 0, 0, 1, 1},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_kp_u_matadjoint_x_adjoint_matrix_of, __pyx_k_matadjoint_x_adjoint_matrix_of, sizeof(__pyx_k_matadjoint_x_adjoint_matrix_of), 0, 1, 0, 0},
  {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
  {&__pyx_n_s_matrix, __pyx_k_matrix, sizeof(__pyx_k_matrix), 0, 0, 1, 1},
  {&__pyx_kp_s_matrix_index_must_be_of_the_form, __pyx_k_matrix_index_must_be_of_the_form, sizeof(__pyx_k_matrix_index_must_be_of_the_form), 0, 0, 1, 0},
  {&__pyx_kp_u_matsolve_B_Solve_the_linear_sys, __pyx_k_matsolve_B_Solve_the_linear_sys, sizeof(__pyx_k_matsolve_B_Solve_the_linear_sys), 0, 1, 0, 0},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_maxprime, __pyx_k_maxprime, sizeof(__pyx_k_maxprime), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_ncols, __pyx_k_ncols, sizeof(__pyx_k_ncols), 0, 0, 1, 1},
  {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1},
  {&__pyx_kp_u_nextprime_x_smallest_pseudoprim, __pyx_k_nextprime_x_smallest_pseudoprim, sizeof(__pyx_k_nextprime_x_smallest_pseudoprim), 0, 1, 0, 0},
  {&__pyx_kp_u_nf_nfrootsof1_number_of_roots_o, __pyx_k_nf_nfrootsof1_number_of_roots_o, sizeof(__pyx_k_nf_nfrootsof1_number_of_roots_o), 0, 1, 0, 0},
  {&__pyx_kp_u_nfbasis_d_x_Return_a_basis_of_t, __pyx_k_nfbasis_d_x_Return_a_basis_of_t, sizeof(__pyx_k_nfbasis_d_x_Return_a_basis_of_t), 0, 1, 0, 0},
  {&__pyx_kp_u_nfbasis_x_flag_fa_integral_basi, __pyx_k_nfbasis_x_flag_fa_integral_basi, sizeof(__pyx_k_nfbasis_x_flag_fa_integral_basi), 0, 1, 0, 0},
  {&__pyx_kp_u_nfdisc_x_Return_the_discriminan, __pyx_k_nfdisc_x_Return_the_discriminan, sizeof(__pyx_k_nfdisc_x_Return_the_discriminan), 0, 1, 0, 0},
  {&__pyx_kp_u_nfhilbert_nf_a_b_p_if_p_is_omit, __pyx_k_nfhilbert_nf_a_b_p_if_p_is_omit, sizeof(__pyx_k_nfhilbert_nf_a_b_p_if_p_is_omit), 0, 1, 0, 0},
  {&__pyx_kp_u_nfinit_pol_flag_0_pol_being_a_n, __pyx_k_nfinit_pol_flag_0_pol_being_a_n, sizeof(__pyx_k_nfinit_pol_flag_0_pol_being_a_n), 0, 1, 0, 0},
  {&__pyx_n_s_nfinit_with_prec, __pyx_k_nfinit_with_prec, sizeof(__pyx_k_nfinit_with_prec), 0, 0, 1, 1},
  {&__pyx_kp_u_nfisisom_x_y_Determine_if_the_n, __pyx_k_nfisisom_x_y_Determine_if_the_n, sizeof(__pyx_k_nfisisom_x_y_Determine_if_the_n), 0, 1, 0, 0},
  {&__pyx_kp_s_not_the_same_prime_in_padicprec, __pyx_k_not_the_same_prime_in_padicprec, sizeof(__pyx_k_not_the_same_prime_in_padicprec), 0, 0, 1, 0},
  {&__pyx_n_s_nrows, __pyx_k_nrows, sizeof(__pyx_k_nrows), 0, 0, 1, 1},
  {&__pyx_n_s_nth_prime, __pyx_k_nth_prime, sizeof(__pyx_k_nth_prime), 0, 0, 1, 1},
  {&__pyx_n_s_nth_prime_2, __pyx_k_nth_prime_2, sizeof(__pyx_k_nth_prime_2), 0, 0, 1, 1},
  {&__pyx_kp_s_nth_prime_meaningless_for_non_po, __pyx_k_nth_prime_meaningless_for_non_po, sizeof(__pyx_k_nth_prime_meaningless_for_non_po), 0, 0, 1, 0},
  {&__pyx_kp_u_nu_besselk_x_flag_0_K_Bessel_fu, __pyx_k_nu_besselk_x_flag_0_K_Bessel_fu, sizeof(__pyx_k_nu_besselk_x_flag_0_K_Bessel_fu), 0, 1, 0, 0},
  {&__pyx_kp_u_nu_besseln_x_Bessel_N_function, __pyx_k_nu_besseln_x_Bessel_N_function, sizeof(__pyx_k_nu_besseln_x_Bessel_N_function), 0, 1, 0, 0},
  {&__pyx_kp_u_numbpart_x_returns_the_number_o, __pyx_k_numbpart_x_returns_the_number_o, sizeof(__pyx_k_numbpart_x_returns_the_number_o), 0, 1, 0, 0},
  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_kp_u_om_elleisnum_k_flag_0_om_om1_om, __pyx_k_om_elleisnum_k_flag_0_om_om1_om, sizeof(__pyx_k_om_elleisnum_k_flag_0_om_om1_om), 0, 1, 0, 0},
  {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1},
  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
  {&__pyx_kp_s_p_s_must_be_of_type_t_INT_but_is, __pyx_k_p_s_must_be_of_type_t_INT_but_is, sizeof(__pyx_k_p_s_must_be_of_type_t_INT_but_is), 0, 0, 1, 0},
  {&__pyx_kp_u_padicprec_x_p_Return_the_absolu, __pyx_k_padicprec_x_p_Return_the_absolu, sizeof(__pyx_k_padicprec_x_p_Return_the_absolu), 0, 1, 0, 0},
  {&__pyx_n_s_pari, __pyx_k_pari, sizeof(__pyx_k_pari), 0, 0, 1, 1},
  {&__pyx_n_s_pari_2, __pyx_k_pari_2, sizeof(__pyx_k_pari_2), 0, 0, 1, 1},
  {&__pyx_kp_s_pari_trap_recursion_too_deep, __pyx_k_pari_trap_recursion_too_deep, sizeof(__pyx_k_pari_trap_recursion_too_deep), 0, 0, 1, 0},
  {&__pyx_n_s_pbw, __pyx_k_pbw, sizeof(__pyx_k_pbw), 0, 0, 1, 1},
  {&__pyx_n_s_perm, __pyx_k_perm, sizeof(__pyx_k_perm), 0, 0, 1, 1},
  {&__pyx_n_s_pol2, __pyx_k_pol2, sizeof(__pyx_k_pol2), 0, 0, 1, 1},
  {&__pyx_n_s_polcoeff, __pyx_k_polcoeff, sizeof(__pyx_k_polcoeff), 0, 0, 1, 1},
  {&__pyx_kp_u_polcyclo_n_v_x_cyclotomic_polyn, __pyx_k_polcyclo_n_v_x_cyclotomic_polyn, sizeof(__pyx_k_polcyclo_n_v_x_cyclotomic_polyn), 0, 1, 0, 0},
  {&__pyx_n_s_poldegree, __pyx_k_poldegree, sizeof(__pyx_k_poldegree), 0, 0, 1, 1},
  {&__pyx_kp_u_pollegendre_n_v_x_Legendre_poly, __pyx_k_pollegendre_n_v_x_Legendre_poly, sizeof(__pyx_k_pollegendre_n_v_x_Legendre_poly), 0, 1, 0, 0},
  {&__pyx_n_s_polrel, __pyx_k_polrel, sizeof(__pyx_k_polrel), 0, 0, 1, 1},
  {&__pyx_kp_u_polsubcyclo_n_d_v_x_return_the, __pyx_k_polsubcyclo_n_d_v_x_return_the, sizeof(__pyx_k_polsubcyclo_n_d_v_x_return_the), 0, 1, 0, 0},
  {&__pyx_kp_u_poltchebi_n_v_x_Chebyshev_polyn, __pyx_k_poltchebi_n_v_x_Chebyshev_polyn, sizeof(__pyx_k_poltchebi_n_v_x_Chebyshev_polyn), 0, 1, 0, 0},
  {&__pyx_n_s_poly, __pyx_k_poly, sizeof(__pyx_k_poly), 0, 0, 1, 1},
  {&__pyx_kp_u_prec_bits_to_dec_line_248, __pyx_k_prec_bits_to_dec_line_248, sizeof(__pyx_k_prec_bits_to_dec_line_248), 0, 1, 0, 0},
  {&__pyx_n_s_prec_bits_to_words, __pyx_k_prec_bits_to_words, sizeof(__pyx_k_prec_bits_to_words), 0, 0, 1, 1},
  {&__pyx_kp_u_prec_bits_to_words_line_280, __pyx_k_prec_bits_to_words_line_280, sizeof(__pyx_k_prec_bits_to_words_line_280), 0, 1, 0, 0},
  {&__pyx_kp_u_prec_dec_to_bits_line_264, __pyx_k_prec_dec_to_bits_line_264, sizeof(__pyx_k_prec_dec_to_bits_line_264), 0, 1, 0, 0},
  {&__pyx_kp_u_prec_dec_to_words_line_331, __pyx_k_prec_dec_to_words_line_331, sizeof(__pyx_k_prec_dec_to_words_line_331), 0, 1, 0, 0},
  {&__pyx_n_s_prec_in_bits, __pyx_k_prec_in_bits, sizeof(__pyx_k_prec_in_bits), 0, 0, 1, 1},
  {&__pyx_kp_u_prec_words_to_bits_line_311, __pyx_k_prec_words_to_bits_line_311, sizeof(__pyx_k_prec_words_to_bits_line_311), 0, 1, 0, 0},
  {&__pyx_kp_u_prec_words_to_dec_line_350, __pyx_k_prec_words_to_dec_line_350, sizeof(__pyx_k_prec_words_to_dec_line_350), 0, 1, 0, 0},
  {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_prime_list, __pyx_k_prime_list, sizeof(__pyx_k_prime_list), 0, 0, 1, 1},
  {&__pyx_kp_u_prime_list_n_returns_list_of_th, __pyx_k_prime_list_n_returns_list_of_th, sizeof(__pyx_k_prime_list_n_returns_list_of_th), 0, 1, 0, 0},
  {&__pyx_n_s_primepi, __pyx_k_primepi, sizeof(__pyx_k_primepi), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_proof, __pyx_k_proof, sizeof(__pyx_k_proof), 0, 0, 1, 1},
  {&__pyx_n_s_pysignal, __pyx_k_pysignal, sizeof(__pyx_k_pysignal), 0, 0, 1, 1},
  {&__pyx_n_s_python_ints, __pyx_k_python_ints, sizeof(__pyx_k_python_ints), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_kp_u_q_theta_z_Jacobi_sine_theta_fun, __pyx_k_q_theta_z_Jacobi_sine_theta_fun, sizeof(__pyx_k_q_theta_z_Jacobi_sine_theta_fun), 0, 1, 0, 0},
  {&__pyx_kp_u_q_thetanullk_k_return_the_k_th, __pyx_k_q_thetanullk_k_return_the_k_th, sizeof(__pyx_k_q_thetanullk_k_return_the_k_th), 0, 1, 0, 0},
  {&__pyx_n_s_qflllgram, __pyx_k_qflllgram, sizeof(__pyx_k_qflllgram), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
  {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1},
  {&__pyx_n_s_real_coerced_to_bits_prec, __pyx_k_real_coerced_to_bits_prec, sizeof(__pyx_k_real_coerced_to_bits_prec), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_s_rhs, __pyx_k_rhs, sizeof(__pyx_k_rhs), 0, 0, 1, 1},
  {&__pyx_kp_u_rnfidealdown_rnf_x_finds_the_in, __pyx_k_rnfidealdown_rnf_x_finds_the_in, sizeof(__pyx_k_rnfidealdown_rnf_x_finds_the_in), 0, 1, 0, 0},
  {&__pyx_kp_u_round_x_estimate_False_If_x_is, __pyx_k_round_x_estimate_False_If_x_is, sizeof(__pyx_k_round_x_estimate_False_If_x_is), 0, 1, 0, 0},
  {&__pyx_kp_s_row_i_s_must_be_between_0_and_s, __pyx_k_row_i_s_must_be_between_0_and_s, sizeof(__pyx_k_row_i_s_must_be_between_0_and_s), 0, 0, 1, 0},
  {&__pyx_kp_s_row_index_out_of_bounds, __pyx_k_row_index_out_of_bounds, sizeof(__pyx_k_row_index_out_of_bounds), 0, 0, 1, 0},
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
  {&__pyx_kp_s_s_d, __pyx_k_s_d, sizeof(__pyx_k_s_d), 0, 0, 1, 0},
  {&__pyx_kp_u_s_gamma_precision_Gamma_functio, __pyx_k_s_gamma_precision_Gamma_functio, sizeof(__pyx_k_s_gamma_precision_Gamma_functio), 0, 1, 0, 0},
  {&__pyx_kp_u_s_gammah_Gamma_function_evaluat, __pyx_k_s_gammah_Gamma_function_evaluat, sizeof(__pyx_k_s_gammah_Gamma_function_evaluat), 0, 1, 0, 0},
  {&__pyx_kp_u_s_incgam_x_y_precision_incomple, __pyx_k_s_incgam_x_y_precision_incomple, sizeof(__pyx_k_s_incgam_x_y_precision_incomple), 0, 1, 0, 0},
  {&__pyx_kp_u_s_incgamc_x_complementary_incom, __pyx_k_s_incgamc_x_complementary_incom, sizeof(__pyx_k_s_incgamc_x_complementary_incom), 0, 1, 0, 0},
  {&__pyx_kp_s_s_must_be_nonnegative_and_not_to, __pyx_k_s_must_be_nonnegative_and_not_to, sizeof(__pyx_k_s_must_be_nonnegative_and_not_to), 0, 0, 1, 0},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_kp_u_self_ellchangepoint_y_change_da, __pyx_k_self_ellchangepoint_y_change_da, sizeof(__pyx_k_self_ellchangepoint_y_change_da), 0, 1, 0, 0},
  {&__pyx_kp_s_self_must_be_of_PARI_type_t_MAT, __pyx_k_self_must_be_of_PARI_type_t_MAT, sizeof(__pyx_k_self_must_be_of_PARI_type_t_MAT), 0, 0, 1, 0},
  {&__pyx_n_s_seriesprecision, __pyx_k_seriesprecision, sizeof(__pyx_k_seriesprecision), 0, 0, 1, 1},
  {&__pyx_kp_u_serreverse_f_reversion_of_the_p, __pyx_k_serreverse_f_reversion_of_the_p, sizeof(__pyx_k_serreverse_f_reversion_of_the_p), 0, 1, 0, 0},
  {&__pyx_n_s_set_errnum, __pyx_k_set_errnum, sizeof(__pyx_k_set_errnum), 0, 0, 1, 1},
  {&__pyx_n_s_set_real_precision, __pyx_k_set_real_precision, sizeof(__pyx_k_set_real_precision), 0, 0, 1, 1},
  {&__pyx_n_s_signal, __pyx_k_signal, sizeof(__pyx_k_signal), 0, 0, 1, 1},
  {&__pyx_n_s_silent, __pyx_k_silent, sizeof(__pyx_k_silent), 0, 0, 1, 1},
  {&__pyx_kp_u_simplify_x_Simplify_the_object, __pyx_k_simplify_x_Simplify_the_object, sizeof(__pyx_k_simplify_x_Simplify_the_object), 0, 1, 0, 0},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_kp_u_sizedigit_x_Return_a_quick_esti, __pyx_k_sizedigit_x_Return_a_quick_esti, sizeof(__pyx_k_sizedigit_x_Return_a_quick_esti), 0, 1, 0, 0},
  {&__pyx_n_s_speak_up, __pyx_k_speak_up, sizeof(__pyx_k_speak_up), 0, 0, 1, 1},
  {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_s_str_to_chars, __pyx_k_str_to_chars, sizeof(__pyx_k_str_to_chars), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_t0heap, __pyx_k_t0heap, sizeof(__pyx_k_t0heap), 0, 0, 1, 1},
  {&__pyx_n_s_t_CLOSURE, __pyx_k_t_CLOSURE, sizeof(__pyx_k_t_CLOSURE), 0, 0, 1, 1},
  {&__pyx_n_s_t_COL, __pyx_k_t_COL, sizeof(__pyx_k_t_COL), 0, 0, 1, 1},
  {&__pyx_n_s_t_COMPLEX, __pyx_k_t_COMPLEX, sizeof(__pyx_k_t_COMPLEX), 0, 0, 1, 1},
  {&__pyx_n_s_t_FFELT, __pyx_k_t_FFELT, sizeof(__pyx_k_t_FFELT), 0, 0, 1, 1},
  {&__pyx_n_s_t_FRAC, __pyx_k_t_FRAC, sizeof(__pyx_k_t_FRAC), 0, 0, 1, 1},
  {&__pyx_n_s_t_INT, __pyx_k_t_INT, sizeof(__pyx_k_t_INT), 0, 0, 1, 1},
  {&__pyx_n_s_t_INTMOD, __pyx_k_t_INTMOD, sizeof(__pyx_k_t_INTMOD), 0, 0, 1, 1},
  {&__pyx_n_s_t_LIST, __pyx_k_t_LIST, sizeof(__pyx_k_t_LIST), 0, 0, 1, 1},
  {&__pyx_n_s_t_MAT, __pyx_k_t_MAT, sizeof(__pyx_k_t_MAT), 0, 0, 1, 1},
  {&__pyx_n_s_t_PADIC, __pyx_k_t_PADIC, sizeof(__pyx_k_t_PADIC), 0, 0, 1, 1},
  {&__pyx_n_s_t_POL, __pyx_k_t_POL, sizeof(__pyx_k_t_POL), 0, 0, 1, 1},
  {&__pyx_n_s_t_POLMOD, __pyx_k_t_POLMOD, sizeof(__pyx_k_t_POLMOD), 0, 0, 1, 1},
  {&__pyx_n_s_t_QFI, __pyx_k_t_QFI, sizeof(__pyx_k_t_QFI), 0, 0, 1, 1},
  {&__pyx_n_s_t_QFR, __pyx_k_t_QFR, sizeof(__pyx_k_t_QFR), 0, 0, 1, 1},
  {&__pyx_n_s_t_QUAD, __pyx_k_t_QUAD, sizeof(__pyx_k_t_QUAD), 0, 0, 1, 1},
  {&__pyx_n_s_t_REAL, __pyx_k_t_REAL, sizeof(__pyx_k_t_REAL), 0, 0, 1, 1},
  {&__pyx_n_s_t_RFRAC, __pyx_k_t_RFRAC, sizeof(__pyx_k_t_RFRAC), 0, 0, 1, 1},
  {&__pyx_n_s_t_SER, __pyx_k_t_SER, sizeof(__pyx_k_t_SER), 0, 0, 1, 1},
  {&__pyx_n_s_t_STR, __pyx_k_t_STR, sizeof(__pyx_k_t_STR), 0, 0, 1, 1},
  {&__pyx_n_s_t_VEC, __pyx_k_t_VEC, sizeof(__pyx_k_t_VEC), 0, 0, 1, 1},
  {&__pyx_n_s_t_VECSMALL, __pyx_k_t_VECSMALL, sizeof(__pyx_k_t_VECSMALL), 0, 0, 1, 1},
  {&__pyx_n_s_tech, __pyx_k_tech, sizeof(__pyx_k_tech), 0, 0, 1, 1},
  {&__pyx_kp_u_teichmuller_x_teichmuller_chara, __pyx_k_teichmuller_x_teichmuller_chara, sizeof(__pyx_k_teichmuller_x_teichmuller_chara), 0, 1, 0, 0},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_test_2, __pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 0, 1, 1},
  {&__pyx_n_s_testclass, __pyx_k_testclass, sizeof(__pyx_k_testclass), 0, 0, 1, 1},
  {&__pyx_kp_u_truncate_x_estimate_False_Retur, __pyx_k_truncate_x_estimate_False_Retur, sizeof(__pyx_k_truncate_x_estimate_False_Retur), 0, 1, 0, 0},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
  {&__pyx_kp_s_unindexable_object, __pyx_k_unindexable_object, sizeof(__pyx_k_unindexable_object), 0, 0, 1, 0},
  {&__pyx_n_s_unknown, __pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 0, 1, 1},
  {&__pyx_kp_s_used_by_cypari_gen_d, __pyx_k_used_by_cypari_gen_d, sizeof(__pyx_k_used_by_cypari_gen_d), 0, 0, 1, 0},
  {&__pyx_kp_s_used_d, __pyx_k_used_d, sizeof(__pyx_k_used_d), 0, 0, 1, 0},
  {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1},
  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {&__pyx_kp_u_valuation_x_p_Return_the_valuat, __pyx_k_valuation_x_p_Return_the_valuat, sizeof(__pyx_k_valuation_x_p_Return_the_valuat), 0, 1, 0, 0},
  {&__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_variable, __pyx_k_variable, sizeof(__pyx_k_variable), 0, 0, 1, 1},
  {&__pyx_kp_u_variable_x_Return_the_main_vari, __pyx_k_variable_x_Return_the_main_vari, sizeof(__pyx_k_variable_x_Return_the_main_vari), 0, 1, 0, 0},
  {&__pyx_n_s_vdir, __pyx_k_vdir, sizeof(__pyx_k_vdir), 0, 0, 1, 1},
  {&__pyx_n_s_vecextract, __pyx_k_vecextract, sizeof(__pyx_k_vecextract), 0, 0, 1, 1},
  {&__pyx_n_s_vecsmall_to_intlist, __pyx_k_vecsmall_to_intlist, sizeof(__pyx_k_vecsmall_to_intlist), 0, 0, 1, 1},
  {&__pyx_n_s_vector, __pyx_k_vector, sizeof(__pyx_k_vector), 0, 0, 1, 1},
  {&__pyx_kp_u_vector_long_n_entries_None_Crea, __pyx_k_vector_long_n_entries_None_Crea, sizeof(__pyx_k_vector_long_n_entries_None_Crea), 0, 1, 0, 0},
  {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_kp_u_x_eta_flag_0_if_flag_0_eta_func, __pyx_k_x_eta_flag_0_if_flag_0_eta_func, sizeof(__pyx_k_x_eta_flag_0_if_flag_0_eta_func), 0, 1, 0, 0},
  {&__pyx_kp_u_x_exp_exponential_of_x_If_x_is, __pyx_k_x_exp_exponential_of_x_If_x_is, sizeof(__pyx_k_x_exp_exponential_of_x_If_x_is), 0, 1, 0, 0},
  {&__pyx_kp_u_x_log_natural_logarithm_of_x_Th, __pyx_k_x_log_natural_logarithm_of_x_Th, sizeof(__pyx_k_x_log_natural_logarithm_of_x_Th), 0, 1, 0, 0},
  {&__pyx_kp_u_x_matsnf_flag_0_Smith_normal_fo, __pyx_k_x_matsnf_flag_0_Smith_normal_fo, sizeof(__pyx_k_x_matsnf_flag_0_Smith_normal_fo), 0, 1, 0, 0},
  {&__pyx_kp_s_x_must_be_of_type_t_VEC, __pyx_k_x_must_be_of_type_t_VEC, sizeof(__pyx_k_x_must_be_of_type_t_VEC), 0, 0, 1, 0},
  {&__pyx_kp_u_x_newtonpoly_p_Newton_polygon_o, __pyx_k_x_newtonpoly_p_Newton_polygon_o, sizeof(__pyx_k_x_newtonpoly_p_Newton_polygon_o), 0, 1, 0, 0},
  {&__pyx_kp_u_x_polylog_m_flag_0_m_th_polylog, __pyx_k_x_polylog_m_flag_0_m_th_polylog, sizeof(__pyx_k_x_polylog_m_flag_0_m_th_polylog), 0, 1, 0, 0},
  {&__pyx_kp_u_x_psi_psi_function_at_x_Return, __pyx_k_x_psi_psi_function_at_x_Return, sizeof(__pyx_k_x_psi_psi_function_at_x_Return), 0, 1, 0, 0},
  {&__pyx_kp_s_x_s_must_be_of_type_t_INT_but_is, __pyx_k_x_s_must_be_of_type_t_INT_but_is, sizeof(__pyx_k_x_s_must_be_of_type_t_INT_but_is), 0, 0, 1, 0},
  {&__pyx_kp_s_x_s_must_be_of_type_t_VEC_but_is, __pyx_k_x_s_must_be_of_type_t_VEC_but_is, sizeof(__pyx_k_x_s_must_be_of_type_t_VEC_but_is), 0, 0, 1, 0},
  {&__pyx_kp_u_x_sin_The_sine_of_x_If_x_is_an, __pyx_k_x_sin_The_sine_of_x_If_x_is_an, sizeof(__pyx_k_x_sin_The_sine_of_x_If_x_is_an), 0, 1, 0, 0},
  {&__pyx_kp_u_x_sqr_square_of_x_Faster_than_a, __pyx_k_x_sqr_square_of_x_Faster_than_a, sizeof(__pyx_k_x_sqr_square_of_x_Faster_than_a), 0, 1, 0, 0},
  {&__pyx_kp_u_x_sqrt_precision_The_square_roo, __pyx_k_x_sqrt_precision_The_square_roo, sizeof(__pyx_k_x_sqrt_precision_The_square_roo), 0, 1, 0, 0},
  {&__pyx_kp_u_x_sqrtn_n_return_the_principal, __pyx_k_x_sqrtn_n_return_the_principal, sizeof(__pyx_k_x_sqrtn_n_return_the_principal), 0, 1, 0, 0},
  {&__pyx_kp_u_x_tan_tangent_of_x_If_x_is_an_e, __pyx_k_x_tan_tangent_of_x_If_x_is_an_e, sizeof(__pyx_k_x_tan_tangent_of_x_If_x_is_an_e), 0, 1, 0, 0},
  {&__pyx_kp_u_x_tanh_hyperbolic_tangent_of_x, __pyx_k_x_tanh_hyperbolic_tangent_of_x, sizeof(__pyx_k_x_tanh_hyperbolic_tangent_of_x), 0, 1, 0, 0},
  {&__pyx_kp_u_x_weber_flag_0_One_of_Weber_s_f, __pyx_k_x_weber_flag_0_One_of_Weber_s_f, sizeof(__pyx_k_x_weber_flag_0_One_of_Weber_s_f), 0, 1, 0, 0},
  {&__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},
  {&__pyx_n_s_ya, __pyx_k_ya, sizeof(__pyx_k_ya), 0, 0, 1, 1},
  {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1},
  {&__pyx_n_s_z0, __pyx_k_z0, sizeof(__pyx_k_z0), 0, 0, 1, 1},
  {&__pyx_n_s_z1, __pyx_k_z1, sizeof(__pyx_k_z1), 0, 0, 1, 1},
  {&__pyx_kp_u_zeta_s_zeta_function_at_s_with, __pyx_k_zeta_s_zeta_function_at_s_with, sizeof(__pyx_k_zeta_s_zeta_function_at_s_with), 0, 1, 0, 0},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_n_s_eval); if (!__pyx_builtin_eval) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9899; __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);

  /* "cypari_src/gen.pyx":639
 *         """
 *         if typ(self.g) != t_INTMOD and typ(self.g) != t_POLMOD:
 *             raise TypeError("Not an INTMOD or POLMOD in mod()")             # <<<<<<<<<<<<<<
 *         # The hardcoded 1 below refers to the position in the internal
 *         # representation of a INTMOD or POLDMOD where the modulus is
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Not_an_INTMOD_or_POLMOD_in_mod); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "cypari_src/gen.pyx":688
 *         sig_off()
 *         if not nf:
 *             raise TypeError("Not a PARI number field")             # <<<<<<<<<<<<<<
 *         return nf
 * 
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Not_a_PARI_number_field); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "cypari_src/gen.pyx":1108
 *             # fast exit
 *             if k==0:
 *                 return P.vector(0)             # <<<<<<<<<<<<<<
 *             # fast call, beware pari is one based
 *             if pari_type == t_VEC:
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "cypari_src/gen.pyx":1448
 *         """
 *         s = str(self)
 *         if s[:4] == "Mat(":             # <<<<<<<<<<<<<<
 *             s = "[" + s[4:-1] + "]"
 *         s = s.replace("~","")
 */
  __pyx_slice__7 = PySlice_New(Py_None, __pyx_int_4, Py_None); if (unlikely(!__pyx_slice__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__7);
  __Pyx_GIVEREF(__pyx_slice__7);

  /* "cypari_src/gen.pyx":1449
 *         s = str(self)
 *         if s[:4] == "Mat(":
 *             s = "[" + s[4:-1] + "]"             # <<<<<<<<<<<<<<
 *         s = s.replace("~","")
 *         if s.find(";") != -1:
 */
  __pyx_slice__9 = PySlice_New(__pyx_int_4, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__9);
  __Pyx_GIVEREF(__pyx_slice__9);

  /* "cypari_src/gen.pyx":1450
 *         if s[:4] == "Mat(":
 *             s = "[" + s[4:-1] + "]"
 *         s = s.replace("~","")             # <<<<<<<<<<<<<<
 *         if s.find(";") != -1:
 *             s = s.replace(";","], [")
 */
  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_kp_s__11, __pyx_kp_s__12); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "cypari_src/gen.pyx":1451
 *             s = "[" + s[4:-1] + "]"
 *         s = s.replace("~","")
 *         if s.find(";") != -1:             # <<<<<<<<<<<<<<
 *             s = s.replace(";","], [")
 *             s = "[" + s + "]"
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s__14); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "cypari_src/gen.pyx":1452
 *         s = s.replace("~","")
 *         if s.find(";") != -1:
 *             s = s.replace(";","], [")             # <<<<<<<<<<<<<<
 *             s = "[" + s + "]"
 *             return eval(s)
 */
  __pyx_tuple__17 = PyTuple_Pack(2, __pyx_kp_s__14, __pyx_kp_s__16); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "cypari_src/gen.pyx":1496
 *             -36bb1e3929d1a8fe2802f083
 *         """
 *         return hex(self).replace('0x', '')             # <<<<<<<<<<<<<<
 * 
 *     def __int__(gen self):
 */
  __pyx_tuple__18 = PyTuple_Pack(2, __pyx_kp_s_0x, __pyx_kp_s__12); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "cypari_src/gen.pyx":1987
 *             if n == 0:
 *                 sig_off()
 *                 return False, None             # <<<<<<<<<<<<<<
 *             else:
 *                 return k, P.new_gen(x)
 */
  __pyx_tuple__19 = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "cypari_src/gen.pyx":3551
 *                 _p, _p.type()))
 *         if not gequal(gel(x.g, 2), _p.g):
 *             raise ValueError("not the same prime in padicprec")             # <<<<<<<<<<<<<<
 *         return padicprec(x.g, _p.g)
 * 
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_not_the_same_prime_in_padicprec); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "cypari_src/gen.pyx":6583
 *             [1.26920930427955, -0.634604652139777 - 1.45881661693850*I]
 *         """
 *         return self[14:16]             # <<<<<<<<<<<<<<
 * 
 *     def disc(self):
 */
  __pyx_slice__21 = PySlice_New(__pyx_int_14, __pyx_int_16, Py_None); if (unlikely(!__pyx_slice__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__21);
  __Pyx_GIVEREF(__pyx_slice__21);

  /* "cypari_src/gen.pyx":7919
 * 
 *     def lllgram(self):
 *         return self.qflllgram(0)             # <<<<<<<<<<<<<<
 * 
 *     def lllgramint(self):
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "cypari_src/gen.pyx":7922
 * 
 *     def lllgramint(self):
 *         return self.qflllgram(1)             # <<<<<<<<<<<<<<
 * 
 *     def qfminim(self, B, max, long flag=0):
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "cypari_src/gen.pyx":8410
 *             return self
 *         if typ(self.g) != t_POL and typ(self.g) != t_SER:
 *             raise TypeError("change_variable_name() only works "             # <<<<<<<<<<<<<<
 *                             "for polynomials or power series")
 *         # Copy self and then change the variable in place
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_change_variable_name_only_works); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "cypari_src/gen.pyx":9003
 *         Set the debug PARI C library variable.
 *         """
 *         return int(self.default('debug'))             # <<<<<<<<<<<<<<
 * 
 *     cdef GEN toGEN(self, x, int i) except NULL:
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_debug); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "cypari_src/gen.pyx":9408
 *         """
 *         if s == 0 and not silent:
 *             print( "Doubling the PARI stack." )             # <<<<<<<<<<<<<<
 *         s = int(s)
 *         cdef size_t a = s
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Doubling_the_PARI_stack); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "cypari_src/gen.pyx":10218
 *     if interrupt_flag:
 *         interrupt_flag = 0
 *         raise PariError(-1)             # <<<<<<<<<<<<<<
 *     else:
 *         raise PariError(errno)
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "cypari_src/gen.pyx":10310
 *         print( "BIG WARNING: The number %s wasn't split at all by PARI,"
 *                "but it's definitely composite."%(P[0]) )
 *         print( "This is probably an infinite loop..." )             # <<<<<<<<<<<<<<
 *     w = []
 *     for i in range(len(P)):
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_This_is_probably_an_infinite_loo); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "cypari_src/gen.pyx":186
 * # Our unique PARI instance.
 * cdef PariInstance pari_instance, P
 * pari_instance = PariInstance(16000000, 500000)             # <<<<<<<<<<<<<<
 * P = pari_instance   # shorthand notation
 * cdef GEN pari_nil
 */
  __pyx_tuple__29 = PyTuple_Pack(2, __pyx_int_16000000, __pyx_int_500000); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "cypari_src/gen.pyx":9842
 * 
 * 
 * def init_pari_stack(size=8000000):             # <<<<<<<<<<<<<<
 *     """
 *     Change the PARI scratch stack space to the given size.
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_size); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);
  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_dunfield_work_CyPari_cypa, __pyx_n_s_init_pari_stack, 9842, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cypari_src/gen.pyx":10114
 * class PariError(Exception):
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         TESTS::
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);
  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_dunfield_work_CyPari_cypa, __pyx_n_s_repr, 10114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cypari_src/gen.pyx":10123
 *         return "PariError(%d)"%self.errnum()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s (%d)"%(self.errmessage(self.errnum()), self.errnum())
 * 
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);
  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_dunfield_work_CyPari_cypa, __pyx_n_s_str, 10123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cypari_src/gen.pyx":10126
 *         return "%s (%d)"%(self.errmessage(self.errnum()), self.errnum())
 * 
 *     def errmessage(self, d):             # <<<<<<<<<<<<<<
 *         global noer
 *         if 0 < d <= noer:
 */
  __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_d); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);
  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_dunfield_work_CyPari_cypa, __pyx_n_s_errmessage, 10126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cypari_src/gen.pyx":10135
 *             return "unknown"
 * 
 *     def errnum(self):             # <<<<<<<<<<<<<<
 *         return self.args[0]
 * 
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);
  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_dunfield_work_CyPari_cypa, __pyx_n_s_errnum, 10135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cypari_src/gen.pyx":10138
 *         return self.args[0]
 * 
 *     def set_errnum(self, errnum):             # <<<<<<<<<<<<<<
 *         self.args = (errnum,)
 * 
 */
  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_errnum); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_dunfield_work_CyPari_cypa, __pyx_n_s_set_errnum, 10138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cypari_src/gen.pyx":10279
 *         raise PariError, errno
 * 
 * def vecsmall_to_intlist(gen v):             # <<<<<<<<<<<<<<
 *     """
 *     INPUT:
 */
  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_v, __pyx_n_s_k); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_dunfield_work_CyPari_cypa, __pyx_n_s_vecsmall_to_intlist, 10279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__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_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__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_500000 = PyInt_FromLong(500000L); if (unlikely(!__pyx_int_500000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_8000000 = PyInt_FromLong(8000000L); if (unlikely(!__pyx_int_8000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_16000000 = PyInt_FromLong(16000000L); if (unlikely(!__pyx_int_16000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__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 initgen(void); /*proto*/
PyMODINIT_FUNC initgen(void)
#else
PyMODINIT_FUNC PyInit_gen(void); /*proto*/
PyMODINIT_FUNC PyInit_gen(void)
#endif
{
  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;
  int __pyx_t_7;
  GEN __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_gen(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("gen", __pyx_methods, __pyx_k_PARI_C_library_interface_AUTHOR, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_cypari_src__gen) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "cypari_src.gen")) {
      if (unlikely(PyDict_SetItemString(modules, "cypari_src.gen", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- 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 ---*/
  __pyx_v_10cypari_src_3gen_pari_instance = ((struct __pyx_obj_10cypari_src_3gen_PariInstance *)Py_None); Py_INCREF(Py_None);
  __pyx_v_10cypari_src_3gen_P = ((struct __pyx_obj_10cypari_src_3gen_PariInstance *)Py_None); Py_INCREF(Py_None);
  __pyx_v_10cypari_src_3gen__tmp = ((struct __pyx_obj_10cypari_src_3gen_gen *)Py_None); Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("_Vec_append", (void (*)(void))__pyx_f_10cypari_src_3gen__Vec_append, "GEN (GEN, GEN, long)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Type init code ---*/
  __pyx_vtabptr_10cypari_src_3gen_gen = &__pyx_vtable_10cypari_src_3gen_gen;
  __pyx_vtable_10cypari_src_3gen_gen.init = (void (*)(struct __pyx_obj_10cypari_src_3gen_gen *, GEN, pari_sp))__pyx_f_10cypari_src_3gen_3gen_init;
  __pyx_vtable_10cypari_src_3gen_gen._gen = (GEN (*)(struct __pyx_obj_10cypari_src_3gen_gen *))__pyx_f_10cypari_src_3gen_3gen__gen;
  __pyx_vtable_10cypari_src_3gen_gen.new_gen = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_gen *, GEN))__pyx_f_10cypari_src_3gen_3gen_new_gen;
  __pyx_vtable_10cypari_src_3gen_gen.new_leaf_gen = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_gen *, GEN))__pyx_f_10cypari_src_3gen_3gen_new_leaf_gen;
  __pyx_vtable_10cypari_src_3gen_gen.new_gen_noclear = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_gen *, GEN))__pyx_f_10cypari_src_3gen_3gen_new_gen_noclear;
  __pyx_vtable_10cypari_src_3gen_gen.pari = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_gen *, PyObject *))__pyx_f_10cypari_src_3gen_3gen_pari;
  __pyx_vtable_10cypari_src_3gen_gen._deepcopy_to_python_heap = (GEN (*)(struct __pyx_obj_10cypari_src_3gen_gen *, GEN, pari_sp *, pari_sp))__pyx_f_10cypari_src_3gen_3gen__deepcopy_to_python_heap;
  __pyx_vtable_10cypari_src_3gen_gen.get_var = (long (*)(struct __pyx_obj_10cypari_src_3gen_gen *, PyObject *))__pyx_f_10cypari_src_3gen_3gen_get_var;
  __pyx_vtable_10cypari_src_3gen_gen.get_nf = (GEN (*)(struct __pyx_obj_10cypari_src_3gen_gen *))__pyx_f_10cypari_src_3gen_3gen_get_nf;
  __pyx_vtable_10cypari_src_3gen_gen.compare = (int (*)(struct __pyx_obj_10cypari_src_3gen_gen *, struct __pyx_obj_10cypari_src_3gen_gen *, int))__pyx_f_10cypari_src_3gen_3gen_compare;
  if (PyType_Ready(&__pyx_type_10cypari_src_3gen_gen) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_10cypari_src_3gen_gen.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10cypari_src_3gen_gen, "__hash__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_10cypari_src_3gen_3gen_8__hash__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_10cypari_src_3gen_3gen_8__hash__.doc = __pyx_doc_10cypari_src_3gen_3gen_8__hash__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10cypari_src_3gen_3gen_8__hash__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10cypari_src_3gen_gen, "__getitem__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_10cypari_src_3gen_3gen_72__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_10cypari_src_3gen_3gen_72__getitem__.doc = __pyx_doc_10cypari_src_3gen_3gen_72__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10cypari_src_3gen_3gen_72__getitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10cypari_src_3gen_gen, "__setitem__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_10cypari_src_3gen_3gen_76__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_10cypari_src_3gen_3gen_76__setitem__.doc = __pyx_doc_10cypari_src_3gen_3gen_76__setitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10cypari_src_3gen_3gen_76__setitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10cypari_src_3gen_gen, "__index__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_10cypari_src_3gen_3gen_86__index__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_10cypari_src_3gen_3gen_86__index__.doc = __pyx_doc_10cypari_src_3gen_3gen_86__index__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10cypari_src_3gen_3gen_86__index__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10cypari_src_3gen_gen, "__int__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_10cypari_src_3gen_3gen_90__int__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_10cypari_src_3gen_3gen_90__int__.doc = __pyx_doc_10cypari_src_3gen_3gen_90__int__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10cypari_src_3gen_3gen_90__int__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10cypari_src_3gen_gen, "__float__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_10cypari_src_3gen_3gen_100__float__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_10cypari_src_3gen_3gen_100__float__.doc = __pyx_doc_10cypari_src_3gen_3gen_100__float__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10cypari_src_3gen_3gen_100__float__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_10cypari_src_3gen_gen.tp_dict, __pyx_vtabptr_10cypari_src_3gen_gen) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "gen", (PyObject *)&__pyx_type_10cypari_src_3gen_gen) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_10cypari_src_3gen_gen = &__pyx_type_10cypari_src_3gen_gen;
  __pyx_vtabptr_10cypari_src_3gen_PariInstance = &__pyx_vtable_10cypari_src_3gen_PariInstance;
  __pyx_vtable_10cypari_src_3gen_PariInstance.new_gen = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN))__pyx_f_10cypari_src_3gen_12PariInstance_new_gen;
  __pyx_vtable_10cypari_src_3gen_PariInstance.new_gen_with_sp = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN))__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_with_sp;
  __pyx_vtable_10cypari_src_3gen_PariInstance.new_leaf_gen = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN))__pyx_f_10cypari_src_3gen_12PariInstance_new_leaf_gen;
  __pyx_vtable_10cypari_src_3gen_PariInstance.new_gen_to_bytes = (PyObject *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN))__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_to_bytes;
  __pyx_vtable_10cypari_src_3gen_PariInstance.new_gen_noclear = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN))__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_noclear;
  __pyx_vtable_10cypari_src_3gen_PariInstance.new_gen_from_int = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, int))__pyx_f_10cypari_src_3gen_12PariInstance_new_gen_from_int;
  __pyx_vtable_10cypari_src_3gen_PariInstance.new_t_POL_from_int_star = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, int *, int, long))__pyx_f_10cypari_src_3gen_12PariInstance_new_t_POL_from_int_star;
  __pyx_vtable_10cypari_src_3gen_PariInstance.clear_stack = (void (*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *))__pyx_f_10cypari_src_3gen_12PariInstance_clear_stack;
  __pyx_vtable_10cypari_src_3gen_PariInstance.set_mytop_to_avma = (void (*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *))__pyx_f_10cypari_src_3gen_12PariInstance_set_mytop_to_avma;
  __pyx_vtable_10cypari_src_3gen_PariInstance.double_to_gen_c = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, double))__pyx_f_10cypari_src_3gen_12PariInstance_double_to_gen_c;
  __pyx_vtable_10cypari_src_3gen_PariInstance._real_coerced_to_bits_prec = (PyObject *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, double, long, int __pyx_skip_dispatch))__pyx_f_10cypari_src_3gen_12PariInstance__real_coerced_to_bits_prec;
  __pyx_vtable_10cypari_src_3gen_PariInstance.double_to_GEN = (GEN (*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, double))__pyx_f_10cypari_src_3gen_12PariInstance_double_to_GEN;
  __pyx_vtable_10cypari_src_3gen_PariInstance.deepcopy_to_python_heap = (GEN (*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN, pari_sp *, pari_sp))__pyx_f_10cypari_src_3gen_12PariInstance_deepcopy_to_python_heap;
  __pyx_vtable_10cypari_src_3gen_PariInstance.new_ref = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, GEN, struct __pyx_obj_10cypari_src_3gen_gen *))__pyx_f_10cypari_src_3gen_12PariInstance_new_ref;
  __pyx_vtable_10cypari_src_3gen_PariInstance._empty_vector = (struct __pyx_obj_10cypari_src_3gen_gen *(*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, long))__pyx_f_10cypari_src_3gen_12PariInstance__empty_vector;
  __pyx_vtable_10cypari_src_3gen_PariInstance.get_var = (long (*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, PyObject *))__pyx_f_10cypari_src_3gen_12PariInstance_get_var;
  __pyx_vtable_10cypari_src_3gen_PariInstance.toGEN = (GEN (*)(struct __pyx_obj_10cypari_src_3gen_PariInstance *, PyObject *, int))__pyx_f_10cypari_src_3gen_12PariInstance_toGEN;
  if (PyType_Ready(&__pyx_type_10cypari_src_3gen_PariInstance) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_10cypari_src_3gen_PariInstance.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10cypari_src_3gen_PariInstance, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_10cypari_src_3gen_12PariInstance___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_10cypari_src_3gen_12PariInstance___init__.doc = __pyx_doc_10cypari_src_3gen_12PariInstance___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10cypari_src_3gen_12PariInstance___init__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10cypari_src_3gen_PariInstance, "__call__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_10cypari_src_3gen_12PariInstance_40__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_10cypari_src_3gen_12PariInstance_40__call__.doc = __pyx_doc_10cypari_src_3gen_12PariInstance_40__call__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10cypari_src_3gen_12PariInstance_40__call__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_10cypari_src_3gen_PariInstance.tp_dict, __pyx_vtabptr_10cypari_src_3gen_PariInstance) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "PariInstance", (PyObject *)&__pyx_type_10cypari_src_3gen_PariInstance) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_10cypari_src_3gen_PariInstance = &__pyx_type_10cypari_src_3gen_PariInstance;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "cypari_src/gen.pyx":156
 * 
 * from __future__ import print_function
 * try:             # <<<<<<<<<<<<<<
 *     from future_builtins import hex
 * except ImportError: # Python 3
 */
  {
    __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:*/ {

      /* "cypari_src/gen.pyx":157
 * from __future__ import print_function
 * try:
 *     from future_builtins import hex             # <<<<<<<<<<<<<<
 * except ImportError: # Python 3
 *     pass
 */
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_n_s_hex);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_hex);
      __Pyx_GIVEREF(__pyx_n_s_hex);
      __pyx_t_5 = __Pyx_Import(__pyx_n_s_future_builtins, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_hex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_hex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __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_L9_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cypari_src/gen.pyx":158
 * try:
 *     from future_builtins import hex
 * except ImportError: # Python 3             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      PyErr_Restore(0,0,0);
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;
    __pyx_L4_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_L3_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_L9_try_end:;
  }

  /* "cypari_src/gen.pyx":168
 * 
 * # Size of pari "longword"
 * cdef int sizeof_pari_word = BITS_IN_LONG >> 3             # <<<<<<<<<<<<<<
 * 
 * import sys
 */
  __pyx_v_10cypari_src_3gen_sizeof_pari_word = (BITS_IN_LONG >> 3);

  /* "cypari_src/gen.pyx":170
 * cdef int sizeof_pari_word = BITS_IN_LONG >> 3
 * 
 * import sys             # <<<<<<<<<<<<<<
 * import math
 * import types
 */
  __pyx_t_5 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cypari_src/gen.pyx":171
 * 
 * import sys
 * import math             # <<<<<<<<<<<<<<
 * import types
 * import operator
 */
  __pyx_t_5 = __Pyx_Import(__pyx_n_s_math, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cypari_src/gen.pyx":172
 * import sys
 * import math
 * import types             # <<<<<<<<<<<<<<
 * import operator
 * import signal as pysignal
 */
  __pyx_t_5 = __Pyx_Import(__pyx_n_s_types, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cypari_src/gen.pyx":173
 * import math
 * import types
 * import operator             # <<<<<<<<<<<<<<
 * import signal as pysignal
 * 
 */
  __pyx_t_5 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cypari_src/gen.pyx":174
 * import types
 * import operator
 * import signal as pysignal             # <<<<<<<<<<<<<<
 * 
 * if sys.version_info[0] == 3: # Python 3
 */
  __pyx_t_5 = __Pyx_Import(__pyx_n_s_signal, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pysignal, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cypari_src/gen.pyx":176
 * import signal as pysignal
 * 
 * if sys.version_info[0] == 3: # Python 3             # <<<<<<<<<<<<<<
 *     xrange = range
 *     str_to_chars = lambda s : bytes(s, 'utf8')
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_version_info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __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_RichCompare(__pyx_t_5, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_7) {

    /* "cypari_src/gen.pyx":177
 * 
 * if sys.version_info[0] == 3: # Python 3
 *     xrange = range             # <<<<<<<<<<<<<<
 *     str_to_chars = lambda s : bytes(s, 'utf8')
 *     chars_to_str = lambda b : b.decode()
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_xrange, __pyx_builtin_range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cypari_src/gen.pyx":178
 * if sys.version_info[0] == 3: # Python 3
 *     xrange = range
 *     str_to_chars = lambda s : bytes(s, 'utf8')             # <<<<<<<<<<<<<<
 *     chars_to_str = lambda b : b.decode()
 * else: # Python 2
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_16lambda1, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_cypari_src_gen, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_str_to_chars, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cypari_src/gen.pyx":179
 *     xrange = range
 *     str_to_chars = lambda s : bytes(s, 'utf8')
 *     chars_to_str = lambda b : b.decode()             # <<<<<<<<<<<<<<
 * else: # Python 2
 *     str_to_chars = lambda s : s
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_17lambda2, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_cypari_src_gen, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_chars_to_str, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L10;
  }
  /*else*/ {

    /* "cypari_src/gen.pyx":181
 *     chars_to_str = lambda b : b.decode()
 * else: # Python 2
 *     str_to_chars = lambda s : s             # <<<<<<<<<<<<<<
 *     chars_to_str = lambda s : s
 * 
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_18lambda3, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_cypari_src_gen, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_str_to_chars, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cypari_src/gen.pyx":182
 * else: # Python 2
 *     str_to_chars = lambda s : s
 *     chars_to_str = lambda s : s             # <<<<<<<<<<<<<<
 * 
 * # Our unique PARI instance.
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_19lambda4, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_cypari_src_gen, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_chars_to_str, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L10:;

  /* "cypari_src/gen.pyx":186
 * # Our unique PARI instance.
 * cdef PariInstance pari_instance, P
 * pari_instance = PariInstance(16000000, 500000)             # <<<<<<<<<<<<<<
 * P = pari_instance   # shorthand notation
 * cdef GEN pari_nil
 */
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_10cypari_src_3gen_PariInstance)), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_10cypari_src_3gen_pari_instance));
  __Pyx_DECREF_SET(__pyx_v_10cypari_src_3gen_pari_instance, ((struct __pyx_obj_10cypari_src_3gen_PariInstance *)__pyx_t_4));
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":187
 * cdef PariInstance pari_instance, P
 * pari_instance = PariInstance(16000000, 500000)
 * P = pari_instance   # shorthand notation             # <<<<<<<<<<<<<<
 * cdef GEN pari_nil
 * pari_nil = gnil
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_10cypari_src_3gen_pari_instance));
  __Pyx_XGOTREF(((PyObject *)__pyx_v_10cypari_src_3gen_P));
  __Pyx_DECREF_SET(__pyx_v_10cypari_src_3gen_P, __pyx_v_10cypari_src_3gen_pari_instance);
  __Pyx_GIVEREF(((PyObject *)__pyx_v_10cypari_src_3gen_pari_instance));

  /* "cypari_src/gen.pyx":189
 * P = pari_instance   # shorthand notation
 * cdef GEN pari_nil
 * pari_nil = gnil             # <<<<<<<<<<<<<<
 * 
 * # Create some standard gens.
 */
  __pyx_v_10cypari_src_3gen_pari_nil = gnil;

  /* "cypari_src/gen.pyx":195
 * # parent is not constructed yet
 * # new_gen_noclear is used here to avoid calling sig_on
 * pari_instance.PARI_ZERO = pari_instance.new_gen_noclear(gen_0)             # <<<<<<<<<<<<<<
 * pari_instance.PARI_ONE  = pari_instance.new_gen_noclear(gen_1)
 * pari_instance.PARI_TWO  = pari_instance.new_gen_noclear(gen_2)
 */
  __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_pari_instance->__pyx_vtab)->new_gen_noclear(__pyx_v_10cypari_src_3gen_pari_instance, gen_0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_10cypari_src_3gen_pari_instance->PARI_ZERO);
  __Pyx_DECREF(((PyObject *)__pyx_v_10cypari_src_3gen_pari_instance->PARI_ZERO));
  __pyx_v_10cypari_src_3gen_pari_instance->PARI_ZERO = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":196
 * # new_gen_noclear is used here to avoid calling sig_on
 * pari_instance.PARI_ZERO = pari_instance.new_gen_noclear(gen_0)
 * pari_instance.PARI_ONE  = pari_instance.new_gen_noclear(gen_1)             # <<<<<<<<<<<<<<
 * pari_instance.PARI_TWO  = pari_instance.new_gen_noclear(gen_2)
 * # Used in integer factorization
 */
  __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_pari_instance->__pyx_vtab)->new_gen_noclear(__pyx_v_10cypari_src_3gen_pari_instance, gen_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_10cypari_src_3gen_pari_instance->PARI_ONE);
  __Pyx_DECREF(((PyObject *)__pyx_v_10cypari_src_3gen_pari_instance->PARI_ONE));
  __pyx_v_10cypari_src_3gen_pari_instance->PARI_ONE = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":197
 * pari_instance.PARI_ZERO = pari_instance.new_gen_noclear(gen_0)
 * pari_instance.PARI_ONE  = pari_instance.new_gen_noclear(gen_1)
 * pari_instance.PARI_TWO  = pari_instance.new_gen_noclear(gen_2)             # <<<<<<<<<<<<<<
 * # Used in integer factorization
 * cdef gen _tmp = pari_instance.new_gen_noclear(gp_read_str('1000000000000000'))
 */
  __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_pari_instance->__pyx_vtab)->new_gen_noclear(__pyx_v_10cypari_src_3gen_pari_instance, gen_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_10cypari_src_3gen_pari_instance->PARI_TWO);
  __Pyx_DECREF(((PyObject *)__pyx_v_10cypari_src_3gen_pari_instance->PARI_TWO));
  __pyx_v_10cypari_src_3gen_pari_instance->PARI_TWO = ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":199
 * pari_instance.PARI_TWO  = pari_instance.new_gen_noclear(gen_2)
 * # Used in integer factorization
 * cdef gen _tmp = pari_instance.new_gen_noclear(gp_read_str('1000000000000000'))             # <<<<<<<<<<<<<<
 * cdef GEN ten_to_15 = _tmp.g
 * 
 */
  __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_10cypari_src_3gen_PariInstance *)__pyx_v_10cypari_src_3gen_pari_instance->__pyx_vtab)->new_gen_noclear(__pyx_v_10cypari_src_3gen_pari_instance, gp_read_str(__pyx_k_1000000000000000))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_10cypari_src_3gen__tmp));
  __Pyx_DECREF_SET(__pyx_v_10cypari_src_3gen__tmp, ((struct __pyx_obj_10cypari_src_3gen_gen *)__pyx_t_4));
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":200
 * # Used in integer factorization
 * cdef gen _tmp = pari_instance.new_gen_noclear(gp_read_str('1000000000000000'))
 * cdef GEN ten_to_15 = _tmp.g             # <<<<<<<<<<<<<<
 * 
 * # Used by new_gen_with_sp, which improves speed of new_gen a bit,
 */
  __pyx_t_8 = __pyx_v_10cypari_src_3gen__tmp->g;
  __pyx_v_10cypari_src_3gen_ten_to_15 = __pyx_t_8;

  /* "cypari_src/gen.pyx":215
 * # so Galois groups are represented in a sane way
 * # See the polgalois section of the PARI users manual.
 * new_galois_format = 1             # <<<<<<<<<<<<<<
 * 
 * # This should only change if something is left permanently on
 */
  new_galois_format = 1;

  /* "cypari_src/gen.pyx":309
 *     return int(padded_bits/wordsize + 2)
 * 
 * pbw = prec_bits_to_words             # <<<<<<<<<<<<<<
 * 
 * cpdef prec_words_to_bits(int prec_in_words):
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_prec_bits_to_words); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pbw, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":370
 * # Also a copy of PARI accessible from external pure python code.
 * # Usually this is all that you need to import from pari.
 * pari = pari_instance             # <<<<<<<<<<<<<<
 * 
 * # temp variables
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pari, ((PyObject *)__pyx_v_10cypari_src_3gen_pari_instance)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cypari_src/gen.pyx":374
 * # temp variables
 * cdef GEN t0,t1,t2,t3,t4
 * t0heap = [0]*5             # <<<<<<<<<<<<<<
 * 
 * cdef t0GEN(x):
 */
  __pyx_t_4 = PyList_New(1 * 5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < 5; __pyx_temp++) {
      __Pyx_INCREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
    }
  }
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_t0heap, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":9842
 * 
 * 
 * def init_pari_stack(size=8000000):             # <<<<<<<<<<<<<<
 *     """
 *     Change the PARI scratch stack space to the given size.
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_13init_pari_stack, NULL, __pyx_n_s_cypari_src_gen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_pari_stack, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":10112
 * 
 * # Our exception class for PARI exceptions.
 * class PariError(Exception):             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_n_s_PariError, __pyx_n_s_PariError, (PyObject *) NULL, __pyx_n_s_cypari_src_gen, (PyObject *) NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);

  /* "cypari_src/gen.pyx":10114
 * class PariError(Exception):
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         r"""
 *         TESTS::
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_9PariError_1__repr__, 0, __pyx_n_s_PariError___repr, NULL, __pyx_n_s_cypari_src_gen, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_repr, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cypari_src/gen.pyx":10123
 *         return "PariError(%d)"%self.errnum()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s (%d)"%(self.errmessage(self.errnum()), self.errnum())
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_9PariError_3__str__, 0, __pyx_n_s_PariError___str, NULL, __pyx_n_s_cypari_src_gen, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_str, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cypari_src/gen.pyx":10126
 *         return "%s (%d)"%(self.errmessage(self.errnum()), self.errnum())
 * 
 *     def errmessage(self, d):             # <<<<<<<<<<<<<<
 *         global noer
 *         if 0 < d <= noer:
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_9PariError_5errmessage, 0, __pyx_n_s_PariError_errmessage, NULL, __pyx_n_s_cypari_src_gen, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_errmessage, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cypari_src/gen.pyx":10135
 *             return "unknown"
 * 
 *     def errnum(self):             # <<<<<<<<<<<<<<
 *         return self.args[0]
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_9PariError_7errnum, 0, __pyx_n_s_PariError_errnum, NULL, __pyx_n_s_cypari_src_gen, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_errnum, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cypari_src/gen.pyx":10138
 *         return self.args[0]
 * 
 *     def set_errnum(self, errnum):             # <<<<<<<<<<<<<<
 *         self.args = (errnum,)
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_9PariError_9set_errnum, 0, __pyx_n_s_PariError_set_errnum, NULL, __pyx_n_s_cypari_src_gen, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_set_errnum, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cypari_src/gen.pyx":10112
 * 
 * # Our exception class for PARI exceptions.
 * class PariError(Exception):             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_PariError, __pyx_t_4, __pyx_t_9, NULL, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PariError, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":10151
 *     void   set_sigint_handler( void(*)() )
 *     int    sig_on "SIG_ON_MACRO" ()
 * setjmp_active = 0             # <<<<<<<<<<<<<<
 * interrupt_flag = 0
 * cdef public jmp_buf jmp_env
 */
  setjmp_active = 0;

  /* "cypari_src/gen.pyx":10152
 *     int    sig_on "SIG_ON_MACRO" ()
 * setjmp_active = 0
 * interrupt_flag = 0             # <<<<<<<<<<<<<<
 * cdef public jmp_buf jmp_env
 * 
 */
  interrupt_flag = 0;

  /* "cypari_src/gen.pyx":10245
 * # this module trashes Python's default SIGINT handler.
 * 
 * pysignal.signal(pysignal.SIGINT, pysignal.default_int_handler)             # <<<<<<<<<<<<<<
 * 
 * #####################################
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysignal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_signal); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysignal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_SIGINT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysignal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_default_int_handler); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_12 = 1;
    }
  }
  __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  if (__pyx_t_5) {
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":10279
 *         raise PariError, errno
 * 
 * def vecsmall_to_intlist(gen v):             # <<<<<<<<<<<<<<
 *     """
 *     INPUT:
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10cypari_src_3gen_15vecsmall_to_intlist, NULL, __pyx_n_s_cypari_src_gen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_vecsmall_to_intlist, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cypari_src/gen.pyx":1
 * """             # <<<<<<<<<<<<<<
 * PARI C-library interface
 * 
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_prec_bits_to_dec_line_248, __pyx_kp_u_Convert_from_precision_expresse) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_prec_dec_to_bits_line_264, __pyx_kp_u_Convert_from_precision_expresse_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_prec_bits_to_words_line_280, __pyx_kp_u_Convert_from_precision_expresse_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_prec_words_to_bits_line_311, __pyx_kp_u_Convert_from_pari_real_precisio) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_prec_dec_to_words_line_331, __pyx_kp_u_Convert_from_precision_expresse_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_prec_words_to_dec_line_350, __pyx_kp_u_Convert_from_precision_expresse_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen___hash___line_432, __pyx_kp_u_Return_the_hash_of_self_compute) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_list_line_458, __pyx_kp_u_Convert_self_to_a_list_of_PARI) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen__add_one_line_556, __pyx_kp_u_Return_self_1_OUTPUT_pari_gen_E) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_mod_line_623, __pyx_kp_u_Given_an_INTMOD_or_POLMOD_Mod_a) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nf_get_pol_line_691, __pyx_kp_u_Returns_the_defining_polynomial) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nf_get_diff_line_724, __pyx_kp_u_Returns_the_different_of_this_n) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nf_get_sign_line_744, __pyx_kp_u_Returns_a_Python_list_r1_r2_whe) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nf_get_zk_line_772, __pyx_kp_u_Returns_a_vector_with_a_ZZ_basi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bnf_get_no_line_792, __pyx_kp_u_Returns_the_class_number_of_sel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bnf_get_cyc_line_805, __pyx_kp_u_Returns_the_structure_of_the_cl) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bnf_get_gen_line_821, __pyx_kp_u_Returns_a_vector_of_generators) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bnf_get_reg_line_837, __pyx_kp_u_Returns_the_regulator_of_this_n) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_pr_get_p_line_852, __pyx_kp_u_Returns_the_prime_of_ZZ_lying_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_pr_get_e_line_870, __pyx_kp_u_Returns_the_ramification_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_pr_get_f_line_893, __pyx_kp_u_Returns_the_residue_class_degre) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_pr_get_gen_line_916, __pyx_kp_u_Returns_the_second_generator_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bid_get_cyc_line_937, __pyx_kp_u_Returns_the_structure_of_the_gr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bid_get_gen_line_955, __pyx_kp_u_Returns_a_vector_of_generators_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen___getitem___line_982, __pyx_kp_u_Return_the_nth_entry_of_self_Th) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen__gen_length_line_1196, __pyx_kp_u_Return_the_length_of_self_as_a) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen___setitem___line_1211, __pyx_kp_u_Set_the_nth_entry_to_a_referenc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen___index___line_1458, __pyx_kp_u_Return_a_python_integer_represe) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_hex_line_1477, __pyx_kp_u_Return_a_string_containing_the) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen___int___line_1498, __pyx_kp_u_Return_Python_int_Very_fast_and) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_intvec_unsafe_line_1563, __pyx_kp_u_Returns_Python_int_list_form_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_python_list_small_line_1604, __pyx_kp_u_Return_a_Python_list_of_the_PAR) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_python_list_line_1627, __pyx_kp_u_Return_a_Python_list_of_the_PAR_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen___complex___line_1673, __pyx_kp_u_Return_self_as_a_Python_complex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_gequal_line_1724, __pyx_kp_u_Check_whether_a_and_b_are_equal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_gequal0_line_1758, __pyx_kp_u_Check_whether_a_is_equal_to_zer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_gequal_long_line_1778, __pyx_kp_u_Check_whether_a_is_equal_to_the) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_isprime_line_1809, __pyx_kp_u_isprime_x_flag_0_Returns_True_i) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_qfbhclassno_line_1848, __pyx_kp_u_Computes_the_Hurwitz_Kronecker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ispseudoprime_line_1889, __pyx_kp_u_ispseudoprime_x_flag_0_Returns) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ispower_line_1928, __pyx_kp_u_Determine_whether_or_not_self_i) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Col_line_2080, __pyx_kp_u_Transform_the_object_x_into_a_c) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Colrev_line_2127, __pyx_kp_u_Transform_the_object_x_into_a_c_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_List_line_2180, __pyx_kp_u_List_x_transforms_the_PARI_vect) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Mat_line_2200, __pyx_kp_u_Mat_x_Returns_the_matrix_define) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Mod_line_2263, __pyx_kp_u_Mod_x_y_Returns_the_object_x_mo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Pol_line_2324, __pyx_kp_u_Pol_x_v_convert_x_into_a_polyno) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Polrev_line_2383, __pyx_kp_u_Polrev_x_v_Convert_x_into_a_pol) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Qfb_line_2423, __pyx_kp_u_Qfb_a_b_c_D_0_Returns_the_binar) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Ser_line_2475, __pyx_kp_u_Ser_x_v_x_Create_a_power_series) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Set_line_2532, __pyx_kp_u_Set_x_convert_x_into_a_set_i_e) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Str_line_2567, __pyx_kp_u_Str_self_Return_the_print_repre) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Strchr_line_2607, __pyx_kp_u_Strchr_x_converts_x_to_a_string) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Strtex_line_2657, __pyx_kp_u_Strtex_x_Translates_the_vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Vec_line_2694, __pyx_kp_u_Transform_the_object_x_into_a_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Vecrev_line_2752, __pyx_kp_u_Transform_the_object_x_into_a_v_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_Vecsmall_line_2799, __pyx_kp_u_Transform_the_object_x_into_a_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_binary_line_2841, __pyx_kp_u_binary_x_gives_the_vector_forme) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bitand_line_2881, __pyx_kp_u_bitand_x_y_Bitwise_and_of_two_i) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bitneg_line_2922, __pyx_kp_u_bitneg_x_n_1_Bitwise_negation_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bitnegimply_line_2968, __pyx_kp_u_bitnegimply_x_y_Bitwise_negated) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bitor_line_3002, __pyx_kp_u_bitor_x_y_Bitwise_or_of_two_int) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bittest_line_3037, __pyx_kp_u_bittest_x_long_n_Returns_bit_nu) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bitxor_line_3078, __pyx_kp_u_bitxor_x_y_Bitwise_exclusive_or) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ceil_line_3111, __pyx_kp_u_For_real_x_return_the_smallest) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_centerlift_line_3153, __pyx_kp_u_centerlift_x_v_Centered_lift_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_component_line_3192, __pyx_kp_u_component_x_long_n_Return_n_th) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_conj_line_3238, __pyx_kp_u_conj_x_Return_the_algebraic_con) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_conjvec_line_3270, __pyx_kp_u_conjvec_x_Returns_the_vector_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_denominator_line_3294, __pyx_kp_u_denominator_x_Return_the_denomi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_floor_line_3324, __pyx_kp_u_For_real_x_return_the_largest_i) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_frac_line_3367, __pyx_kp_u_frac_x_Return_the_fractional_pa) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_imag_line_3393, __pyx_kp_u_imag_x_Return_the_imaginary_par) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_lift_line_3430, __pyx_kp_u_lift_x_v_Returns_the_lift_of_an) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_numbpart_line_3465, __pyx_kp_u_numbpart_x_returns_the_number_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_padicprec_line_3522, __pyx_kp_u_padicprec_x_p_Return_the_absolu) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_padicprime_line_3554, __pyx_kp_u_The_uniformizer_of_the_p_adic_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_round_line_3665, __pyx_kp_u_round_x_estimate_False_If_x_is) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_simplify_line_3721, __pyx_kp_u_simplify_x_Simplify_the_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_sizeword_line_3762, __pyx_kp_u_Return_the_total_number_of_mach) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_sizebyte_line_3795, __pyx_kp_u_Return_the_total_number_of_byte) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_sizedigit_line_3814, __pyx_kp_u_sizedigit_x_Return_a_quick_esti) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_truncate_line_3858, __pyx_kp_u_truncate_x_estimate_False_Retur) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_valuation_line_3921, __pyx_kp_u_valuation_x_p_Return_the_valuat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen__valp_line_3997, __pyx_kp_u_Return_the_valuation_of_x_where) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_variable_line_4019, __pyx_kp_u_variable_x_Return_the_main_vari) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_abs_line_4056, __pyx_kp_u_Returns_the_absolute_value_of_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_acos_line_4082, __pyx_kp_u_The_principal_branch_of_cos_1_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_acosh_line_4107, __pyx_kp_u_The_principal_branch_of_cosh_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_agm_line_4131, __pyx_kp_u_The_arithmetic_geometric_mean_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_arg_line_4160, __pyx_kp_u_arg_x_argument_of_x_such_that_p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_asin_line_4177, __pyx_kp_u_The_principal_branch_of_sin_1_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_asinh_line_4199, __pyx_kp_u_The_principal_branch_of_sinh_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_atan_line_4219, __pyx_kp_u_The_principal_branch_of_tan_1_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_atanh_line_4239, __pyx_kp_u_The_principal_branch_of_tanh_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bernfrac_line_4261, __pyx_kp_u_The_Bernoulli_number_B_x_where) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bernreal_line_4278, __pyx_kp_u_The_Bernoulli_number_B_x_as_for) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_bernvec_line_4293, __pyx_kp_u_Creates_a_vector_containing_as) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_besselh1_line_4314, __pyx_kp_u_The_H_1_Bessel_function_of_inde) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_besselh2_line_4334, __pyx_kp_u_The_H_2_Bessel_function_of_inde) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_besselj_line_4354, __pyx_kp_u_Bessel_J_function_Bessel_functi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_besseljh_line_4377, __pyx_kp_u_J_Bessel_function_of_half_integ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_besseli_line_4401, __pyx_kp_u_Bessel_I_function_Bessel_functi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_besselk_line_4426, __pyx_kp_u_nu_besselk_x_flag_0_K_Bessel_fu) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_besseln_line_4468, __pyx_kp_u_nu_besseln_x_Bessel_N_function) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_cos_line_4488, __pyx_kp_u_The_cosine_function_If_x_is_an) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_cosh_line_4509, __pyx_kp_u_The_hyperbolic_cosine_function) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_cotan_line_4530, __pyx_kp_u_The_cotangent_of_x_If_x_is_an_e) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_dilog_line_4557, __pyx_kp_u_The_principal_branch_of_the_dil) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_erfc_line_4608, __pyx_kp_u_Return_the_complementary_error) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_eta_line_4631, __pyx_kp_u_x_eta_flag_0_if_flag_0_eta_func) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_exp_line_4660, __pyx_kp_u_x_exp_exponential_of_x_If_x_is) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_gamma_line_4681, __pyx_kp_u_s_gamma_precision_Gamma_functio) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_gammah_line_4709, __pyx_kp_u_s_gammah_Gamma_function_evaluat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_hyperu_line_4730, __pyx_kp_u_a_hyperu_b_x_U_confluent_hyperg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_incgam_line_4750, __pyx_kp_u_s_incgam_x_y_precision_incomple) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_incgamc_line_4773, __pyx_kp_u_s_incgamc_x_complementary_incom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_log_line_4799, __pyx_kp_u_x_log_natural_logarithm_of_x_Th) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_log_gamma_line_4841, __pyx_kp_u_Logarithm_of_the_gamma_function) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_polylog_line_4867, __pyx_kp_u_x_polylog_m_flag_0_m_th_polylog) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_psi_line_4895, __pyx_kp_u_x_psi_psi_function_at_x_Return) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_sin_line_4915, __pyx_kp_u_x_sin_The_sine_of_x_If_x_is_an) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_sinh_line_4934, __pyx_kp_u_The_hyperbolic_sine_function_If) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_sqr_line_4953, __pyx_kp_u_x_sqr_square_of_x_Faster_than_a) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_sqrt_line_4980, __pyx_kp_u_x_sqrt_precision_The_square_roo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_sqrtn_line_4997, __pyx_kp_u_x_sqrtn_n_return_the_principal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_tan_line_5055, __pyx_kp_u_x_tan_tangent_of_x_If_x_is_an_e) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_tanh_line_5074, __pyx_kp_u_x_tanh_hyperbolic_tangent_of_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_teichmuller_line_5098, __pyx_kp_u_teichmuller_x_teichmuller_chara) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_theta_line_5113, __pyx_kp_u_q_theta_z_Jacobi_sine_theta_fun) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_thetanullk_line_5132, __pyx_kp_u_q_thetanullk_k_return_the_k_th) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_weber_line_5149, __pyx_kp_u_x_weber_flag_0_One_of_Weber_s_f) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_zeta_line_5178, __pyx_kp_u_zeta_s_zeta_function_at_s_with) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_binomial_line_5243, __pyx_kp_u_binomial_x_k_return_the_binomia) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_fibonacci_line_5287, __pyx_kp_u_Return_the_Fibonacci_number_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_issquarefree_line_5334, __pyx_kp_u_EXAMPLES_pari_10_issquarefree_T) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_lcm_line_5348, __pyx_kp_u_Return_the_least_common_multipl) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_numdiv_line_5359, __pyx_kp_u_Return_the_number_of_divisors_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_phi_line_5371, __pyx_kp_u_Return_the_Euler_phi_function_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_primepi_line_5381, __pyx_kp_u_Return_the_number_of_primes_les) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_sumdiv_line_5411, __pyx_kp_u_Return_the_sum_of_the_divisors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_sumdivk_line_5423, __pyx_kp_u_Return_the_sum_of_the_k_th_powe) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_xgcd_line_5435, __pyx_kp_u_Returns_u_v_d_such_that_d_gcd_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellinit_line_5451, __pyx_kp_u_Return_the_PARI_elliptic_curve) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellglobalred_line_5524, __pyx_kp_u_e_ellglobalred_return_informati) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_elladd_line_5559, __pyx_kp_u_e_elladd_z0_z1_return_the_sum_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellak_line_5595, __pyx_kp_u_e_ellak_n_Returns_the_coefficie) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellan_line_5634, __pyx_kp_u_Return_the_first_n_Fourier_coef) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellanalyticrank_line_5674, __pyx_kp_u_Returns_a_2_component_vector_wi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellap_line_5689, __pyx_kp_u_e_ellap_p_Returns_the_prime_ind) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellaplist_line_5729, __pyx_kp_u_e_ellaplist_n_Returns_a_PARI_li) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellbil_line_5801, __pyx_kp_u_e_ellbil_z0_z1_return_the_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellchangecurve_line_5826, __pyx_kp_u_e_ellchangecurve_ch_return_the) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_elleta_line_5857, __pyx_kp_u_e_elleta_return_the_vector_eta1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellheight_line_5879, __pyx_kp_u_e_ellheight_a_flag_2_return_the) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellheightmatrix_line_5926, __pyx_kp_u_e_ellheightmatrix_x_return_the) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellisoncurve_line_5955, __pyx_kp_u_e_ellisoncurve_x_return_True_if) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_elllocalred_line_5983, __pyx_kp_u_e_elllocalred_p_computes_the_da) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_elllseries_line_6138, __pyx_kp_u_e_elllseries_s_A_1_return_the_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellminimalmodel_line_6181, __pyx_kp_u_ellminimalmodel_e_return_the_st) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellorder_line_6219, __pyx_kp_u_e_ellorder_x_return_the_order_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellordinate_line_6250, __pyx_kp_u_e_ellordinate_x_return_the_y_co) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellpointtoz_line_6281, __pyx_kp_u_e_ellpointtoz_P_return_the_comp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellpow_line_6307, __pyx_kp_u_e_ellpow_z_n_return_n_times_the) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellrootno_line_6370, __pyx_kp_u_e_ellrootno_p_return_the_local) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellsigma_line_6408, __pyx_kp_u_e_ellsigma_z_flag_0_return_the) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellsub_line_6425, __pyx_kp_u_e_ellsub_z0_z1_return_z0_z1_on) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_elltors_line_6455, __pyx_kp_u_e_elltors_flag_0_return_informa) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellzeta_line_6500, __pyx_kp_u_e_ellzeta_z_return_the_value_at) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellztopoint_line_6533, __pyx_kp_u_e_ellztopoint_z_return_the_poin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_omega_line_6572, __pyx_kp_u_e_omega_return_basis_for_the_pe) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_disc_line_6585, __pyx_kp_u_e_disc_return_the_discriminant) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_j_line_6599, __pyx_kp_u_e_j_return_the_j_invariant_of_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_idealcoprime_line_6743, __pyx_kp_u_Given_two_integral_ideals_x_and) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ideallist_line_6791, __pyx_kp_u_Vector_of_vectors_L_of_all_idea) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ideallog_line_6817, __pyx_kp_u_Return_the_discrete_logarithm_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_idealprimedec_line_6861, __pyx_kp_u_Prime_ideal_decomposition_of_th) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_idealstar_line_6881, __pyx_kp_u_Return_the_big_ideal_bid_struct) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfbasis_line_6955, __pyx_kp_u_nfbasis_x_flag_fa_integral_basi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfbasis_d_line_7002, __pyx_kp_u_nfbasis_d_x_Return_a_basis_of_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfbasistoalg_line_7034, __pyx_kp_u_Transforms_the_column_vector_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfbasistoalg_lift_line_7066, __pyx_kp_u_Transforms_the_column_vector_x_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfdisc_line_7097, __pyx_kp_u_nfdisc_x_Return_the_discriminan) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfeltreduce_line_7132, __pyx_kp_u_Given_an_ideal_I_in_Hermite_nor) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfhilbert_line_7160, __pyx_kp_u_nfhilbert_nf_a_b_p_if_p_is_omit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfinit_line_7194, __pyx_kp_u_nfinit_pol_flag_0_pol_being_a_n) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfisisom_line_7258, __pyx_kp_u_nfisisom_x_y_Determine_if_the_n) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfrootsof1_line_7298, __pyx_kp_u_nf_nfrootsof1_number_of_roots_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_rnfidealdown_line_7362, __pyx_kp_u_rnfidealdown_rnf_x_finds_the_in) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_rnfinit_line_7405, __pyx_kp_u_EXAMPLES_We_construct_a_relativ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_quadhilbert_line_7428, __pyx_kp_u_Returns_a_polynomial_over_QQ_wh) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_content_line_7461, __pyx_kp_u_Greatest_common_divisor_of_all) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_factornf_line_7487, __pyx_kp_u_Factorization_of_the_polynomial) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_newtonpoly_line_7541, __pyx_kp_u_x_newtonpoly_p_Newton_polygon_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_polcoeff_line_7556, __pyx_kp_u_EXAMPLES_f_pari_x_2_y_3_x_y_f_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfgaloisconj_line_7607, __pyx_kp_u_Edited_from_the_pari_documentat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nfroots_line_7636, __pyx_kp_u_Return_the_roots_of_poly_in_the) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_serreverse_line_7766, __pyx_kp_u_serreverse_f_reversion_of_the_p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ncols_line_7829, __pyx_kp_u_Return_the_number_of_columns_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nrows_line_7844, __pyx_kp_u_Return_the_number_of_rows_of_se) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_mattranspose_line_7864, __pyx_kp_u_Transpose_of_the_matrix_self_EX) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_matadjoint_line_7876, __pyx_kp_u_matadjoint_x_adjoint_matrix_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_matsolve_line_7950, __pyx_kp_u_matsolve_B_Solve_the_linear_sys) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_matker_line_7977, __pyx_kp_u_Return_a_basis_of_the_kernel_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_matkerint_line_8006, __pyx_kp_u_Return_the_integer_kernel_of_a) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_matdet_line_8032, __pyx_kp_u_Return_the_determinant_of_this) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_trace_line_8054, __pyx_kp_u_Return_the_trace_of_this_PARI_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_mathnf_line_8066, __pyx_kp_u_A_mathnf_flag_0_upper_triangula) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_mathnfmod_line_8092, __pyx_kp_u_Returns_the_Hermite_normal_form) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_mathnfmodid_line_8126, __pyx_kp_u_Returns_the_Hermite_Normal_Form) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_matsnf_line_8155, __pyx_kp_u_x_matsnf_flag_0_Smith_normal_fo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_matfrobenius_line_8182, __pyx_kp_u_M_matfrobenius_flag_0_Return_th) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_factor_line_8228, __pyx_kp_u_Return_the_factorization_of_x_I) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_znprimroot_line_8309, __pyx_kp_u_Return_a_primitive_root_modulo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nextprime_line_8346, __pyx_kp_u_nextprime_x_smallest_pseudoprim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_change_variable_name_line_83, __pyx_kp_u_In_self_which_must_be_a_t_POL_o) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_subst_line_8423, __pyx_kp_u_In_self_replace_the_variable_va) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_nf_subst_line_8456, __pyx_kp_u_Given_a_PARI_number_field_self) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_type_line_8523, __pyx_kp_u_Return_the_PARI_type_of_self_as) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_algdep_line_8596, __pyx_kp_u_EXAMPLES_n_pari_set_real_precis) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_elleisnum_line_8635, __pyx_kp_u_om_elleisnum_k_flag_0_om_om1_om) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellwp_line_8677, __pyx_kp_u_Return_the_value_or_the_series) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_ellchangepoint_line_8751, __pyx_kp_u_self_ellchangepoint_y_change_da) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_gen_debug_line_8776, __pyx_kp_u_Show_the_internal_structure_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance__real_coerced_to_bi, __pyx_kp_u_Creates_a_PARI_t_REAL_with_valu) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance___call___line_9300, __pyx_kp_u_Create_the_PARI_object_obtained) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_init_primes_line_94, __pyx_kp_u_Recompute_the_primes_table_incl) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_read_line_9455, __pyx_kp_u_Read_a_script_from_the_named_fi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance__primelimit_line_94, __pyx_kp_u_Return_the_number_of_primes_alr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_prime_list_line_950, __pyx_kp_u_prime_list_n_returns_list_of_th) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_primes_up_to_n_line, __pyx_kp_u_Return_the_primes_n_as_a_pari_l) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_euler_line_9590, __pyx_kp_u_Return_Euler_s_constant_to_the) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_pi_line_9607, __pyx_kp_u_Return_the_value_of_the_constan) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_pollegendre_line_96, __pyx_kp_u_pollegendre_n_v_x_Legendre_poly) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_poltchebi_line_9642, __pyx_kp_u_poltchebi_n_v_x_Chebyshev_polyn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_factorial_line_9659, __pyx_kp_u_Return_the_factorial_of_the_int) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_polcyclo_line_9677, __pyx_kp_u_polcyclo_n_v_x_cyclotomic_polyn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_polsubcyclo_line_96, __pyx_kp_u_polsubcyclo_n_d_v_x_return_the) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_setrand_line_9725, __pyx_kp_u_Sets_PARI_s_current_random_numb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_getrand_line_9765, __pyx_kp_u_Returns_PARI_s_current_random_n) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariInstance_vector_line_9785, __pyx_kp_u_vector_long_n_entries_None_Crea) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_PariError___repr___line_10114, __pyx_kp_u_TESTS_PariError_11_PariError_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init cypari_src.gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cypari_src.gen");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject* args = PyTuple_Pack(1, arg);
    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

static CYTHON_INLINE int __Pyx_div_int(int a, int b) {
    int q = a / b;
    int r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static 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
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                if (PyObject_IsSubclass(instance_class, type)) {
                    type = instance_class;
                } else {
                    instance_class = NULL;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return -1;
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static 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 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 CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (PyErr_ExceptionMatches(PyExc_OverflowError))
                    PyErr_Clear();
                else
                    goto bad;
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_COMPILING_IN_CPYTHON
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if CYTHON_COMPILING_IN_PYPY
    float_value = PyNumber_Float(obj);
#else
    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
    if (likely(nb) && likely(nb->nb_float)) {
        float_value = nb->nb_float(obj);
        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    Py_DECREF(res);
    return 0;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
#ifndef PY_WRITE_RESTRICTED
#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
#endif
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyMem_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    Py_ssize_t size;
    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
    case METH_VARARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0)
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 0)
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 1)
                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_Call,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __Pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__pyx_CyFunctionType == NULL) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyMem_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

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, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
    {                                                                     \
        func_type value = func_value;                                     \
        if (sizeof(target_type) < sizeof(func_type)) {                    \
            if (unlikely(value != (func_type) (target_type) value)) {     \
                func_type zero = 0;                                       \
                if (is_unsigned && unlikely(value < zero))                \
                    goto raise_neg_overflow;                              \
                else                                                      \
                    goto raise_overflow;                                  \
            }                                                             \
        }                                                                 \
        return (target_type) value;                                       \
    }

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) {
    const unsigned long neg_one = (unsigned long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(unsigned long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(unsigned long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(unsigned long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(unsigned long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(unsigned long, long, PyLong_AsLong(x))
            } else if (sizeof(unsigned long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(unsigned long, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned long) -1;
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long) -1;
        val = __Pyx_PyInt_As_unsigned_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned long");
    return (unsigned long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned long");
    return (unsigned long) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
    const unsigned long neg_one = (unsigned long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(unsigned long) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(unsigned long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned long) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned long),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
    const char neg_one = (char) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(char) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(char) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(char) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(char),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

static PyObject* __Pyx_Globals(void) {
    Py_ssize_t i;
    PyObject *names;
    PyObject *globals = __pyx_d;
    Py_INCREF(globals);
    names = PyObject_Dir(__pyx_m);
    if (!names)
        goto bad;
    for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject* name = PySequence_GetItem(names, i);
        if (!name)
            goto bad;
#else
        PyObject* name = PyList_GET_ITEM(names, i);
#endif
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = __Pyx_GetAttr(__pyx_m, name);
            if (!value) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                goto bad;
            }
            if (PyDict_SetItem(globals, name, value) < 0) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                Py_DECREF(value);
                goto bad;
            }
        }
#if CYTHON_COMPILING_IN_PYPY
        Py_DECREF(name);
#endif
    }
    Py_DECREF(names);
    return globals;
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_pari_sp(pari_sp value) {
    const pari_sp neg_one = (pari_sp) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(pari_sp) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(pari_sp) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(pari_sp) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(pari_sp) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(pari_sp) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(pari_sp),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong(x))
            } else if (sizeof(size_t) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if !CYTHON_COMPILING_IN_PYPY
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b)))
      return PyInt_AS_LONG(b);
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
     #if CYTHON_USE_PYLONG_INTERNALS
       switch (Py_SIZE(b)) {
       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
       case  0: return 0;
       case  1: return ((PyLongObject*)b)->ob_digit[0];
       }
     #endif
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
