Generated by Cython 0.14.1 on Wed Nov 30 11:40:36 2011

Raw output: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.c

 1: 
 2: include "interrupt.pxi"  # ctrl-c interrupt block support
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":2
 * 
 * include "interrupt.pxi"  # ctrl-c interrupt block support             # <<<<<<<<<<<<<<
 * include "stdsage.pxi"  # ctrl-c interrupt block support
 * 
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 3: include "stdsage.pxi"  # ctrl-c interrupt block support
 4: 
 5: include "cdefs.pxi"
 6: from sage.rings.complex_double cimport ComplexDoubleElement
 7: cimport numpy as cnumpy
 8: from sage.plot.primitive import GraphicPrimitive
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":8
 * from sage.rings.complex_double cimport ComplexDoubleElement
 * cimport numpy as cnumpy
 * from sage.plot.primitive import GraphicPrimitive             # <<<<<<<<<<<<<<
 * from sage.misc.decorators import options
 * from sage.misc.misc import srange
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__GraphicPrimitive));
  PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__GraphicPrimitive));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__GraphicPrimitive));
  __pyx_t_5 = __Pyx_Import(((PyObject *)__pyx_n_s_25), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__GraphicPrimitive); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__GraphicPrimitive, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 9: from sage.misc.decorators import options
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":9
 * cimport numpy as cnumpy
 * from sage.plot.primitive import GraphicPrimitive
 * from sage.misc.decorators import options             # <<<<<<<<<<<<<<
 * from sage.misc.misc import srange
 * from sage.symbolic.ring import var
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__options));
  PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__options));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__options));
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s_26), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__options); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__options, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 10: from sage.misc.misc import srange
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":10
 * from sage.plot.primitive import GraphicPrimitive
 * from sage.misc.decorators import options
 * from sage.misc.misc import srange             # <<<<<<<<<<<<<<
 * from sage.symbolic.ring import var
 * 
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__srange));
  PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__srange));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__srange));
  __pyx_t_5 = __Pyx_Import(((PyObject *)__pyx_n_s_27), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__srange); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__srange, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 11: from sage.symbolic.ring import var
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":11
 * from sage.misc.decorators import options
 * from sage.misc.misc import srange
 * from sage.symbolic.ring import var             # <<<<<<<<<<<<<<
 * 
 * cdef inline ComplexDoubleElement new_CDF_element(double w, double v):
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__var));
  PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__var));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__var));
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s_28), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__var); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__var, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 12: 
 13: cdef inline ComplexDoubleElement new_CDF_element(double w, double v):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":13
 * from sage.symbolic.ring import var
 * 
 * cdef inline ComplexDoubleElement new_CDF_element(double w, double v):             # <<<<<<<<<<<<<<
 *     cdef ComplexDoubleElement z = <ComplexDoubleElement>PY_NEW(ComplexDoubleElement)
 *     z._complex.dat[0] = w
 */

static CYTHON_INLINE struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *__pyx_f_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_new_CDF_element(double __pyx_v_w, double __pyx_v_v) {
  struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *__pyx_v_z = 0;
  struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("new_CDF_element");
 14:     cdef ComplexDoubleElement z = <ComplexDoubleElement>PY_NEW(ComplexDoubleElement)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":14
 * 
 * cdef inline ComplexDoubleElement new_CDF_element(double w, double v):
 *     cdef ComplexDoubleElement z = <ComplexDoubleElement>PY_NEW(ComplexDoubleElement)             # <<<<<<<<<<<<<<
 *     z._complex.dat[0] = w
 *     z._complex.dat[1] = v
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_4sage_5rings_14complex_double_ComplexDoubleElement));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PY_NEW(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_t_2)));
  __pyx_v_z = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 15:     z._complex.dat[0] = w
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":15
 * cdef inline ComplexDoubleElement new_CDF_element(double w, double v):
 *     cdef ComplexDoubleElement z = <ComplexDoubleElement>PY_NEW(ComplexDoubleElement)
 *     z._complex.dat[0] = w             # <<<<<<<<<<<<<<
 *     z._complex.dat[1] = v
 *     return z
 */
  (__pyx_v_z->_complex.dat[0]) = __pyx_v_w;
 16:     z._complex.dat[1] = v
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":16
 *     cdef ComplexDoubleElement z = <ComplexDoubleElement>PY_NEW(ComplexDoubleElement)
 *     z._complex.dat[0] = w
 *     z._complex.dat[1] = v             # <<<<<<<<<<<<<<
 *     return z
 * 
 */
  (__pyx_v_z->_complex.dat[1]) = __pyx_v_v;
 17:     return z
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":17
 *     z._complex.dat[0] = w
 *     z._complex.dat[1] = v
 *     return z             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_z));
  __pyx_r = __pyx_v_z;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.new_CDF_element");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_z);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 18: 
 19: 
 20: 
 21: def complex_to_rgb(roots,z_values):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":21
 * 
 * 
 * def complex_to_rgb(roots,z_values):             # <<<<<<<<<<<<<<
 *     """
 *     INPUT:
 */

static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_complex_to_rgb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_complex_to_rgb[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx (starting at line 21)\n\n    INPUT: \n\n    - ``z_values`` -- A grid of complex numbers, as a list of lists\n    \n    OUTPUT:\n\n    An `N \\times M \\times 3` floating point Numpy array ``X``, where\n    ``X[i,j]`` is an (r,g,b) tuple. \n    \n    EXAMPLES::\n\n        sage: from sage.plot.complex_plot import complex_to_rgb\n        sage: complex_to_rgb([[0, 1, 1000]])\n        array([[[ 0.        ,  0.        ,  0.        ],\n                [ 0.77172568,  0.        ,  0.        ],\n                [ 1.        ,  0.64421177,  0.64421177]]])\n        sage: complex_to_rgb([[0, 1j, 1000j]])\n        array([[[ 0.        ,  0.        ,  0.        ],\n                [ 0.38586284,  0.77172568,  0.        ],\n                [ 0.82210588,  1.        ,  0.64421177]]])\n    ";
static PyMethodDef __pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_complex_to_rgb = {__Pyx_NAMESTR("complex_to_rgb"), (PyCFunction)__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_complex_to_rgb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_complex_to_rgb)};
static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_complex_to_rgb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_roots = 0;
  PyObject *__pyx_v_z_values = 0;
  PyObject *__pyx_v_numpy;
  unsigned int __pyx_v_i;
  unsigned int __pyx_v_j;
  unsigned int __pyx_v_imax;
  unsigned int __pyx_v_jmax;
  unsigned int __pyx_v_n;
  struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *__pyx_v_zz;
  PyObject *__pyx_v_CDF;
  PyObject *__pyx_v_rainbow;
  PyArrayObject *__pyx_v_rgb = 0;
  PyObject *__pyx_v_R;
  PyObject *__pyx_v_row;
  double __pyx_v_alpha;
  PyObject *__pyx_v_color;
  PyObject *__pyx_v_col;
  Py_buffer __pyx_bstruct_rgb;
  Py_ssize_t __pyx_bstride_0_rgb = 0;
  Py_ssize_t __pyx_bstride_1_rgb = 0;
  Py_ssize_t __pyx_bstride_2_rgb = 0;
  Py_ssize_t __pyx_bshape_0_rgb = 0;
  Py_ssize_t __pyx_bshape_1_rgb = 0;
  Py_ssize_t __pyx_bshape_2_rgb = 0;
  PyObject *__pyx_r = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__roots,&__pyx_n_s__z_values,0};
  __Pyx_RefNannySetupContext("complex_to_rgb");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__roots);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__z_values);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("complex_to_rgb", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "complex_to_rgb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_roots = values[0];
    __pyx_v_z_values = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_roots = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_z_values = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("complex_to_rgb", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.complex_to_rgb");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_numpy = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_zz = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_CDF = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_rainbow = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_R = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_row = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_color = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_col = Py_None; __Pyx_INCREF(Py_None);
  __pyx_bstruct_rgb.buf = NULL;

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":21
 * 
 * 
 * def complex_to_rgb(roots,z_values):             # <<<<<<<<<<<<<<
 *     """
 *     INPUT:
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_complex_to_rgb, NULL, __pyx_n_s_29); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__complex_to_rgb, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 22:     """
 23:     INPUT:
 24: 
 25:     - ``z_values`` -- A grid of complex numbers, as a list of lists
 26: 
 27:     OUTPUT:
 28: 
 29:     An `N \\times M \\times 3` floating point Numpy array ``X``, where
 30:     ``X[i,j]`` is an (r,g,b) tuple.
 31: 
 32:     EXAMPLES::
 33: 
 34:         sage: from sage.plot.complex_plot import complex_to_rgb
 35:         sage: complex_to_rgb([[0, 1, 1000]])
 36:         array([[[ 0.        ,  0.        ,  0.        ],
 37:                 [ 0.77172568,  0.        ,  0.        ],
 38:                 [ 1.        ,  0.64421177,  0.64421177]]])
 39:         sage: complex_to_rgb([[0, 1j, 1000j]])
 40:         array([[[ 0.        ,  0.        ,  0.        ],
 41:                 [ 0.38586284,  0.77172568,  0.        ],
 42:                 [ 0.82210588,  1.        ,  0.64421177]]])
 43:     """
 44:     import numpy
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":44
 *                 [ 0.82210588,  1.        ,  0.64421177]]])
 *     """
 *     import numpy             # <<<<<<<<<<<<<<
 *     cdef unsigned int i, j, imax, jmax, n
 *     cdef ComplexDoubleElement zz
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_numpy);
  __pyx_v_numpy = __pyx_t_1;
  __pyx_t_1 = 0;
 45:     cdef unsigned int i, j, imax, jmax, n
 46:     cdef ComplexDoubleElement zz
 47:     from sage.rings.complex_double import CDF
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":47
 *     cdef unsigned int i, j, imax, jmax, n
 *     cdef ComplexDoubleElement zz
 *     from sage.rings.complex_double import CDF             # <<<<<<<<<<<<<<
 *     from sage.plot.colors import rainbow
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__CDF));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__CDF));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CDF));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_1), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__CDF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_CDF);
  __pyx_v_CDF = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 48:     from sage.plot.colors import rainbow
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":48
 *     cdef ComplexDoubleElement zz
 *     from sage.rings.complex_double import CDF
 *     from sage.plot.colors import rainbow             # <<<<<<<<<<<<<<
 * 
 *     imax = len(z_values)
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__rainbow));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__rainbow));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__rainbow));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_2), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__rainbow); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_v_rainbow);
  __pyx_v_rainbow = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 49: 
 50:     imax = len(z_values)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":50
 *     from sage.plot.colors import rainbow
 * 
 *     imax = len(z_values)             # <<<<<<<<<<<<<<
 *     jmax = len(z_values[0])
 *     cdef cnumpy.ndarray[cnumpy.float_t, ndim=3, mode='c'] rgb = numpy.empty(dtype=numpy.float, shape=(imax, jmax, 3))
 */
  __pyx_t_1 = __pyx_v_z_values;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_imax = __pyx_t_3;
 51:     jmax = len(z_values[0])
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":51
 * 
 *     imax = len(z_values)
 *     jmax = len(z_values[0])             # <<<<<<<<<<<<<<
 *     cdef cnumpy.ndarray[cnumpy.float_t, ndim=3, mode='c'] rgb = numpy.empty(dtype=numpy.float, shape=(imax, jmax, 3))
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_z_values, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_jmax = __pyx_t_3;
 52:     cdef cnumpy.ndarray[cnumpy.float_t, ndim=3, mode='c'] rgb = numpy.empty(dtype=numpy.float, shape=(imax, jmax, 3))
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":52
 *     imax = len(z_values)
 *     jmax = len(z_values[0])
 *     cdef cnumpy.ndarray[cnumpy.float_t, ndim=3, mode='c'] rgb = numpy.empty(dtype=numpy.float, shape=(imax, jmax, 3))             # <<<<<<<<<<<<<<
 * 
 *     n = len(roots)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_numpy, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_numpy, __pyx_n_s__float); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_imax); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_jmax); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__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_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__shape), ((PyObject *)__pyx_t_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_rgb, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_rgb = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_rgb.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_rgb = __pyx_bstruct_rgb.strides[0]; __pyx_bstride_1_rgb = __pyx_bstruct_rgb.strides[1]; __pyx_bstride_2_rgb = __pyx_bstruct_rgb.strides[2];
      __pyx_bshape_0_rgb = __pyx_bstruct_rgb.shape[0]; __pyx_bshape_1_rgb = __pyx_bstruct_rgb.shape[1]; __pyx_bshape_2_rgb = __pyx_bstruct_rgb.shape[2];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_rgb = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;
 53: 
 54:     n = len(roots)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":54
 *     cdef cnumpy.ndarray[cnumpy.float_t, ndim=3, mode='c'] rgb = numpy.empty(dtype=numpy.float, shape=(imax, jmax, 3))
 * 
 *     n = len(roots)             # <<<<<<<<<<<<<<
 *     R = rainbow(n)
 *     R = [Color(col).rgb() for col in R]
 */
  __pyx_t_6 = __pyx_v_roots;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_n = __pyx_t_3;
 55:     R = rainbow(n)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":55
 * 
 *     n = len(roots)
 *     R = rainbow(n)             # <<<<<<<<<<<<<<
 *     R = [Color(col).rgb() for col in R]
 * 
 */
  __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_v_rainbow, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_R);
  __pyx_v_R = __pyx_t_6;
  __pyx_t_6 = 0;
 56:     R = [Color(col).rgb() for col in R]
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":56
 *     n = len(roots)
 *     R = rainbow(n)
 *     R = [Color(col).rgb() for col in R]             # <<<<<<<<<<<<<<
 * 
 *     sig_on()
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  if (PyList_CheckExact(__pyx_v_R) || PyTuple_CheckExact(__pyx_v_R)) {
    __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_R; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_R); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else {
      __pyx_t_1 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_1) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_v_col);
    __pyx_v_col = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetName(__pyx_i, __pyx_n_s__Color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_INCREF(__pyx_v_col);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_col);
    __Pyx_GIVEREF(__pyx_v_col);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__rgb); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(PyList_Append(__pyx_t_6, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_6));
  __Pyx_DECREF(__pyx_v_R);
  __pyx_v_R = ((PyObject *)__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 57: 
 58:     sig_on()
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":58
 *     R = [Color(col).rgb() for col in R]
 * 
 *     sig_on()             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < imax:
 * 
 */
  __pyx_t_8 = sig_on(); if (unlikely(__pyx_t_8 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 59:     for i from 0 <= i < imax:
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":59
 * 
 *     sig_on()
 *     for i from 0 <= i < imax:             # <<<<<<<<<<<<<<
 * 
 *         row = z_values[i]
 */
  __pyx_t_9 = __pyx_v_imax;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {
 60: 
 61:         row = z_values[i]
    /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":61
 *     for i from 0 <= i < imax:
 * 
 *         row = z_values[i]             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < jmax:
 * 
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_z_values, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_v_row);
    __pyx_v_row = __pyx_t_6;
    __pyx_t_6 = 0;
 62:         for j from 0 <= j < jmax:
    /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":62
 * 
 *         row = z_values[i]
 *         for j from 0 <= j < jmax:             # <<<<<<<<<<<<<<
 * 
 *             zz = row[j][0]
 */
    __pyx_t_10 = __pyx_v_jmax;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {
 63: 
 64:             zz = row[j][0]
      /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":64
 *         for j from 0 <= j < jmax:
 * 
 *             zz = row[j][0]             # <<<<<<<<<<<<<<
 *             alpha = mag_to_lightness(row[j][1])
 * 
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_row, __pyx_v_j, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4sage_5rings_14complex_double_ComplexDoubleElement))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_v_zz));
      __pyx_v_zz = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_t_2);
      __pyx_t_2 = 0;
 65:             alpha = mag_to_lightness(row[j][1])
      /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":65
 * 
 *             zz = row[j][0]
 *             alpha = mag_to_lightness(row[j][1])             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_row, __pyx_v_j, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_alpha = __pyx_f_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_mag_to_lightness(__pyx_t_8);
 66: 
 67:             try:
      /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":67
 *             alpha = mag_to_lightness(row[j][1])
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 color = R[roots.index(zz)]
 *                 rgb[i, j, 0] = color[0]*alpha
 */
      {
        PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
        __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
        __Pyx_XGOTREF(__pyx_save_exc_type);
        __Pyx_XGOTREF(__pyx_save_exc_value);
        __Pyx_XGOTREF(__pyx_save_exc_tb);
        /*try:*/ {
 68:                 color = R[roots.index(zz)]
          /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":68
 * 
 *             try:
 *                 color = R[roots.index(zz)]             # <<<<<<<<<<<<<<
 *                 rgb[i, j, 0] = color[0]*alpha
 *                 rgb[i, j, 1] = color[1]*alpha
 */
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_roots, __pyx_n_s__index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_2));
          __Pyx_INCREF(((PyObject *)__pyx_v_zz));
          PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_zz));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_zz));
          __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __pyx_t_2 = PyObject_GetItem(__pyx_v_R, __pyx_t_4); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_v_color);
          __pyx_v_color = __pyx_t_2;
          __pyx_t_2 = 0;
 69:                 rgb[i, j, 0] = color[0]*alpha
          /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":69
 *             try:
 *                 color = R[roots.index(zz)]
 *                 rgb[i, j, 0] = color[0]*alpha             # <<<<<<<<<<<<<<
 *                 rgb[i, j, 1] = color[1]*alpha
 *                 rgb[i, j, 2] = color[2]*alpha
 */
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_color, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_11 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_13 = __pyx_v_j;
          __pyx_t_14 = 0;
          __pyx_t_8 = -1;
          if (unlikely(__pyx_t_12 >= (size_t)__pyx_bshape_0_rgb)) __pyx_t_8 = 0;
          if (unlikely(__pyx_t_13 >= (size_t)__pyx_bshape_1_rgb)) __pyx_t_8 = 1;
          if (__pyx_t_14 < 0) {
            __pyx_t_14 += __pyx_bshape_2_rgb;
            if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 2;
          } else if (unlikely(__pyx_t_14 >= __pyx_bshape_2_rgb)) __pyx_t_8 = 2;
          if (unlikely(__pyx_t_8 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_8);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          }
          *__Pyx_BufPtrCContig3d(__pyx_t_5numpy_float_t *, __pyx_bstruct_rgb.buf, __pyx_t_12, __pyx_bstride_0_rgb, __pyx_t_13, __pyx_bstride_1_rgb, __pyx_t_14, __pyx_bstride_2_rgb) = __pyx_t_11;
 70:                 rgb[i, j, 1] = color[1]*alpha
          /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":70
 *                 color = R[roots.index(zz)]
 *                 rgb[i, j, 0] = color[0]*alpha
 *                 rgb[i, j, 1] = color[1]*alpha             # <<<<<<<<<<<<<<
 *                 rgb[i, j, 2] = color[2]*alpha
 * 
 */
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_color, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L12_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_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_15 = __pyx_v_i;
          __pyx_t_16 = __pyx_v_j;
          __pyx_t_17 = 1;
          __pyx_t_8 = -1;
          if (unlikely(__pyx_t_15 >= (size_t)__pyx_bshape_0_rgb)) __pyx_t_8 = 0;
          if (unlikely(__pyx_t_16 >= (size_t)__pyx_bshape_1_rgb)) __pyx_t_8 = 1;
          if (__pyx_t_17 < 0) {
            __pyx_t_17 += __pyx_bshape_2_rgb;
            if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 2;
          } else if (unlikely(__pyx_t_17 >= __pyx_bshape_2_rgb)) __pyx_t_8 = 2;
          if (unlikely(__pyx_t_8 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_8);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          }
          *__Pyx_BufPtrCContig3d(__pyx_t_5numpy_float_t *, __pyx_bstruct_rgb.buf, __pyx_t_15, __pyx_bstride_0_rgb, __pyx_t_16, __pyx_bstride_1_rgb, __pyx_t_17, __pyx_bstride_2_rgb) = __pyx_t_11;
 71:                 rgb[i, j, 2] = color[2]*alpha
          /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":71
 *                 rgb[i, j, 0] = color[0]*alpha
 *                 rgb[i, j, 1] = color[1]*alpha
 *                 rgb[i, j, 2] = color[2]*alpha             # <<<<<<<<<<<<<<
 * 
 *             except:
 */
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_color, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_11 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_19 = __pyx_v_j;
          __pyx_t_20 = 2;
          __pyx_t_8 = -1;
          if (unlikely(__pyx_t_18 >= (size_t)__pyx_bshape_0_rgb)) __pyx_t_8 = 0;
          if (unlikely(__pyx_t_19 >= (size_t)__pyx_bshape_1_rgb)) __pyx_t_8 = 1;
          if (__pyx_t_20 < 0) {
            __pyx_t_20 += __pyx_bshape_2_rgb;
            if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 2;
          } else if (unlikely(__pyx_t_20 >= __pyx_bshape_2_rgb)) __pyx_t_8 = 2;
          if (unlikely(__pyx_t_8 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_8);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          }
          *__Pyx_BufPtrCContig3d(__pyx_t_5numpy_float_t *, __pyx_bstruct_rgb.buf, __pyx_t_18, __pyx_bstride_0_rgb, __pyx_t_19, __pyx_bstride_1_rgb, __pyx_t_20, __pyx_bstride_2_rgb) = __pyx_t_11;
        }
        __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
        __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
        __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
        goto __pyx_L19_try_end;
        __pyx_L12_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 72: 
 73:             except:
        /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":73
 *                 rgb[i, j, 2] = color[2]*alpha
 * 
 *             except:             # <<<<<<<<<<<<<<
 *                  print zz
 *     sig_off()
 */
        /*except:*/ {
          __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.complex_to_rgb");
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_2);
 74:                  print zz
          /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":74
 * 
 *             except:
 *                  print zz             # <<<<<<<<<<<<<<
 *     sig_off()
 *     return rgb
 */
          if (__Pyx_PrintOne(0, ((PyObject *)__pyx_v_zz)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
          __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;
          goto __pyx_L13_exception_handled;
        }
        __pyx_L14_except_error:;
        __Pyx_XGIVEREF(__pyx_save_exc_type);
        __Pyx_XGIVEREF(__pyx_save_exc_value);
        __Pyx_XGIVEREF(__pyx_save_exc_tb);
        __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
        goto __pyx_L1_error;
        __pyx_L13_exception_handled:;
        __Pyx_XGIVEREF(__pyx_save_exc_type);
        __Pyx_XGIVEREF(__pyx_save_exc_value);
        __Pyx_XGIVEREF(__pyx_save_exc_tb);
        __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
        __pyx_L19_try_end:;
      }
    }
  }
 75:     sig_off()
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":75
 *             except:
 *                  print zz
 *     sig_off()             # <<<<<<<<<<<<<<
 *     return rgb
 * 
 */
  sig_off();
 76:     return rgb
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":76
 *                  print zz
 *     sig_off()
 *     return rgb             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "math.h":
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_rgb));
  __pyx_r = ((PyObject *)__pyx_v_rgb);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rgb);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.complex_to_rgb");
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rgb);
  __pyx_L2:;
  __Pyx_DECREF(__pyx_v_numpy);
  __Pyx_DECREF((PyObject *)__pyx_v_zz);
  __Pyx_DECREF(__pyx_v_CDF);
  __Pyx_DECREF(__pyx_v_rainbow);
  __Pyx_XDECREF((PyObject *)__pyx_v_rgb);
  __Pyx_DECREF(__pyx_v_R);
  __Pyx_DECREF(__pyx_v_row);
  __Pyx_DECREF(__pyx_v_color);
  __Pyx_DECREF(__pyx_v_col);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 77: 
 78: cdef extern from "math.h":
 79:     double atan(double)
 80:     double log(double)
 81:     double sqrt(double)
 82:     double PI
 83: 
 84: cdef inline double mag_to_lightness(int r):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":84
 *     double PI
 * 
 * cdef inline double mag_to_lightness(int r):             # <<<<<<<<<<<<<<
 *     """
 *     Tweak this to adjust how the magnitude affects the color.
 */

static CYTHON_INLINE double __pyx_f_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_mag_to_lightness(int __pyx_v_r) {
  double __pyx_r;
  __Pyx_RefNannySetupContext("mag_to_lightness");
 85:     """
 86:     Tweak this to adjust how the magnitude affects the color.
 87:     For instance, changing ``sqrt(r)`` to ``r`` will cause
 88:     anything near a zero to be much darker and poles to be
 89:     much lighter, while ``r**(.25)`` would cause the reverse
 90:     effect.
 91: 
 92:     INPUT:
 93: 
 94:     - ``r`` - a non-negative real number
 95: 
 96:     OUTPUT:
 97: 
 98:     A value between `-1` (black) and `+1` (white), inclusive.
 99: 
 100:     EXAMPLES:
 101: 
 102:     This tests it implicitly::
 103: 
 104:         sage: from sage.plot.complex_plot import complex_to_rgb
 105:         sage: complex_to_rgb([[0, 1, 10]])
 106:         array([[[ 0.        ,  0.        ,  0.        ],
 107:                 [ 0.77172568,  0.        ,  0.        ],
 108:                 [ 1.        ,  0.22134776,  0.22134776]]])
 109:     """
 110:     return .5*atan(log(r+1)) * (4/PI)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":110
 *                 [ 1.        ,  0.22134776,  0.22134776]]])
 *     """
 *     return .5*atan(log(r+1)) * (4/PI)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(PI == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "float division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_r = ((.5 * atan(log((__pyx_v_r + 1)))) * (4.0 / PI));
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.mag_to_lightness");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 111: 
 112: 
 113: 
 114: 
 115: def newt(func):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":115
 * 
 * 
 * def newt(func):             # <<<<<<<<<<<<<<
 *     vari = func.args()[0]
 *     fprime = diff(func,vari)
 */

static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_1newt(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/
static char __pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_1newt[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx (starting at line 115)";
static PyMethodDef __pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_1newt = {__Pyx_NAMESTR("newt"), (PyCFunction)__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_1newt, METH_O, __Pyx_DOCSTR(__pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_1newt)};
static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_1newt(PyObject *__pyx_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_v_vari;
  PyObject *__pyx_v_fprime;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("newt");
  __pyx_self = __pyx_self;
  __pyx_v_vari = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_fprime = Py_None; __Pyx_INCREF(Py_None);

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":115
 * 
 * 
 * def newt(func):             # <<<<<<<<<<<<<<
 *     vari = func.args()[0]
 *     fprime = diff(func,vari)
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_1newt, NULL, __pyx_n_s_29); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__newt, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 116:     vari = func.args()[0]
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":116
 * 
 * def newt(func):
 *     vari = func.args()[0]             # <<<<<<<<<<<<<<
 *     fprime = diff(func,vari)
 *     return vari-func/fprime
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_func, __pyx_n_s__args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __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_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_vari);
  __pyx_v_vari = __pyx_t_1;
  __pyx_t_1 = 0;
 117:     fprime = diff(func,vari)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":117
 * def newt(func):
 *     vari = func.args()[0]
 *     fprime = diff(func,vari)             # <<<<<<<<<<<<<<
 *     return vari-func/fprime
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_i, __pyx_n_s__diff); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_func);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_func);
  __Pyx_GIVEREF(__pyx_v_func);
  __Pyx_INCREF(__pyx_v_vari);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_vari);
  __Pyx_GIVEREF(__pyx_v_vari);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_fprime);
  __pyx_v_fprime = __pyx_t_3;
  __pyx_t_3 = 0;
 118:     return vari-func/fprime
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":118
 *     vari = func.args()[0]
 *     fprime = diff(func,vari)
 *     return vari-func/fprime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_func, __pyx_v_fprime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_vari, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.newt");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_vari);
  __Pyx_DECREF(__pyx_v_fprime);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 119: 
 120: 
 121: 
 122: class BasinPlot(GraphicPrimitive):
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":122
 * 
 * 
 * class BasinPlot(GraphicPrimitive):             # <<<<<<<<<<<<<<
 *     def __init__(self, roots, z_values, xrange, yrange, options):
 *         """
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":122
 * 
 * 
 * class BasinPlot(GraphicPrimitive):             # <<<<<<<<<<<<<<
 *     def __init__(self, roots, z_values, xrange, yrange, options):
 *         """
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__GraphicPrimitive); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_CreateClass(((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_4), __pyx_n_s__BasinPlot, __pyx_n_s_29); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__BasinPlot, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 123:     def __init__(self, roots, z_values, xrange, yrange, options):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":123
 * 
 * class BasinPlot(GraphicPrimitive):
 *     def __init__(self, roots, z_values, xrange, yrange, options):             # <<<<<<<<<<<<<<
 *         """
 *         TESTS::
 */

static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot___init__[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx (starting at line 123)\n\n        TESTS::\n\n            sage: p = complex_plot(lambda z: z^2-1, (-2, 2), (-2, 2))\n        ";
static PyMethodDef __pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot___init__)};
static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_roots = 0;
  PyObject *__pyx_v_z_values = 0;
  PyObject *__pyx_v_xrange = 0;
  PyObject *__pyx_v_yrange = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_r = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__roots,&__pyx_n_s__z_values,&__pyx_n_s__xrange,&__pyx_n_s__yrange,&__pyx_n_s__options,0};
  __Pyx_RefNannySetupContext("__init__");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[6] = {0,0,0,0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__roots);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__z_values);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  3:
      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xrange);
      if (likely(values[3])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  4:
      values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__yrange);
      if (likely(values[4])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  5:
      values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
      if (likely(values[5])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_self = values[0];
    __pyx_v_roots = values[1];
    __pyx_v_z_values = values[2];
    __pyx_v_xrange = values[3];
    __pyx_v_yrange = values[4];
    __pyx_v_options = values[5];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_roots = PyTuple_GET_ITEM(__pyx_args, 1);
    __pyx_v_z_values = PyTuple_GET_ITEM(__pyx_args, 2);
    __pyx_v_xrange = PyTuple_GET_ITEM(__pyx_args, 3);
    __pyx_v_yrange = PyTuple_GET_ITEM(__pyx_args, 4);
    __pyx_v_options = PyTuple_GET_ITEM(__pyx_args, 5);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.BasinPlot.__init__");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":123
 * 
 * class BasinPlot(GraphicPrimitive):
 *     def __init__(self, roots, z_values, xrange, yrange, options):             # <<<<<<<<<<<<<<
 *         """
 *         TESTS::
 */
  __pyx_t_5 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot___init__, NULL, __pyx_n_s_29); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s____init__, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 124:         """
 125:         TESTS::
 126: 
 127:             sage: p = complex_plot(lambda z: z^2-1, (-2, 2), (-2, 2))
 128:         """
 129:         self.roots = roots
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":129
 *             sage: p = complex_plot(lambda z: z^2-1, (-2, 2), (-2, 2))
 *         """
 *         self.roots = roots             # <<<<<<<<<<<<<<
 *         self.xrange = xrange
 *         self.yrange = yrange
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__roots, __pyx_v_roots) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 130:         self.xrange = xrange
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":130
 *         """
 *         self.roots = roots
 *         self.xrange = xrange             # <<<<<<<<<<<<<<
 *         self.yrange = yrange
 *         self.z_values = z_values
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__xrange, __pyx_v_xrange) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 131:         self.yrange = yrange
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":131
 *         self.roots = roots
 *         self.xrange = xrange
 *         self.yrange = yrange             # <<<<<<<<<<<<<<
 *         self.z_values = z_values
 *         self.x_count = len(z_values)
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__yrange, __pyx_v_yrange) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 132:         self.z_values = z_values
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":132
 *         self.xrange = xrange
 *         self.yrange = yrange
 *         self.z_values = z_values             # <<<<<<<<<<<<<<
 *         self.x_count = len(z_values)
 *         self.y_count = len(z_values[0])
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__z_values, __pyx_v_z_values) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 133:         self.x_count = len(z_values)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":133
 *         self.yrange = yrange
 *         self.z_values = z_values
 *         self.x_count = len(z_values)             # <<<<<<<<<<<<<<
 *         self.y_count = len(z_values[0])
 *         self.rgb_data = complex_to_rgb(roots,z_values)
 */
  __pyx_t_1 = __pyx_v_z_values;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__x_count, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 134:         self.y_count = len(z_values[0])
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":134
 *         self.z_values = z_values
 *         self.x_count = len(z_values)
 *         self.y_count = len(z_values[0])             # <<<<<<<<<<<<<<
 *         self.rgb_data = complex_to_rgb(roots,z_values)
 *         GraphicPrimitive.__init__(self, options)
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_z_values, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__y_count, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 135:         self.rgb_data = complex_to_rgb(roots,z_values)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":135
 *         self.x_count = len(z_values)
 *         self.y_count = len(z_values[0])
 *         self.rgb_data = complex_to_rgb(roots,z_values)             # <<<<<<<<<<<<<<
 *         GraphicPrimitive.__init__(self, options)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__complex_to_rgb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_v_roots);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_roots);
  __Pyx_GIVEREF(__pyx_v_roots);
  __Pyx_INCREF(__pyx_v_z_values);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_z_values);
  __Pyx_GIVEREF(__pyx_v_z_values);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__rgb_data, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 136:         GraphicPrimitive.__init__(self, options)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":136
 *         self.y_count = len(z_values[0])
 *         self.rgb_data = complex_to_rgb(roots,z_values)
 *         GraphicPrimitive.__init__(self, options)             # <<<<<<<<<<<<<<
 * 
 *     def get_minmax_data(self):
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__GraphicPrimitive); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s____init__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.BasinPlot.__init__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 137: 
 138:     def get_minmax_data(self):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":138
 *         GraphicPrimitive.__init__(self, options)
 * 
 *     def get_minmax_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the bounding box data.
 */

static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_1get_minmax_data(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_1get_minmax_data[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx (starting at line 138)\n\n        Returns a dictionary with the bounding box data.\n        \n        EXAMPLES::\n\n            sage: p = complex_plot(lambda z: z, (-1, 2), (-3, 4))\n            sage: sorted(p.get_minmax_data().items())\n            [('xmax', 2.0), ('xmin', -1.0), ('ymax', 4.0), ('ymin', -3.0)]\n        ";
static PyMethodDef __pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_1get_minmax_data = {__Pyx_NAMESTR("get_minmax_data"), (PyCFunction)__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_1get_minmax_data, METH_O, __Pyx_DOCSTR(__pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_1get_minmax_data)};
static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_1get_minmax_data(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_minmax_data;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("get_minmax_data");
  __pyx_self = __pyx_self;
  __pyx_v_minmax_data = Py_None; __Pyx_INCREF(Py_None);

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":138
 *         GraphicPrimitive.__init__(self, options)
 * 
 *     def get_minmax_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the bounding box data.
 */
  __pyx_t_5 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_1get_minmax_data, NULL, __pyx_n_s_29); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s__get_minmax_data, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 139:         """
 140:         Returns a dictionary with the bounding box data.
 141: 
 142:         EXAMPLES::
 143: 
 144:             sage: p = complex_plot(lambda z: z, (-1, 2), (-3, 4))
 145:             sage: sorted(p.get_minmax_data().items())
 146:             [('xmax', 2.0), ('xmin', -1.0), ('ymax', 4.0), ('ymin', -3.0)]
 147:         """
 148:         from sage.plot.plot import minmax_data
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":148
 *             [('xmax', 2.0), ('xmin', -1.0), ('ymax', 4.0), ('ymin', -3.0)]
 *         """
 *         from sage.plot.plot import minmax_data             # <<<<<<<<<<<<<<
 *         return minmax_data(self.xrange, self.yrange, dict=True)
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__minmax_data));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__minmax_data));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__minmax_data));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__minmax_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_minmax_data);
  __pyx_v_minmax_data = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 149:         return minmax_data(self.xrange, self.yrange, dict=True)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":149
 *         """
 *         from sage.plot.plot import minmax_data
 *         return minmax_data(self.xrange, self.yrange, dict=True)             # <<<<<<<<<<<<<<
 * 
 *     def _allowed_options(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__xrange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__yrange); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dict), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_v_minmax_data, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.BasinPlot.get_minmax_data");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_minmax_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 150: 
 151:     def _allowed_options(self):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":151
 *         return minmax_data(self.xrange, self.yrange, dict=True)
 * 
 *     def _allowed_options(self):             # <<<<<<<<<<<<<<
 *         """
 *         TESTS::
 */

static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_2_allowed_options(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_2_allowed_options[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx (starting at line 151)\n\n        TESTS::\n\n            sage: isinstance(complex_plot(lambda z: z, (-1,1), (-1,1))[0]._allowed_options(), dict)\n            True\n        ";
static PyMethodDef __pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_2_allowed_options = {__Pyx_NAMESTR("_allowed_options"), (PyCFunction)__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_2_allowed_options, METH_O, __Pyx_DOCSTR(__pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_2_allowed_options)};
static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_2_allowed_options(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("_allowed_options");
  __pyx_self = __pyx_self;

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":151
 *         return minmax_data(self.xrange, self.yrange, dict=True)
 * 
 *     def _allowed_options(self):             # <<<<<<<<<<<<<<
 *         """
 *         TESTS::
 */
  __pyx_t_5 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_2_allowed_options, NULL, __pyx_n_s_29); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s___allowed_options, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 152:         """
 153:         TESTS::
 154: 
 155:             sage: isinstance(complex_plot(lambda z: z, (-1,1), (-1,1))[0]._allowed_options(), dict)
 156:             True
 157:         """
 158:         return {'plot_points':'How many points to use for plotting precision',
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":158
 *             True
 *         """
 *         return {'plot_points':'How many points to use for plotting precision',             # <<<<<<<<<<<<<<
 *                 'interpolation':'What interpolation method to use'}
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__plot_points), ((PyObject *)__pyx_kp_s_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__interpolation), ((PyObject *)__pyx_kp_s_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.BasinPlot._allowed_options");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 159:                 'interpolation':'What interpolation method to use'}
 160: 
 161:     def _repr_(self):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":161
 *                 'interpolation':'What interpolation method to use'}
 * 
 *     def _repr_(self):             # <<<<<<<<<<<<<<
 *         """
 *         TESTS::
 */

static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_3_repr_(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_3_repr_[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx (starting at line 161)\n\n        TESTS::\n\n            sage: isinstance(complex_plot(lambda z: z, (-1,1), (-1,1))[0]._repr_(), str)\n            True\n        ";
static PyMethodDef __pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_3_repr_ = {__Pyx_NAMESTR("_repr_"), (PyCFunction)__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_3_repr_, METH_O, __Pyx_DOCSTR(__pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_3_repr_)};
static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_3_repr_(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("_repr_");
  __pyx_self = __pyx_self;

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":161
 *                 'interpolation':'What interpolation method to use'}
 * 
 *     def _repr_(self):             # <<<<<<<<<<<<<<
 *         """
 *         TESTS::
 */
  __pyx_t_5 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_3_repr_, NULL, __pyx_n_s_29); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s___repr_, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 162:         """
 163:         TESTS::
 164: 
 165:             sage: isinstance(complex_plot(lambda z: z, (-1,1), (-1,1))[0]._repr_(), str)
 166:             True
 167:         """
 168:         return "BasinPlot defined by a %s x %s data grid"%(self.x_count, self.y_count)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":168
 *             True
 *         """
 *         return "BasinPlot defined by a %s x %s data grid"%(self.x_count, self.y_count)             # <<<<<<<<<<<<<<
 * 
 *     def _render_on_subplot(self, subplot):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__x_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__y_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __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 = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.BasinPlot._repr_");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 169: 
 170:     def _render_on_subplot(self, subplot):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":170
 *         return "BasinPlot defined by a %s x %s data grid"%(self.x_count, self.y_count)
 * 
 *     def _render_on_subplot(self, subplot):             # <<<<<<<<<<<<<<
 *         """
 *         TESTS::
 */

static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_4_render_on_subplot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_4_render_on_subplot[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx (starting at line 170)\n\n        TESTS::\n\n            sage: complex_plot(lambda x: x^2, (-5, 5), (-5, 5))\n        ";
static PyMethodDef __pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_4_render_on_subplot = {__Pyx_NAMESTR("_render_on_subplot"), (PyCFunction)__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_4_render_on_subplot, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_4_render_on_subplot)};
static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_4_render_on_subplot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_subplot = 0;
  PyObject *__pyx_v_options;
  double __pyx_v_x0;
  double __pyx_v_x1;
  double __pyx_v_y0;
  double __pyx_v_y1;
  PyObject *__pyx_r = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__subplot,0};
  __Pyx_RefNannySetupContext("_render_on_subplot");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__subplot);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("_render_on_subplot", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_render_on_subplot") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_self = values[0];
    __pyx_v_subplot = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_subplot = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_render_on_subplot", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.BasinPlot._render_on_subplot");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_options = Py_None; __Pyx_INCREF(Py_None);

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":170
 *         return "BasinPlot defined by a %s x %s data grid"%(self.x_count, self.y_count)
 * 
 *     def _render_on_subplot(self, subplot):             # <<<<<<<<<<<<<<
 *         """
 *         TESTS::
 */
  __pyx_t_5 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_9BasinPlot_4_render_on_subplot, NULL, __pyx_n_s_29); 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 (PyObject_SetItem(__pyx_t_4, __pyx_n_s___render_on_subplot, __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;
 171:         """
 172:         TESTS::
 173: 
 174:             sage: complex_plot(lambda x: x^2, (-5, 5), (-5, 5))
 175:         """
 176:         options = self.options()
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":176
 *             sage: complex_plot(lambda x: x^2, (-5, 5), (-5, 5))
 *         """
 *         options = self.options()             # <<<<<<<<<<<<<<
 *         x0,x1 = float(self.xrange[0]), float(self.xrange[1])
 *         y0,y1 = float(self.yrange[0]), float(self.yrange[1])
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__options); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_options);
  __pyx_v_options = __pyx_t_2;
  __pyx_t_2 = 0;
 177:         x0,x1 = float(self.xrange[0]), float(self.xrange[1])
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":177
 *         """
 *         options = self.options()
 *         x0,x1 = float(self.xrange[0]), float(self.xrange[1])             # <<<<<<<<<<<<<<
 *         y0,y1 = float(self.yrange[0]), float(self.yrange[1])
 *         subplot.imshow(self.rgb_data, origin='lower', extent=(x0,x1,y0,y1), interpolation=options['interpolation'])
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__xrange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_AsDouble(__pyx_t_1); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__xrange); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_t_2); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_x0 = __pyx_t_3;
  __pyx_v_x1 = __pyx_t_4;
 178:         y0,y1 = float(self.yrange[0]), float(self.yrange[1])
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":178
 *         options = self.options()
 *         x0,x1 = float(self.xrange[0]), float(self.xrange[1])
 *         y0,y1 = float(self.yrange[0]), float(self.yrange[1])             # <<<<<<<<<<<<<<
 *         subplot.imshow(self.rgb_data, origin='lower', extent=(x0,x1,y0,y1), interpolation=options['interpolation'])
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__yrange); 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_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_t_1); if (unlikely(__pyx_t_4 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__yrange); 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_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__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_t_3 = __Pyx_PyObject_AsDouble(__pyx_t_2); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_y0 = __pyx_t_4;
  __pyx_v_y1 = __pyx_t_3;
 179:         subplot.imshow(self.rgb_data, origin='lower', extent=(x0,x1,y0,y1), interpolation=options['interpolation'])
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":179
 *         x0,x1 = float(self.xrange[0]), float(self.xrange[1])
 *         y0,y1 = float(self.yrange[0]), float(self.yrange[1])
 *         subplot.imshow(self.rgb_data, origin='lower', extent=(x0,x1,y0,y1), interpolation=options['interpolation'])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_subplot, __pyx_n_s__imshow); 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_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__rgb_data); 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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__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 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__origin), ((PyObject *)__pyx_n_s__lower)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_y0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_y1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__extent), ((PyObject *)__pyx_t_10)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetItem(__pyx_v_options, ((PyObject *)__pyx_n_s__interpolation)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__interpolation), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.BasinPlot._render_on_subplot");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_options);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 180: 
 181: 
 182: cdef class RootFinder:
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":182
 * 
 * 
 * cdef class RootFinder:             # <<<<<<<<<<<<<<
 *     cdef list roots
 *     cdef object newtf
 */

struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder {
  PyObject_HEAD
  struct __pyx_vtabstruct_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *__pyx_vtab;
  PyObject *roots;
  PyObject *newtf;
  struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *cutoff;
};

/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":182
 * 
 * 
 * cdef class RootFinder:             # <<<<<<<<<<<<<<
 *     cdef list roots
 *     cdef object newtf
 */

struct __pyx_vtabstruct_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder {
  PyObject *(*which_root)(struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *, PyObject *, int __pyx_skip_dispatch);
};
 183:     cdef list roots
 184:     cdef object newtf
 185:     cdef ComplexDoubleElement cutoff
 186:     def __init__(self, roots, newtf):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":186
 *     cdef object newtf
 *     cdef ComplexDoubleElement cutoff
 *     def __init__(self, roots, newtf):             # <<<<<<<<<<<<<<
 *         self.newtf = newtf
 *         self.roots = roots
 */

static int __pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_10RootFinder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_10RootFinder___init__[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx (starting at line 186)";
struct wrapperbase __pyx_wrapperbase_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_10RootFinder___init__;
static int __pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_10RootFinder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_roots = 0;
  PyObject *__pyx_v_newtf = 0;
  int __pyx_r;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__roots,&__pyx_n_s__newtf,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__roots);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__newtf);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_roots = values[0];
    __pyx_v_newtf = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_roots = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_newtf = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.RootFinder.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
 187:         self.newtf = newtf
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":187
 *     cdef ComplexDoubleElement cutoff
 *     def __init__(self, roots, newtf):
 *         self.newtf = newtf             # <<<<<<<<<<<<<<
 *         self.roots = roots
 *         self.cutoff = CDF(.1)
 */
  __Pyx_INCREF(__pyx_v_newtf);
  __Pyx_GIVEREF(__pyx_v_newtf);
  __Pyx_GOTREF(((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self)->newtf);
  __Pyx_DECREF(((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self)->newtf);
  ((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self)->newtf = __pyx_v_newtf;
 188:         self.roots = roots
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":188
 *     def __init__(self, roots, newtf):
 *         self.newtf = newtf
 *         self.roots = roots             # <<<<<<<<<<<<<<
 *         self.cutoff = CDF(.1)
 *     cpdef which_root(self,Varia):
 */
  if (!(likely(PyList_CheckExact(__pyx_v_roots))||((__pyx_v_roots) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_roots)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_roots);
  __Pyx_GIVEREF(__pyx_v_roots);
  __Pyx_GOTREF(((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self)->roots);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self)->roots));
  ((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self)->roots = ((PyObject*)__pyx_v_roots);
 189:         self.cutoff = CDF(.1)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":189
 *         self.newtf = newtf
 *         self.roots = roots
 *         self.cutoff = CDF(.1)             # <<<<<<<<<<<<<<
 *     cpdef which_root(self,Varia):
 *         cdef int counter
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_i, __pyx_n_s__CDF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(.1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __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 = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4sage_5rings_14complex_double_ComplexDoubleElement))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self)->cutoff);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self)->cutoff));
  ((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self)->cutoff = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_t_2);
  __pyx_t_2 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.RootFinder.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 190:     cpdef which_root(self,Varia):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":190
 *         self.roots = roots
 *         self.cutoff = CDF(.1)
 *     cpdef which_root(self,Varia):             # <<<<<<<<<<<<<<
 *         cdef int counter
 *         cdef ComplexDoubleElement root
 */

static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_10RootFinder_1which_root(PyObject *__pyx_v_self, PyObject *__pyx_v_Varia); /*proto*/
static  PyObject *__pyx_f_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_10RootFinder_which_root(struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *__pyx_v_self, PyObject *__pyx_v_Varia, int __pyx_skip_dispatch) {
  int __pyx_v_counter;
  struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *__pyx_v_root;
  struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *__pyx_v_varia = 0;
  PyObject *__pyx_v_ls = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("which_root");
  __pyx_v_root = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)Py_None); __Pyx_INCREF(Py_None);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__which_root); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_10RootFinder_1which_root)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_Varia);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_Varia);
      __Pyx_GIVEREF(__pyx_v_Varia);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":190
 *         self.roots = roots
 *         self.cutoff = CDF(.1)
 *     cpdef which_root(self,Varia):             # <<<<<<<<<<<<<<
 *         cdef int counter
 *         cdef ComplexDoubleElement root
 */

static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_10RootFinder_1which_root(PyObject *__pyx_v_self, PyObject *__pyx_v_Varia); /*proto*/
static char __pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_10RootFinder_1which_root[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx (starting at line 190)";
static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_10RootFinder_1which_root(PyObject *__pyx_v_self, PyObject *__pyx_v_Varia) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("which_root");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_Varia;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self)->__pyx_vtab)->which_root(((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_v_self), __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __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;

  __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("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.RootFinder.which_root");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 191:         cdef int counter
 192:         cdef ComplexDoubleElement root
 193:         cdef ComplexDoubleElement varia = Varia
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":193
 *         cdef int counter
 *         cdef ComplexDoubleElement root
 *         cdef ComplexDoubleElement varia = Varia             # <<<<<<<<<<<<<<
 *         for counter from 1<=counter<20:
 *             varia = self.newtf(varia)
 */
  if (!(likely(((__pyx_v_Varia) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_Varia, __pyx_ptype_4sage_5rings_14complex_double_ComplexDoubleElement))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_Varia);
  __pyx_v_varia = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_v_Varia);
 194:         for counter from 1<=counter<20:
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":194
 *         cdef ComplexDoubleElement root
 *         cdef ComplexDoubleElement varia = Varia
 *         for counter from 1<=counter<20:             # <<<<<<<<<<<<<<
 *             varia = self.newtf(varia)
 *             #print z
 */
  for (__pyx_v_counter = 1; __pyx_v_counter < 20; __pyx_v_counter++) {
 195:             varia = self.newtf(varia)
    /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":195
 *         cdef ComplexDoubleElement varia = Varia
 *         for counter from 1<=counter<20:
 *             varia = self.newtf(varia)             # <<<<<<<<<<<<<<
 *             #print z
 *             for root in self.roots:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_v_varia));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_varia));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_varia));
    __pyx_t_3 = PyObject_Call(__pyx_v_self->newtf, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4sage_5rings_14complex_double_ComplexDoubleElement))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_varia));
    __pyx_v_varia = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_t_3);
    __pyx_t_3 = 0;
 196:             #print z
 197:             for root in self.roots:
    /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":197
 *             varia = self.newtf(varia)
 *             #print z
 *             for root in self.roots:             # <<<<<<<<<<<<<<
 *                 if (<ComplexDoubleElement>varia._sub_(root)).abs()<self.cutoff:
 *                     return root,counter
 */
    if (unlikely(__pyx_v_self->roots == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_4 = 0; __pyx_t_3 = ((PyObject *)__pyx_v_self->roots); __Pyx_INCREF(__pyx_t_3);
    for (;;) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4sage_5rings_14complex_double_ComplexDoubleElement))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_v_root));
      __pyx_v_root = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_t_1);
      __pyx_t_1 = 0;
 198:                 if (<ComplexDoubleElement>varia._sub_(root)).abs()<self.cutoff:
      /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":198
 *             #print z
 *             for root in self.roots:
 *                 if (<ComplexDoubleElement>varia._sub_(root)).abs()<self.cutoff:             # <<<<<<<<<<<<<<
 *                     return root,counter
 *         cdef list ls = []
 */
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_v_varia->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._sub_(((struct __pyx_obj_4sage_9structure_7element_ModuleElement *)__pyx_v_varia), ((struct __pyx_obj_4sage_9structure_7element_ModuleElement *)__pyx_v_root), 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__abs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __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_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __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, ((PyObject *)__pyx_v_self->cutoff), Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_5) {
 199:                     return root,counter
        /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":199
 *             for root in self.roots:
 *                 if (<ComplexDoubleElement>varia._sub_(root)).abs()<self.cutoff:
 *                     return root,counter             # <<<<<<<<<<<<<<
 *         cdef list ls = []
 *         for root in self.roots:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = PyInt_FromLong(__pyx_v_counter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __Pyx_INCREF(((PyObject *)__pyx_v_root));
        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_root));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_root));
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_r = ((PyObject *)__pyx_t_1);
        __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L0;
        goto __pyx_L7;
      }
      __pyx_L7:;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
 200:         cdef list ls = []
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":200
 *                 if (<ComplexDoubleElement>varia._sub_(root)).abs()<self.cutoff:
 *                     return root,counter
 *         cdef list ls = []             # <<<<<<<<<<<<<<
 *         for root in self.roots:
 *             ls.append(varia._sub_(root).abs())
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_ls = __pyx_t_3;
  __pyx_t_3 = 0;
 201:         for root in self.roots:
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":201
 *                     return root,counter
 *         cdef list ls = []
 *         for root in self.roots:             # <<<<<<<<<<<<<<
 *             ls.append(varia._sub_(root).abs())
 *         return self.roots[ls.index(min(ls))],20
 */
  if (unlikely(__pyx_v_self->roots == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_4 = 0; __pyx_t_3 = ((PyObject *)__pyx_v_self->roots); __Pyx_INCREF(__pyx_t_3);
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4sage_5rings_14complex_double_ComplexDoubleElement))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_root));
    __pyx_v_root = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_t_1);
    __pyx_t_1 = 0;
 202:             ls.append(varia._sub_(root).abs())
    /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":202
 *         cdef list ls = []
 *         for root in self.roots:
 *             ls.append(varia._sub_(root).abs())             # <<<<<<<<<<<<<<
 *         return self.roots[ls.index(min(ls))],20
 * 
 */
    if (unlikely(__pyx_v_ls == Py_None)) {
      PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_v_varia->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._sub_(((struct __pyx_obj_4sage_9structure_7element_ModuleElement *)__pyx_v_varia), ((struct __pyx_obj_4sage_9structure_7element_ModuleElement *)__pyx_v_root), 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__abs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __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_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = PyList_Append(__pyx_v_ls, __pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 203:         return self.roots[ls.index(min(ls))],20
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":203
 *         for root in self.roots:
 *             ls.append(varia._sub_(root).abs())
 *         return self.roots[ls.index(min(ls))],20             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_ls), __pyx_n_s__index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_ls));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ls));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_ls));
  __pyx_t_2 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self->roots), __pyx_t_2); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __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 = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_20);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_20);
  __Pyx_GIVEREF(__pyx_int_20);
  __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.RootFinder.which_root");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_root);
  __Pyx_XDECREF((PyObject *)__pyx_v_varia);
  __Pyx_XDECREF(__pyx_v_ls);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 204: 
 205: 
 206: @options(plot_points=3, interpolation='nearest')
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":206
 * 
 * 
 * @options(plot_points=3, interpolation='nearest')             # <<<<<<<<<<<<<<
 * def basin_plot(list roots, xrange, yrange, **options):
 *     r"""
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__options); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__plot_points), __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__interpolation), ((PyObject *)__pyx_n_s__nearest)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 207: def basin_plot(list roots, xrange, yrange, **options):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":207
 * 
 * @options(plot_points=3, interpolation='nearest')
 * def basin_plot(list roots, xrange, yrange, **options):             # <<<<<<<<<<<<<<
 *     r"""
 *     ``complex_plot`` takes a complex function of one variable,
 */

static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_2basin_plot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_2basin_plot[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx (starting at line 207)\n    \n    ``complex_plot`` takes a complex function of one variable, \n    `f(z)` and plots output of the function over the specified \n    ``xrange`` and ``yrange`` as demonstrated below. The magnitude of the \n    output is indicated by the brightness (with zero being black and\n    infinity being white) while the argument is represented by the \n    hue (with red being positive real, and increasing through orange, \n    yellow, ... as the argument increases). \n\n    ``complex_plot(f, (xmin, xmax), (ymin, ymax), ...)``\n\n    INPUT:\n\n    - ``f`` -- a function of a single complex value `x + iy`\n\n    - ``(xmin, xmax)`` -- 2-tuple, the range of ``x`` values\n\n    - ``(ymin, ymax)`` -- 2-tuple, the range of ``y`` values\n\n    The following inputs must all be passed in as named parameters:\n\n    - ``plot_points`` -- integer (default: 100); number of points to plot\n      in each direction of the grid\n\n    - ``interpolation`` -- string (default: ``'catrom'``), the interpolation\n      method to use: ``'bilinear'``, ``'bicubic'``, ``'spline16'``,\n      ``'spline36'``, ``'quadric'``, ``'gaussian'``, ``'sinc'``,\n      ``'bessel'``, ``'mitchell'``, ``'lanczos'``, ``'catrom'``,\n      ``'hermite'``, ``'hanning'``, ``'hamming'``, ``'kaiser'``\n        \n\n    ";
static PyMethodDef __pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_2basin_plot = {__Pyx_NAMESTR("basin_plot"), (PyCFunction)__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_2basin_plot, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_2basin_plot)};
static PyObject *__pyx_pf_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_2basin_plot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_roots = 0;
  PyObject *__pyx_v_xrange = 0;
  PyObject *__pyx_v_yrange = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_v_Graphics;
  PyObject *__pyx_v_setup_for_eval_on_grid;
  PyObject *__pyx_v_fast_callable;
  PyObject *__pyx_v_CDF;
  PyObject *__pyx_v_x;
  PyObject *__pyx_v_prefunc;
  PyObject *__pyx_v_f;
  PyObject *__pyx_v_newtf;
  struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *__pyx_v_cutoff = 0;
  struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *__pyx_v_Finder = 0;
  PyObject *__pyx_v_f1;
  double __pyx_v_t;
  double __pyx_v_u;
  PyObject *__pyx_v_ignore;
  PyObject *__pyx_v_ranges;
  PyObject *__pyx_v_z_values;
  PyObject *__pyx_v_g;
  PyObject *__pyx_v_temp;
  PyObject *__pyx_v_root;
  PyObject *__pyx_v_r;
  PyObject *__pyx_r = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__roots,&__pyx_n_s__xrange,&__pyx_n_s__yrange,0};
  __Pyx_RefNannySetupContext("basin_plot");
  __pyx_self = __pyx_self;
  __pyx_v_options = PyDict_New(); if (unlikely(!__pyx_v_options)) return NULL;
  __Pyx_GOTREF(__pyx_v_options);
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    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;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__roots);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xrange);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("basin_plot", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__yrange);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("basin_plot", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_options, values, PyTuple_GET_SIZE(__pyx_args), "basin_plot") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_roots = ((PyObject*)values[0]);
    __pyx_v_xrange = values[1];
    __pyx_v_yrange = values[2];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_roots = ((PyObject*)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_xrange = PyTuple_GET_ITEM(__pyx_args, 1);
    __pyx_v_yrange = PyTuple_GET_ITEM(__pyx_args, 2);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("basin_plot", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_options);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.basin_plot");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_roots);
  __Pyx_INCREF(__pyx_v_xrange);
  __Pyx_INCREF(__pyx_v_yrange);
  __pyx_v_Graphics = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_setup_for_eval_on_grid = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_fast_callable = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_CDF = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_x = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_prefunc = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_newtf = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_f1 = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_ignore = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_ranges = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_z_values = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_g = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_temp = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_r = Py_None; __Pyx_INCREF(Py_None);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_roots), (&PyList_Type), 1, "roots", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":207
 * 
 * @options(plot_points=3, interpolation='nearest')
 * def basin_plot(list roots, xrange, yrange, **options):             # <<<<<<<<<<<<<<
 *     r"""
 *     ``complex_plot`` takes a complex function of one variable,
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_2basin_plot, NULL, __pyx_n_s_29); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__basin_plot, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":207
 * 
 * @options(plot_points=3, interpolation='nearest')
 * def basin_plot(list roots, xrange, yrange, **options):             # <<<<<<<<<<<<<<
 *     r"""
 *     ``complex_plot`` takes a complex function of one variable,
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__basin_plot); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__basin_plot, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 208:     r"""
 209:     ``complex_plot`` takes a complex function of one variable,
 210:     `f(z)` and plots output of the function over the specified
 211:     ``xrange`` and ``yrange`` as demonstrated below. The magnitude of the
 212:     output is indicated by the brightness (with zero being black and
 213:     infinity being white) while the argument is represented by the
 214:     hue (with red being positive real, and increasing through orange,
 215:     yellow, ... as the argument increases).
 216: 
 217:     ``complex_plot(f, (xmin, xmax), (ymin, ymax), ...)``
 218: 
 219:     INPUT:
 220: 
 221:     - ``f`` -- a function of a single complex value `x + iy`
 222: 
 223:     - ``(xmin, xmax)`` -- 2-tuple, the range of ``x`` values
 224: 
 225:     - ``(ymin, ymax)`` -- 2-tuple, the range of ``y`` values
 226: 
 227:     The following inputs must all be passed in as named parameters:
 228: 
 229:     - ``plot_points`` -- integer (default: 100); number of points to plot
 230:       in each direction of the grid
 231: 
 232:     - ``interpolation`` -- string (default: ``'catrom'``), the interpolation
 233:       method to use: ``'bilinear'``, ``'bicubic'``, ``'spline16'``,
 234:       ``'spline36'``, ``'quadric'``, ``'gaussian'``, ``'sinc'``,
 235:       ``'bessel'``, ``'mitchell'``, ``'lanczos'``, ``'catrom'``,
 236:       ``'hermite'``, ``'hanning'``, ``'hamming'``, ``'kaiser'``
 237: 
 238: 
 239:     """
 240:     from sage.plot.plot import Graphics
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":240
 * 
 *     """
 *     from sage.plot.plot import Graphics             # <<<<<<<<<<<<<<
 *     from sage.plot.misc import setup_for_eval_on_grid
 *     from sage.ext.fast_callable import fast_callable
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Graphics));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Graphics));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Graphics));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Graphics); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_Graphics);
  __pyx_v_Graphics = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 241:     from sage.plot.misc import setup_for_eval_on_grid
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":241
 *     """
 *     from sage.plot.plot import Graphics
 *     from sage.plot.misc import setup_for_eval_on_grid             # <<<<<<<<<<<<<<
 *     from sage.ext.fast_callable import fast_callable
 *     from sage.rings.complex_double import CDF
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s_8));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_8));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_7), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_v_setup_for_eval_on_grid);
  __pyx_v_setup_for_eval_on_grid = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 242:     from sage.ext.fast_callable import fast_callable
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":242
 *     from sage.plot.plot import Graphics
 *     from sage.plot.misc import setup_for_eval_on_grid
 *     from sage.ext.fast_callable import fast_callable             # <<<<<<<<<<<<<<
 *     from sage.rings.complex_double import CDF
 *     roots = [CDF(temp) for temp in roots]
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__fast_callable));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__fast_callable));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fast_callable));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_9), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__fast_callable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_fast_callable);
  __pyx_v_fast_callable = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 243:     from sage.rings.complex_double import CDF
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":243
 *     from sage.plot.misc import setup_for_eval_on_grid
 *     from sage.ext.fast_callable import fast_callable
 *     from sage.rings.complex_double import CDF             # <<<<<<<<<<<<<<
 *     roots = [CDF(temp) for temp in roots]
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__CDF));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__CDF));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CDF));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__CDF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_v_CDF);
  __pyx_v_CDF = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 244:     roots = [CDF(temp) for temp in roots]
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":244
 *     from sage.ext.fast_callable import fast_callable
 *     from sage.rings.complex_double import CDF
 *     roots = [CDF(temp) for temp in roots]             # <<<<<<<<<<<<<<
 * 
 *     x = var('x')
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (unlikely(__pyx_v_roots == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_3 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_roots); __Pyx_INCREF(__pyx_t_2);
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
    __Pyx_DECREF(__pyx_v_temp);
    __pyx_v_temp = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_temp);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_temp);
    __Pyx_GIVEREF(__pyx_v_temp);
    __pyx_t_5 = PyObject_Call(__pyx_v_CDF, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_v_roots));
  __pyx_v_roots = __pyx_t_1;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 245: 
 246:     x = var('x')
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":246
 *     roots = [CDF(temp) for temp in roots]
 * 
 *     x = var('x')             # <<<<<<<<<<<<<<
 *     prefunc = prod([(x-root) for root in roots])
 *     f = fast_callable(prefunc, domain=CDF, expect_one_var=True)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__var); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_x);
  __pyx_v_x = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":246
 *     roots = [CDF(temp) for temp in roots]
 * 
 *     x = var('x')             # <<<<<<<<<<<<<<
 *     prefunc = prod([(x-root) for root in roots])
 *     f = fast_callable(prefunc, domain=CDF, expect_one_var=True)
 */
  __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_10));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__x));
  PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
 247:     prefunc = prod([(x-root) for root in roots])
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":247
 * 
 *     x = var('x')
 *     prefunc = prod([(x-root) for root in roots])             # <<<<<<<<<<<<<<
 *     f = fast_callable(prefunc, domain=CDF, expect_one_var=True)
 *     newtf = fast_callable(newt(prefunc), domain=CDF, expect_one_var=True)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_i, __pyx_n_s__prod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (unlikely(__pyx_v_roots == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_3 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_roots); __Pyx_INCREF(__pyx_t_5);
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
    __Pyx_DECREF(__pyx_v_root);
    __pyx_v_root = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_x, __pyx_v_root); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_v_prefunc);
  __pyx_v_prefunc = __pyx_t_1;
  __pyx_t_1 = 0;
 248:     f = fast_callable(prefunc, domain=CDF, expect_one_var=True)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":248
 *     x = var('x')
 *     prefunc = prod([(x-root) for root in roots])
 *     f = fast_callable(prefunc, domain=CDF, expect_one_var=True)             # <<<<<<<<<<<<<<
 *     newtf = fast_callable(newt(prefunc), domain=CDF, expect_one_var=True)
 * 
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_prefunc);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prefunc);
  __Pyx_GIVEREF(__pyx_v_prefunc);
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__domain), __pyx_v_CDF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__expect_one_var), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_v_fast_callable, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_v_f);
  __pyx_v_f = __pyx_t_2;
  __pyx_t_2 = 0;
 249:     newtf = fast_callable(newt(prefunc), domain=CDF, expect_one_var=True)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":249
 *     prefunc = prod([(x-root) for root in roots])
 *     f = fast_callable(prefunc, domain=CDF, expect_one_var=True)
 *     newtf = fast_callable(newt(prefunc), domain=CDF, expect_one_var=True)             # <<<<<<<<<<<<<<
 * 
 *     cdef ComplexDoubleElement cutoff = CDF(1./10)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__newt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(__pyx_v_prefunc);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_prefunc);
  __Pyx_GIVEREF(__pyx_v_prefunc);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__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 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__domain), __pyx_v_CDF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__expect_one_var), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_v_fast_callable, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_newtf);
  __pyx_v_newtf = __pyx_t_2;
  __pyx_t_2 = 0;
 250: 
 251:     cdef ComplexDoubleElement cutoff = CDF(1./10)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":251
 *     newtf = fast_callable(newt(prefunc), domain=CDF, expect_one_var=True)
 * 
 *     cdef ComplexDoubleElement cutoff = CDF(1./10)             # <<<<<<<<<<<<<<
 * 
 *     cdef RootFinder Finder = RootFinder(roots,newtf)
 */
  __pyx_t_2 = PyFloat_FromDouble((1. / 10.0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __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 = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__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 = PyObject_Call(__pyx_v_CDF, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4sage_5rings_14complex_double_ComplexDoubleElement))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_cutoff = ((struct __pyx_obj_4sage_5rings_14complex_double_ComplexDoubleElement *)__pyx_t_2);
  __pyx_t_2 = 0;
 252: 
 253:     cdef RootFinder Finder = RootFinder(roots,newtf)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":253
 *     cdef ComplexDoubleElement cutoff = CDF(1./10)
 * 
 *     cdef RootFinder Finder = RootFinder(roots,newtf)             # <<<<<<<<<<<<<<
 *     f1 = Finder.which_root
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_roots));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_roots));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_roots));
  __Pyx_INCREF(__pyx_v_newtf);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_newtf);
  __Pyx_GIVEREF(__pyx_v_newtf);
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_Finder = ((struct __pyx_obj_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_RootFinder *)__pyx_t_1);
  __pyx_t_1 = 0;
 254:     f1 = Finder.which_root
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":254
 * 
 *     cdef RootFinder Finder = RootFinder(roots,newtf)
 *     f1 = Finder.which_root             # <<<<<<<<<<<<<<
 * 
 *     cdef double t, u
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_Finder), __pyx_n_s__which_root); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_f1);
  __pyx_v_f1 = __pyx_t_1;
  __pyx_t_1 = 0;
 255: 
 256:     cdef double t, u
 257:     ignore, ranges = setup_for_eval_on_grid([], [xrange, yrange], options['plot_points'])
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":257
 * 
 *     cdef double t, u
 *     ignore, ranges = setup_for_eval_on_grid([], [xrange, yrange], options['plot_points'])             # <<<<<<<<<<<<<<
 *     xrange,yrange=[r[:2] for r in ranges]
 *     sig_on()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_xrange);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_xrange);
  __Pyx_GIVEREF(__pyx_v_xrange);
  __Pyx_INCREF(__pyx_v_yrange);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_yrange);
  __Pyx_GIVEREF(__pyx_v_yrange);
  __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_options), ((PyObject *)__pyx_n_s__plot_points)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_v_setup_for_eval_on_grid, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 2)) {
    PyObject* tuple = __pyx_t_5;
    __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_ignore);
    __pyx_v_ignore = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_v_ranges);
    __pyx_v_ranges = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_EndUnpack(__pyx_t_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_ignore);
    __pyx_v_ignore = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_v_ranges);
    __pyx_v_ranges = __pyx_t_2;
    __pyx_t_2 = 0;
  }
 258:     xrange,yrange=[r[:2] for r in ranges]
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":258
 *     cdef double t, u
 *     ignore, ranges = setup_for_eval_on_grid([], [xrange, yrange], options['plot_points'])
 *     xrange,yrange=[r[:2] for r in ranges]             # <<<<<<<<<<<<<<
 *     sig_on()
 *     z_values = [[  f1(new_CDF_element(t, u)) for t in srange(*ranges[0], include_endpoint=True)]
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyList_CheckExact(__pyx_v_ranges) || PyTuple_CheckExact(__pyx_v_ranges)) {
    __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_ranges; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ranges); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
    } else {
      __pyx_t_4 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_4) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_v_r);
    __pyx_v_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_r, 0, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyTuple_CheckExact(((PyObject *)__pyx_t_5)) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_t_5)) == 2)) {
    PyObject* tuple = ((PyObject *)__pyx_t_5);
    __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_xrange);
    __pyx_v_xrange = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_yrange);
    __pyx_v_yrange = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_1, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_EndUnpack(__pyx_t_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_xrange);
    __pyx_v_xrange = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_yrange);
    __pyx_v_yrange = __pyx_t_4;
    __pyx_t_4 = 0;
  }
 259:     sig_on()
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":259
 *     ignore, ranges = setup_for_eval_on_grid([], [xrange, yrange], options['plot_points'])
 *     xrange,yrange=[r[:2] for r in ranges]
 *     sig_on()             # <<<<<<<<<<<<<<
 *     z_values = [[  f1(new_CDF_element(t, u)) for t in srange(*ranges[0], include_endpoint=True)]
 *                                             for u in srange(*ranges[1], include_endpoint=True)]
 */
  __pyx_t_6 = sig_on(); if (unlikely(__pyx_t_6 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 260:     z_values = [[  f1(new_CDF_element(t, u)) for t in srange(*ranges[0], include_endpoint=True)]
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":260
 *     xrange,yrange=[r[:2] for r in ranges]
 *     sig_on()
 *     z_values = [[  f1(new_CDF_element(t, u)) for t in srange(*ranges[0], include_endpoint=True)]             # <<<<<<<<<<<<<<
 *                                             for u in srange(*ranges[1], include_endpoint=True)]
 * #    print z_values
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));

    /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":260
 *     xrange,yrange=[r[:2] for r in ranges]
 *     sig_on()
 *     z_values = [[  f1(new_CDF_element(t, u)) for t in srange(*ranges[0], include_endpoint=True)]             # <<<<<<<<<<<<<<
 *                                             for u in srange(*ranges[1], include_endpoint=True)]
 * #    print z_values
 */
    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__srange); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ranges, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_10));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__include_endpoint), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (PyList_CheckExact(__pyx_t_11) || PyTuple_CheckExact(__pyx_t_11)) {
      __pyx_t_9 = 0; __pyx_t_4 = __pyx_t_11; __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
        __pyx_t_11 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++;
      } else {
        __pyx_t_11 = PyIter_Next(__pyx_t_4);
        if (!__pyx_t_11) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_11);
      }
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_v_t = __pyx_t_8;
      __pyx_t_11 = ((PyObject *)__pyx_f_71_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0_new_CDF_element(__pyx_v_t, __pyx_v_u)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_10));
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_Call(__pyx_v_f1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      if (unlikely(PyList_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_5));
  __Pyx_DECREF(((PyObject *)__pyx_v_z_values));
  __pyx_v_z_values = __pyx_t_5;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 261:                                             for u in srange(*ranges[1], include_endpoint=True)]
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":261
 *     sig_on()
 *     z_values = [[  f1(new_CDF_element(t, u)) for t in srange(*ranges[0], include_endpoint=True)]
 *                                             for u in srange(*ranges[1], include_endpoint=True)]             # <<<<<<<<<<<<<<
 * #    print z_values
 *     sig_off()
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__srange); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ranges, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__include_endpoint), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++;
    } else {
      __pyx_t_7 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_7) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_u = __pyx_t_8;
 262: #    print z_values
 263:     sig_off()
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":263
 *                                             for u in srange(*ranges[1], include_endpoint=True)]
 * #    print z_values
 *     sig_off()             # <<<<<<<<<<<<<<
 *     g = Graphics()
 *     g._set_extra_kwds(Graphics._extract_kwds_for_show(options, ignore=['xmin', 'xmax']))
 */
  sig_off();
 264:     g = Graphics()
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":264
 * #    print z_values
 *     sig_off()
 *     g = Graphics()             # <<<<<<<<<<<<<<
 *     g._set_extra_kwds(Graphics._extract_kwds_for_show(options, ignore=['xmin', 'xmax']))
 *     g.add_primitive(BasinPlot(roots, z_values, xrange, yrange, options))
 */
  __pyx_t_5 = PyObject_Call(__pyx_v_Graphics, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_v_g);
  __pyx_v_g = __pyx_t_5;
  __pyx_t_5 = 0;
 265:     g._set_extra_kwds(Graphics._extract_kwds_for_show(options, ignore=['xmin', 'xmax']))
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":265
 *     sig_off()
 *     g = Graphics()
 *     g._set_extra_kwds(Graphics._extract_kwds_for_show(options, ignore=['xmin', 'xmax']))             # <<<<<<<<<<<<<<
 *     g.add_primitive(BasinPlot(roots, z_values, xrange, yrange, options))
 *     return g
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_g, __pyx_n_s___set_extra_kwds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_Graphics, __pyx_n_s_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __Pyx_INCREF(((PyObject *)__pyx_v_options));
  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_options));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_options));
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_11));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__xmin));
  PyList_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_n_s__xmin));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__xmin));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__xmax));
  PyList_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_n_s__xmax));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__xmax));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__ignore), ((PyObject *)__pyx_t_11)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 0;
  __pyx_t_11 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 266:     g.add_primitive(BasinPlot(roots, z_values, xrange, yrange, options))
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":266
 *     g = Graphics()
 *     g._set_extra_kwds(Graphics._extract_kwds_for_show(options, ignore=['xmin', 'xmax']))
 *     g.add_primitive(BasinPlot(roots, z_values, xrange, yrange, options))             # <<<<<<<<<<<<<<
 *     return g
 */
  __pyx_t_11 = PyObject_GetAttr(__pyx_v_g, __pyx_n_s__add_primitive); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__BasinPlot); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_v_roots));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_roots));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_roots));
  __Pyx_INCREF(((PyObject *)__pyx_v_z_values));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_z_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_z_values));
  __Pyx_INCREF(__pyx_v_xrange);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_xrange);
  __Pyx_GIVEREF(__pyx_v_xrange);
  __Pyx_INCREF(__pyx_v_yrange);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_yrange);
  __Pyx_GIVEREF(__pyx_v_yrange);
  __Pyx_INCREF(((PyObject *)__pyx_v_options));
  PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_options));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_options));
  __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 267:     return g
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.pyx":267
 *     g._set_extra_kwds(Graphics._extract_kwds_for_show(options, ignore=['xmin', 'xmax']))
 *     g.add_primitive(BasinPlot(roots, z_values, xrange, yrange, options))
 *     return g             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_g);
  __pyx_r = __pyx_v_g;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_78_code_sage30_spyx_0.basin_plot");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_options);
  __Pyx_DECREF(__pyx_v_Graphics);
  __Pyx_DECREF(__pyx_v_setup_for_eval_on_grid);
  __Pyx_DECREF(__pyx_v_fast_callable);
  __Pyx_DECREF(__pyx_v_CDF);
  __Pyx_DECREF(__pyx_v_x);
  __Pyx_DECREF(__pyx_v_prefunc);
  __Pyx_DECREF(__pyx_v_f);
  __Pyx_DECREF(__pyx_v_newtf);
  __Pyx_XDECREF((PyObject *)__pyx_v_cutoff);
  __Pyx_XDECREF((PyObject *)__pyx_v_Finder);
  __Pyx_DECREF(__pyx_v_f1);
  __Pyx_DECREF(__pyx_v_ignore);
  __Pyx_DECREF(__pyx_v_ranges);
  __Pyx_DECREF(__pyx_v_z_values);
  __Pyx_DECREF(__pyx_v_g);
  __Pyx_DECREF(__pyx_v_temp);
  __Pyx_DECREF(__pyx_v_root);
  __Pyx_DECREF(__pyx_v_r);
  __Pyx_DECREF(__pyx_v_roots);
  __Pyx_DECREF(__pyx_v_xrange);
  __Pyx_DECREF(__pyx_v_yrange);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}